-
Notifications
You must be signed in to change notification settings - Fork 685
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
link: close tracefs event if perf event cannot be opened #699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember pointing this out in the initial Kprobe implementation, here's the discussion: #265 (comment). I have no strong opinion but prefer cleaning it up /cc @ti-mo
Thanks, I read the discussion: #265 (comment). I should briefly describe my scene:
Therefore, I should add |
bbf2481
to
d590803
Compare
@nashuiliang Thanks for the patch! I've force-pushed an alternative solution to your branch that makes sure this is not forgotten in the future. Is there a way this could be tested? This seems fairly tricky to do. |
@ti-mo Wow, cool! The test method is more complicated. It can be triggered manually, and it is difficult to write test code at the same time. |
Interesting! Out of curiosity, which errno do you get from perf_event_open? |
Error: |
If a livepatch handler is already active on the symbol, the write to tracefs will succeed, a trace event will show up, but creating the perf event will fail. Signed-off-by: Chuang Wang <nashuiliang@gmail.com> Co-authored-by: Timo Beckers <timo@isovalent.com>
d590803
to
c80b538
Compare
When getTraceEventID() or openTracepointPerfEvent() returns an error,
tracefs event (e.g. /sys/kernel/debug/tracing/events/), which has
been created by createTraceFSProbeEvent(), is not cleaned up.
Signed-off-by: Chuang Wang nashuiliang@gmail.com