Skip to content

Commit

Permalink
Check if raw tracepoint in module is supported
Browse files Browse the repository at this point in the history
Actually there are two stages to fully support raw tracepoint: the
first stage is only for in-kernel functions, and the second stage is
for kernel modules. For the latter stage, the corresponding kernel
commit is a38d1107, and it is merged since v5.0.

Signed-off-by: Fei Li <[email protected]>
  • Loading branch information
ShirleyFei authored and yonghong-song committed Jul 11, 2021
1 parent 4e8e8c6 commit 4535251
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/python/bcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,18 @@ def support_raw_tracepoint():
return True
return False

@staticmethod
def support_raw_tracepoint_in_module():
# kernel symbol "bpf_trace_modules" indicates raw tp support in modules, ref: kernel commit a38d1107
kallsyms = "/proc/kallsyms"
with open(kallsyms) as syms:
for line in syms:
(_, _, name) = line.rstrip().split(" ", 2)
name = name.split("\t")[0]
if name == "bpf_trace_modules":
return True
return False

def detach_tracepoint(self, tp=b""):
"""detach_tracepoint(tp="")
Expand Down

0 comments on commit 4535251

Please sign in to comment.