mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
samples/bpf: replace meaningless counter with tracex4
Currently, compiling samples/bpf with LLVM warns about the unused but set variable with tracex4_user. ./samples/bpf/tracex4_user.c:54:14: warning: variable 'i' set but not used [-Wunused-but-set-variable] int map_fd, i, j = 0; ^ 1 warning generated. This commit resolve this compiler warning by replacing the meaningless counter. Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/r/20221218061453.6287-3-danieltimlee@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
This commit is contained in:
parent
13aa2a9284
commit
71135b77aa
@ -51,7 +51,7 @@ int main(int ac, char **argv)
|
|||||||
struct bpf_program *prog;
|
struct bpf_program *prog;
|
||||||
struct bpf_object *obj;
|
struct bpf_object *obj;
|
||||||
char filename[256];
|
char filename[256];
|
||||||
int map_fd, i, j = 0;
|
int map_fd, j = 0;
|
||||||
|
|
||||||
snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
|
snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
|
||||||
obj = bpf_object__open_file(filename, NULL);
|
obj = bpf_object__open_file(filename, NULL);
|
||||||
@ -82,7 +82,7 @@ int main(int ac, char **argv)
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; ; i++) {
|
while (1) {
|
||||||
print_old_objects(map_fd);
|
print_old_objects(map_fd);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user