diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-12-19 22:42:58 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-01-03 16:45:54 -0500 |
commit | 414028d689376a6c4e9065cbcba99c11a4f26dd8 (patch) | |
tree | 66f5cfd2ce126c92f8866eac35babfaf2b680a46 | |
parent | 169a55a0e8e8aacf4f9998ae00d749e447ac3f51 (diff) | |
download | libtraceevent-414028d689376a6c4e9065cbcba99c11a4f26dd8.tar.gz |
libtraceevent: Allow stack traces to show offset too
The stack traces only show the function name and the full address, which
can be useless for running under gdb, because the address could be
randomized, and to find the locations within the functions, the offsets
from the start of the function really need to be displayed and not just
the full address, as the address isn't known by gdb.
Have the function plugin "offset" option affect stack traces too. That
way, there's a way to display the offsets of the functions too.
Link: https://lore.kernel.org/linux-trace-devel/20221219224258.68a86565@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r-- | plugins/plugin_function.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c index 7777569..2d6509b 100644 --- a/plugins/plugin_function.c +++ b/plugins/plugin_function.c @@ -233,9 +233,11 @@ trace_stack_handler(struct trace_seq *s, struct tep_record *record, break; func = tep_find_function(event->tep, addr); - if (func) - trace_seq_printf(s, "=> %s (%llx)\n", func, addr); - else + if (func) { + trace_seq_puts(s, "=> "); + show_function(s, event->tep, func, addr); + trace_seq_printf(s, " (%llx)\n", addr); + } else trace_seq_printf(s, "=> %llx\n", addr); } |