提交 84c104ad 编写于 作者: A Andy Isaacson 提交者: Arnaldo Carvalho de Melo

perf debug: fix hex dump partial final line

The loop counter math in trace_event was much more complicated than
necessary, resulting in incorrectly decoding the human-readable
portion of the partial last line of hexdump in "perf trace -D" output:

.  0020:  00 00 00 00 00 00 00 00 2f 73 62 69 6e 2f 69 6e  ......../sbin/i
.  0030:  69 74 00 00 00 00 00 00                          /sbin/i

With this fixed (and simpler!) code, we get the correct output:

.  0020:  00 00 00 00 00 00 00 00 2f 73 62 69 6e 2f 69 6e  ......../sbin/in
.  0030:  69 74 00 00 00 00 00 00                          it......

Cc: Ingo Molnar <mingo@elte.hu>
LPU-Reference: <20100612024404.GA24469@hexapodia.org>
Signed-off-by: NAndy Isaacson <adi@hexapodia.org>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 9ed7e1b8
......@@ -86,12 +86,10 @@ void trace_event(event_t *event)
dump_printf_color(" ", color);
for (j = 0; j < 15-(i & 15); j++)
dump_printf_color(" ", color);
for (j = 0; j < (i & 15); j++) {
if (isprint(raw_event[i-15+j]))
dump_printf_color("%c", color,
raw_event[i-15+j]);
else
dump_printf_color(".", color);
for (j = i & ~15; j <= i; j++) {
dump_printf_color("%c", color,
isprint(raw_event[j]) ?
raw_event[j] : '.');
}
dump_printf_color("\n", color);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册