Commit fe033552 authored by Paul Chaignon's avatar Paul Chaignon

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.
parent 484e5253
...@@ -477,10 +477,11 @@ class BPF(object): ...@@ -477,10 +477,11 @@ class BPF(object):
blacklist = set([line.rstrip().split()[1] for line in blacklist = set([line.rstrip().split()[1] for line in
blacklist_file]) blacklist_file])
fns = [] fns = []
with open("%s/available_filter_functions" % TRACEFS) as avail_file: with open("/proc/kallsyms") as avail_file:
for line in avail_file: for line in avail_file:
fn = line.rstrip().split()[0] (_, t, fn) = line.rstrip().split()[:3]
if re.match(event_re, fn) and fn not in blacklist: if (t.lower() in ['t', 'w']) and re.match(event_re, fn) \
and fn not in blacklist:
fns.append(fn) fns.append(fn)
return set(fns) # Some functions may appear more than once return set(fns) # Some functions may appear more than once
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment