Adrian Hunter
9fbe8ea8df
perf script: Fix hex dump character output
...
commit 62942e9fda9fd1def10ffcbd5e1c025b3c9eec17 upstream.
Using grep -C with perf script -D can give erroneous results as grep loses
lines due to non-printable characters, for example, below the 0020, 0060
and 0070 lines are missing:
$ perf script -D | grep -C10 AUX | head
. 0010: 08 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 ................
. 0030: 01 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ................
. 0040: 00 08 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................
. 0050: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
. 0080: 02 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 ................
. 0090: 00 00 00 00 00 00 00 00 ........
0 0 0x450 [0x98]: PERF_RECORD_AUXTRACE_INFO type: 1
PMU Type 8
Time Shift 31
perf's isprint() is a custom implementation from the kernel, but the
kernel's _ctype appears to include characters from Latin-1 Supplement which
is not compatible with, for example, UTF-8. Fix by checking also isascii().
After:
$ tools/perf/perf script -D | grep -C10 AUX | head
. 0010: 08 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 ................
. 0020: 03 84 32 2f 00 00 00 00 63 7c 4f d2 fa ff ff ff ..2/....c|O.....
. 0030: 01 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ................
. 0040: 00 08 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................
. 0050: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
. 0060: 00 02 00 00 00 00 00 00 00 c0 03 00 00 00 00 00 ................
. 0070: e2 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................
. 0080: 02 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 ................
. 0090: 00 00 00 00 00 00 00 00 ........
Fixes: 3052ba56bcb58904 ("tools perf: Move from sane_ctype.h obtained from git to the Linux's original")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20220112085057.277205-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 09:19:54 +01:00
..
2020-08-05 09:59:49 +02:00
2021-11-26 10:47:18 +01:00
2020-09-05 11:22:49 +02:00
2019-08-26 11:58:29 -03:00
2019-10-15 11:47:38 -03:00
2019-09-25 09:51:49 -03:00
2021-06-03 08:59:08 +02:00
2021-05-22 11:38:30 +02:00
2021-06-03 08:59:00 +02:00
2021-11-26 10:47:18 +01:00
2021-05-14 09:44:30 +02:00
2021-12-08 09:01:10 +01:00
2022-01-27 09:19:54 +01:00
2019-08-31 22:27:52 -03:00
2019-09-20 15:58:11 -03:00
2019-08-29 17:38:32 -03:00
2019-09-20 15:58:11 -03:00
2019-09-20 15:58:11 -03:00
2020-02-05 21:22:40 +00:00
2019-09-20 09:19:20 -03:00
2019-08-31 19:10:19 -03:00
2020-01-04 19:18:26 +01:00
2019-09-25 16:26:34 -03:00
2021-05-07 10:51:37 +02:00
2019-08-31 19:10:19 -03:00
2021-07-28 13:31:02 +02:00
2019-08-31 22:24:10 -03:00
2019-10-16 10:08:32 -03:00
2019-09-30 17:29:54 -03:00
2019-09-25 09:51:42 -03:00
2020-11-24 13:29:05 +01:00
2019-09-20 15:58:11 -03:00
2020-06-22 09:31:27 +02:00
2020-09-09 19:12:36 +02:00
2021-12-08 09:01:10 +01:00
2019-09-25 16:26:34 -03:00
2022-01-05 12:37:46 +01:00
2020-10-29 09:57:50 +01:00
2019-09-20 15:58:11 -03:00
2020-10-14 10:32:59 +02:00
2020-11-18 19:20:18 +01:00
2019-08-31 22:27:48 -03:00
2019-08-28 17:19:34 -03:00
2019-09-30 17:29:22 -03:00
2020-04-01 11:02:00 +02:00
2021-12-14 14:49:03 +01:00
2021-01-30 13:54:10 +01:00
2019-10-31 21:38:41 +01:00
2019-09-25 09:51:49 -03:00
2019-08-29 17:38:32 -03:00