diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-07-24 18:25:47 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-09-10 16:48:45 +0200 |
commit | fef5aeeee9e3717e7aea991a7ae9ff6a7a2d4c85 (patch) | |
tree | 1f74c6eb67ec987361f32e3d891132ecc5b1aa68 /firmware | |
parent | ftrace: Annotate the ops operation on update (diff) | |
download | linux-fef5aeeee9e3717e7aea991a7ae9ff6a7a2d4c85.tar.xz linux-fef5aeeee9e3717e7aea991a7ae9ff6a7a2d4c85.zip |
ftrace: Replace tramp_hash with old_*_hash to save space
Allowing function callbacks to declare their own trampolines requires
that each ftrace_ops that has a trampoline must have some sort of
accounting that keeps track of which ops has a trampoline attached
to a record.
The easy way to solve this was to add a "tramp_hash" that created a
hash entry for every function that a ops uses with a trampoline.
But since we can have literally tens of thousands of functions being
traced, that means we need tens of thousands of descriptors to map
the ops to the function in the hash. This is quite expensive and
can cause enabling and disabling the function graph tracer to take
some time to start and stop. It can take up to several seconds to
disable or enable all functions in the function graph tracer for this
reason.
The better approach albeit more complex, is to keep track of how ops
are being enabled and disabled, and use that along with the counting
of the number of ops attached to records, to determive what ops has
a trampoline attached to a record at enabling and disabling of
tracing.
To do this, the tramp_hash has been replaced with an old_filter_hash
and old_notrace_hash, which get the copy of the ops filter_hash and
notrace_hash respectively. The old hashes is kept until the ops has
been modified or removed and the old hashes are used with the logic
of the accounting to determine the ops that have the trampoline of
a record. The reason this has less of a footprint is due to the trick
that an "empty" hash in the filter_hash means "all functions" and
an empty hash in the notrace hash means "no functions" in the hash.
This is much more efficienct, doesn't have the delay, and takes up
much less memory, as we do not need to map all the functions but
just figure out which functions are mapped at the time it is
enabled or disabled.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions