-
Notifications
You must be signed in to change notification settings - Fork 431
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
fix(events): fix ftrace_hook #3896
Conversation
@OriGlassman I have this PR #3848 related to Events States. I think it's worth taking a look just to catch on upcoming changes. |
55e9066
to
83a9378
Compare
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.
LGTM
Had only one comment but its out of the PR scope
} | ||
|
||
uniqueHooksMap[key] = struct{}{} | ||
|
||
log(definition.GetName(), p.GetProgramName()) |
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 know this is not part of the current code, but shouldn't we use the logger.Infow
here?
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.
This is a change done by a previous maintainer so not sure the about motivation
We need to count how many ftrace based hooks will be placed on each symbol. eventsState may contain duplicate events due to dependencies. To get the real count, we consider the program name and the prob type. Furthermore, added logic that addresses the situation where there may be multiple k[ret]probes from a single probe request (due to multiple symbols at different locations).
83a9378
to
fead5f3
Compare
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.
LGTM
1. Explain what the PR does
We need to count how many ftrace based hooks will be placed on each symbol. eventsState may contain duplicate events due to dependencies. To get the real count, we consider the program name and the prob type. Furthermore, added logic that addresses the situation where there may be multiple k[ret]probes from a single probe request (due to multiple symbols at different locations).
2. Explain how to test it
./tracee -e=ftrace_hook
3. Other comments