]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Fix char print issue in print_ip_ins()
authorZheng Yejian <zhengyejian1@huawei.com>
Tue, 11 Oct 2022 12:03:52 +0000 (12:03 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 12 Oct 2022 11:05:47 +0000 (07:05 -0400)
commit2d4686fbea70c24a37978c75b8ece93209ca1406
treecc10eac59bb68a30e9bec297c6ddfc12150fc6ce
parenta8b3affb383ba5bfabe910878118e2723be32bb0
ftrace: Fix char print issue in print_ip_ins()

When ftrace bug happened, following log shows every hex data in
problematic ip address:
  actual:   ffffffe8:6b:ffffffd9:01:21

But so many 'f's seem a little confusing, and that is because format
'%x' being used to print signed chars in array 'ins'. As suggested
by Joe, change to use format "%*phC" to print array 'ins'.

After this patch, the log is like:
  actual:   e8:6b:d9:01:21

Link: https://lkml.kernel.org/r/20221011120352.1878494-1-zhengyejian1@huawei.com
Fixes: a2df1ca473ad ("ftrace: Do not blindly read the ip address in ftrace_bug()")
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c