Improve verbose output.
This commit is contained in:
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
|
|||||||
// Update config.
|
// Update config.
|
||||||
if ((ret = LoadConfig(&cfg, cmd.cfgfile)) != 0)
|
if ((ret = LoadConfig(&cfg, cmd.cfgfile)) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[WARNING] Failed to load config after update check (%d)\n", ret);
|
fprintf(stderr, "[WARNING] Failed to load config after update check (%d)...\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update BPF maps.
|
// Update BPF maps.
|
||||||
@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (CalculateStats(stats_map, cpus))
|
if (CalculateStats(stats_map, cpus))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[WARNING] Failed to calculate packet stats. Stats map FD => %d.\n", stats_map);
|
fprintf(stderr, "[WARNING] Failed to calculate packet stats. Stats map FD => %d...\n", stats_map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ int CalculateStats(int stats_map, int cpus)
|
|||||||
// Therefore, before accessing stats[i], make sure the pointer to the specific CPU ID is not NULL.
|
// Therefore, before accessing stats[i], make sure the pointer to the specific CPU ID is not NULL.
|
||||||
if (&stats[i] == NULL)
|
if (&stats[i] == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Stats array at CPU ID #%d is NULL! Skipping...\n", i);
|
fprintf(stderr, "[WARNING] Stats array at CPU ID #%d is NULL! Skipping...\n", i);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ int AttachXdp(struct xdp_program *prog, int ifidx, u8 detach, cmdline_t *cmd)
|
|||||||
|
|
||||||
if (detach < 1)
|
if (detach < 1)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "Loaded XDP program on mode %s.\n", smode);
|
fprintf(stdout, "Loaded XDP program on mode %s...\n", smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
@@ -194,7 +194,7 @@ void UpdateFilters(int filters_map, config__t *cfg)
|
|||||||
// Attempt to update BPF map.
|
// Attempt to update BPF map.
|
||||||
if ((ret = bpf_map_update_elem(filters_map, &i, &filter, BPF_ANY)) != 0)
|
if ((ret = bpf_map_update_elem(filters_map, &i, &filter, BPF_ANY)) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[WARNING] Failed to update filter #%d due to BPF update error (%d).\n", i, ret);
|
fprintf(stderr, "[WARNING] Failed to update filter #%d due to BPF update error (%d)...\n", i, ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user