diff options
author | Jan Hák <jan.hak@nic.cz> | 2024-11-26 12:56:51 +0100 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2024-12-11 17:36:20 +0100 |
commit | 5e481225de1dc4ae16a2310bf1db50380182d7b5 (patch) | |
tree | ab65a8da32f723000d8e727d53cd8c2f84bc0874 | |
parent | stats: fix usage of new atomic in code (variable stats_vals) (diff) | |
download | knot-5e481225de1dc4ae16a2310bf1db50380182d7b5.tar.xz knot-5e481225de1dc4ae16a2310bf1db50380182d7b5.zip |
kxdpgun: fix usage of new atomic in code (variables stats_trigger and stats_switch)
-rw-r--r-- | src/utils/kxdpgun/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/utils/kxdpgun/main.c b/src/utils/kxdpgun/main.c index 3c036034a..8698adbcd 100644 --- a/src/utils/kxdpgun/main.c +++ b/src/utils/kxdpgun/main.c @@ -58,8 +58,8 @@ volatile int xdp_trigger = KXDPGUN_WAIT; -volatile knot_atomic_uint64_t stats_trigger = 0; -volatile knot_atomic_bool stats_switch = STATS_SUM; +knot_atomic_uint64_t stats_trigger; +knot_atomic_bool stats_switch; unsigned global_cpu_aff_start = 0; unsigned global_cpu_aff_step = 1; @@ -1349,6 +1349,8 @@ static bool get_opts(int argc, char *argv[], xdp_gun_ctx_t *ctx) int main(int argc, char *argv[]) { int ecode = EXIT_FAILURE; + ATOMIC_INIT(stats_trigger, 0); + ATOMIC_INIT(stats_switch, STATS_SUM); xdp_gun_ctx_t ctx = ctx_defaults, *thread_ctxs = NULL; ctx.msgid = time(NULL) % UINT16_MAX; @@ -1425,6 +1427,8 @@ int main(int argc, char *argv[]) ecode = EXIT_SUCCESS; err: + ATOMIC_DEINIT(stats_trigger); + ATOMIC_DEINIT(stats_switch); free(ctx.rss_conf); free(thread_ctxs); free(threads); |