exclude static functions with prefix __SCT__ (#3772)
authorAchilles <49805408+achilles-git@users.noreply.github.com>
Thu, 23 Dec 2021 18:59:59 +0000 (00:29 +0530)
committerGitHub <noreply@github.com>
Thu, 23 Dec 2021 18:59:59 +0000 (10:59 -0800)
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 <prameet.p@inba-prameet.p-210508>
src/python/bcc/__init__.py

index ceb2884121db88028dab6f6a83da4623e007fa70..2ff5cf020470aa58b1bedc0b52f1bf8e4851644b 100644 (file)
@@ -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