From 3e8eb8b62f6e92aef332b2eab48305220705dfae Mon Sep 17 00:00:00 2001 From: Achilles <49805408+achilles-git@users.noreply.github.com> Date: Fri, 24 Dec 2021 00:29:59 +0530 Subject: [PATCH] exclude static functions with prefix __SCT__ (#3772) The kernel functions with prefix __SCT__ are for static calls. These static call functions are not in /sys/kernel/debug/tracing/available_filter_functions and not in /sys/kernel/debug/kprobes/blacklist either. Let us do filtering in get_kprobe_functions() to filter them out. Co-authored-by: prameet.p --- src/python/bcc/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py index ceb28841..2ff5cf02 100644 --- a/src/python/bcc/__init__.py +++ b/src/python/bcc/__init__.py @@ -737,6 +737,10 @@ class BPF(object): # non-attachable. elif fn.startswith(b'__perf') or fn.startswith(b'perf_'): continue + # Exclude all static functions with prefix __SCT__, they are + # all non-attachable + elif fn.startswith(b'__SCT__'): + continue # Exclude all gcc 8's extra .cold functions elif re.match(b'^.*\.cold(\.\d+)?$', fn): continue -- 2.34.1