Skip to content

Commit fe03355

Browse files
committed
Use /proc/kallsyms for regex filtering
instead of /sys/kernel/debug/tracing/available_filter_functions. available_filter_functions does not contain all tracable functions, only those ftrace can use.
1 parent 484e525 commit fe03355

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/python/bcc/__init__.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,11 @@ def get_kprobe_functions(event_re):
477477
blacklist = set([line.rstrip().split()[1] for line in
478478
blacklist_file])
479479
fns = []
480-
with open("%s/available_filter_functions" % TRACEFS) as avail_file:
480+
with open("/proc/kallsyms") as avail_file:
481481
for line in avail_file:
482-
fn = line.rstrip().split()[0]
483-
if re.match(event_re, fn) and fn not in blacklist:
482+
(_, t, fn) = line.rstrip().split()[:3]
483+
if (t.lower() in ['t', 'w']) and re.match(event_re, fn) \
484+
and fn not in blacklist:
484485
fns.append(fn)
485486
return set(fns) # Some functions may appear more than once
486487

0 commit comments

Comments
 (0)