Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace use of trace pipe with bpf_perf_event #540

Closed
markdrayton opened this issue May 11, 2016 · 4 comments
Closed

Replace use of trace pipe with bpf_perf_event #540

markdrayton opened this issue May 11, 2016 · 4 comments

Comments

@markdrayton
Copy link
Contributor

BCC tools that read data from the trace pipe are often confused when they come across unexpected output from other tracepoints. Where possible, we should replace use of the trace pipe with perf_event_event. It looks like only 5 scripts still use it (via the trace_fields Python function):

$ grep trace_fields tools/*.py                                                                                          
tools/dcsnoop.py:    (task, pid, cpu, flags, ts, msg) = b.trace_fields()
tools/execsnoop.py:    (task, pid, cpu, flags, ts, msg) = b.trace_fields()
tools/fileslower.py:    (task, pid, cpu, flags, ts, msg) = b.trace_fields()
tools/memleak.py:                print(bpf_program.trace_fields())
tools/stacksnoop.py:    (task, pid, cpu, flags, ts, msg) = b.trace_fields()
@brendangregg
Copy link
Member

Now down to 2:

$ grep trace_fields tools/*.py    
tools/dcsnoop.py:    (task, pid, cpu, flags, ts, msg) = b.trace_fields()
tools/memleak.py:                print(bpf_program.trace_fields())

@markdrayton
Copy link
Contributor Author

I'm not sure it makes sense to convert memleak.py as it only uses the trace pipe to print information. Nothing's parsing the output and converting the script to use the perf system will add a good chunk more code.

@goldshtn
Copy link
Collaborator

Yep, and besides the printing isn't actually useful for anything but debugging the script itself, because of the immense overhead of these printouts.

@markdrayton
Copy link
Contributor Author

Perfect. Let's call this one done then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants