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

Add events to enumerate kernel symbols #21

Closed
wants to merge 2 commits into from
Closed

Conversation

tahini
Copy link
Contributor

@tahini tahini commented Jun 19, 2019

The kernel symbols in the trace allow to resolve function pointers automatically from the trace's data. This can be useful for events having function pointers as fields, like timers, or the callstack-kernel context which lists the kernel addresses of the current callstack.

Details on overhead and event count can be found in the specific commits.

tahini added 2 commits June 19, 2019 10:42
This adds an event for each kernel symbol during statedump. It uses the
kallsyms_on_each_symbol kernel function to go through all available
symbols.

Going through the symbols adds a fixed cost to the statedump (9ms on a
machine where statedump usually takes 20ms, so the overhead for the
statedump is slightly lower than 50%) when tracepoints are _not_
enabled.

With the symbol tracepoints enabled, it adds ~135 000 events and more
than doubles the time of the statedump (adds 35ms, so an overhead of
175% compared to statedump without the symbols). It may cause lost
events with the default channel value since the event rate is very dense
during that time.

A trace with only the kernel symbol events has a size of ~5MB on a
normal desktop. In comparison the /proc/kallsyms fils has 6MB.

Signed-off-by: Geneviève Bastien <[email protected]>
Add tracepoints to enumerate the new symbols brought when a new kernel
module is loaded. It uses the kallsyms_on_each_symbol and filters the
symbols from the new module, as this function is the one exported
from the kernel to list the symbols. It has the same fixed cost from the
function itself (~9ms), whether events are enabled or not.

When the module is unloaded, there is only one event to notify of the
module unload.

Signed-off-by: Geneviève Bastien <[email protected]>
@tahini
Copy link
Contributor Author

tahini commented Jun 19, 2019

To load the new probe automatically in session daemon, see the following PR of lttng-tools: lttng/lttng-tools#153

lttng-kallsyms.c Show resolved Hide resolved
lttng-kallsyms.c Show resolved Hide resolved
lttng-kallsyms.c Show resolved Hide resolved
lttng-kallsyms.c Show resolved Hide resolved
@tahini
Copy link
Contributor Author

tahini commented Jun 19, 2019

Will make a new PR

@tahini tahini closed this Jun 19, 2019
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

Successfully merging this pull request may close these issues.

2 participants