• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Alan-Jowett / ebpf-verifier / 22160684311

18 Feb 2026 09:20PM UTC coverage: 88.256% (+1.1%) from 87.142%
22160684311

push

github

elazarg
lint

Signed-off-by: Elazar Gershuni <elazarg@gmail.com>

78 of 82 new or added lines in 6 files covered. (95.12%)

402 existing lines in 18 files now uncovered.

10731 of 12159 relevant lines covered (88.26%)

837642.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/crab_utils/debug.hpp
1
// Copyright (c) Prevail Verifier contributors.
2
// SPDX-License-Identifier: Apache-2.0
3
#pragma once
4

5
/* Logging and debug messages */
6
#include <iostream>
7
#include <sstream>
8

9
#include <iosfwd>
10
#include <set>
11
#include <string>
12

13
namespace prevail {
14

15
#define CRAB_LOG(TAG, CODE)                          \
16
    do {                                             \
17
        if (CrabLogFlag && CrabLog.count(TAG) > 0) { \
18
            CODE;                                    \
19
        }                                            \
20
    } while (0)
21
extern bool CrabLogFlag;
22
extern std::set<std::string> CrabLog;
23

24
extern unsigned CrabVerbosity;
25
#define CRAB_VERBOSE_IF(LEVEL, CODE)  \
26
    do {                              \
27
        if (CrabVerbosity >= LEVEL) { \
28
            CODE;                     \
29
        }                             \
30
    } while (0)
31

32
template <typename... ArgTypes>
UNCOV
33
void ___print___(std::ostream& os, ArgTypes... args) {
×
34
    // trick to expand variadic argument pack without recursion
35
    using ExpandVariadicPack = int[];
36
    // first zero is to prevent empty braced-init-list
37
    // void() is to prevent Overloaded operator, messing things up
38
    // trick is to use the side effect of list-initializer to call a function
39
    // on every argument.
40
    // (void) is to suppress "statement has no effect" errors
UNCOV
41
    (void)ExpandVariadicPack{0, ((os << args), void(), 0)...};
×
UNCOV
42
}
×
43

44
#define CRAB_ERROR(...)                                                 \
45
    do {                                                                \
46
        std::ostringstream _os;                                         \
47
        _os << "CRAB ERROR: ";                                          \
48
        ___print___(_os, __VA_ARGS__);                                  \
49
        ___print___(_os, "; function ", __func__, ", line ", __LINE__); \
50
        _os << "\n";                                                    \
51
        throw std::runtime_error(_os.str());                            \
52
    } while (0)
53

54
extern bool CrabWarningFlag;
55
void CrabEnableWarningMsg(bool b);
56

57
#define CRAB_WARN(...)                           \
58
    do {                                         \
59
        if (CrabWarningFlag) {                   \
60
            std::cerr << "CRAB WARNING: ";       \
61
            ___print___(std::cerr, __VA_ARGS__); \
62
            std::cerr << "\n";                   \
63
        }                                        \
64
    } while (0)
65

66
} // end namespace prevail
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc