Skip to content
Snippets Groups Projects
Commit 8478cca1 authored by Donglin Peng's avatar Donglin Peng Committed by Masami Hiramatsu (Google)
Browse files

tracing/probe: add a char type to show the character value of traced arguments

There are scenes that we want to show the character value of traced
arguments other than a decimal or hexadecimal or string value for debug
convinience. I add a new type named 'char' to do it and a new test case
file named 'kprobe_args_char.tc' to do selftest for char type.

For example:

The to be traced function is 'void demo_func(char type, char *name);', we
can add a kprobe event as follows to show argument values as we want:

echo  'p:myprobe demo_func $arg1:char +0($arg2):char[5]' > kprobe_events

we will get the following trace log:

... myprobe: (demo_func+0x0/0x29) arg1='A' arg2={'b','p','f','1',''}

Link: https://lore.kernel.org/all/20221219110613.367098-1-dolinux.peng@gmail.com/



Signed-off-by: default avatarDonglin Peng <dolinux.peng@gmail.com>
Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
parent 96cd93af
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment