Skip to content

Commit adf6b57

Browse files
image-dragonAlexei Starovoitov
authored andcommitted
selftests/bpf: skip recursive functions for kprobe_multi
Some functions is recursive for the kprobe_multi and impact the benchmark results. So just skip them. Signed-off-by: Menglong Dong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 8bad31e commit adf6b57

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tools/testing/selftests/bpf/trace_helpers.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <gelf.h>
2020
#include "bpf/hashmap.h"
2121
#include "bpf/libbpf_internal.h"
22+
#include "bpf_util.h"
2223

2324
#define TRACEFS_PIPE "/sys/kernel/tracing/trace_pipe"
2425
#define DEBUGFS_PIPE "/sys/kernel/debug/tracing/trace_pipe"
@@ -540,8 +541,20 @@ static bool is_invalid_entry(char *buf, bool kernel)
540541
return false;
541542
}
542543

544+
static const char * const trace_blacklist[] = {
545+
"migrate_disable",
546+
"migrate_enable",
547+
"rcu_read_unlock_strict",
548+
"preempt_count_add",
549+
"preempt_count_sub",
550+
"__rcu_read_lock",
551+
"__rcu_read_unlock",
552+
};
553+
543554
static bool skip_entry(char *name)
544555
{
556+
int i;
557+
545558
/*
546559
* We attach to almost all kernel functions and some of them
547560
* will cause 'suspicious RCU usage' when fprobe is attached
@@ -559,6 +572,12 @@ static bool skip_entry(char *name)
559572
if (!strncmp(name, "__ftrace_invalid_address__",
560573
sizeof("__ftrace_invalid_address__") - 1))
561574
return true;
575+
576+
for (i = 0; i < ARRAY_SIZE(trace_blacklist); i++) {
577+
if (!strcmp(name, trace_blacklist[i]))
578+
return true;
579+
}
580+
562581
return false;
563582
}
564583

0 commit comments

Comments
 (0)