Set custom LibXDP/LibBPF logging.

This commit is contained in:
Christian Deacon
2025-02-26 11:48:38 -05:00
parent 75ee52555c
commit 8b91e59364
4 changed files with 50 additions and 4 deletions

View File

@@ -85,8 +85,18 @@ int main(int argc, char *argv[])
LogMsg(&cfg, 2, 0, "Loading XDP/BPF program at '%s'...", XDP_OBJ_PATH);
// Determine custom LibBPF log level.
int silent = 1;
if (cfg.verbose > 4)
{
silent = 0;
}
SetLibBPFLogMode(silent);
// Load BPF object.
struct xdp_program *prog = LoadBpfObj(XDP_OBJ_PATH);
struct xdp_program *prog = LoadBpfObj(XDP_OBJ_PATH, strict);
if (prog == NULL)
{