From 34d17b14e550c21eac1322f3d5452fa12a73b8de Mon Sep 17 00:00:00 2001 From: liuq131 Date: Wed, 13 Jul 2022 16:37:44 +0000 Subject: [PATCH] schedmoni: fix bug of variable duplicate definition This error occurs when compiling with gcc11.3.1 --- source/tools/detect/sched/schedmoni/irqoff.c | 2 +- source/tools/detect/sched/schedmoni/nosched.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/tools/detect/sched/schedmoni/irqoff.c b/source/tools/detect/sched/schedmoni/irqoff.c index e2cdbb4d..9c04448d 100644 --- a/source/tools/detect/sched/schedmoni/irqoff.c +++ b/source/tools/detect/sched/schedmoni/irqoff.c @@ -81,7 +81,7 @@ int attach_prog_to_perf(struct schedmoni_bpf *obj, struct bpf_link **sw_mlinks, return !ret; } -char stack[512]; +static char stack[512]; void irqoff_handle_event(void *ctx, int cpu, void *data, __u32 data_sz) { struct event ev, *e; diff --git a/source/tools/detect/sched/schedmoni/nosched.c b/source/tools/detect/sched/schedmoni/nosched.c index d5e29a84..15f0446b 100644 --- a/source/tools/detect/sched/schedmoni/nosched.c +++ b/source/tools/detect/sched/schedmoni/nosched.c @@ -19,7 +19,7 @@ extern volatile sig_atomic_t exiting; extern struct ksym *ksyms; static int stack_fd; -char stack[512]; +static char stack[512]; void handle_event_nosch(void *ctx, int cpu, void *data, __u32 data_sz) { const struct event *e = data; -- Gitee