linux-stable/tools/perf
James Clark 48e8a7b5a5 perf cs-etm: Split --dump-raw-trace by AUX records
Currently --dump-raw-trace skips queueing and splitting buffers because
of an early exit condition in cs_etm__process_auxtrace_info(). Once
that is removed we can print the split data by using the queues
and searching for split buffers with the same reference as the
one that is currently being processed.

This keeps the same behaviour of dumping in file order when an AUXTRACE
event appears, rather than moving trace dump to where AUX records are in
the file.

There will be a newline and size printout for each fragment. For example
this buffer is comprised of two AUX records, but was printed as one:

  0 0 0x8098 [0x30]: PERF_RECORD_AUXTRACE size: 0xa0  offset: 0  ref: 0x491a4dfc52fc0e6e  idx: 0  t

  . ... CoreSight ETM Trace data: size 160 bytes
          Idx:0; ID:10;   I_ASYNC : Alignment Synchronisation.
          Idx:12; ID:10;  I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
          Idx:17; ID:10;  I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000000000000000;
          Idx:80; ID:10;  I_ASYNC : Alignment Synchronisation.
          Idx:92; ID:10;  I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
          Idx:97; ID:10;  I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFDE2AD3FD76D4;

But is now printed as two fragments:

  0 0 0x8098 [0x30]: PERF_RECORD_AUXTRACE size: 0xa0  offset: 0  ref: 0x491a4dfc52fc0e6e  idx: 0  t

  . ... CoreSight ETM Trace data: size 80 bytes
          Idx:0; ID:10;   I_ASYNC : Alignment Synchronisation.
          Idx:12; ID:10;  I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
          Idx:17; ID:10;  I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000000000000000;

  . ... CoreSight ETM Trace data: size 80 bytes
          Idx:80; ID:10;  I_ASYNC : Alignment Synchronisation.
          Idx:92; ID:10;  I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
          Idx:97; ID:10;  I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFDE2AD3FD76D4;

Decoding errors that appeared in problematic files are now not present,
for example:

        Idx:808; ID:1c; I_BAD_SEQUENCE : Invalid Sequence in packet.[I_ASYNC]
        ...
        PKTP_ETMV4I_0016 : 0x0014 (OCSD_ERR_INVALID_PCKT_HDR) [Invalid packet header]; TrcIdx=822

Signed-off-by: James Clark <james.clark@arm.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: Al Grant <al.grant@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Branislav Rankov <branislav.rankov@arm.com>
Cc: Denis Nikitin <denik@chromium.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lore.kernel.org/lkml/20210624164303.28632-3-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-07-27 12:50:56 -03:00
..
arch tools headers UAPI: Sync files changed by the memfd_secret new syscall 2021-07-14 10:05:35 -03:00
bench perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
Documentation perf intel-pt: Add a config for max loops without consuming a packet 2021-07-07 11:40:56 -03:00
examples/bpf perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
include/bpf
jvmti perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
pmu-events perf vendor events power10: Adds 24x7 nest metric events for power10 platform 2021-07-07 11:35:49 -03:00
python tweewide: Fix most Shebang lines 2020-12-08 23:30:04 +09:00
scripts perf scripting python: intel-pt-events.py: Add --insn-trace and --src-trace 2021-06-01 10:05:20 -03:00
tests perf test bpf: Free obj_buf 2021-07-16 13:50:30 -03:00
trace perf beauty: Update copy of linux/socket.h with the kernel sources 2021-06-19 10:09:08 -03:00
ui libperf: Move 'idx' from tools/perf to perf_evsel::idx 2021-07-09 14:04:28 -03:00
util perf cs-etm: Split --dump-raw-trace by AUX records 2021-07-27 12:50:56 -03:00
.gitignore perf: Update .gitignore file 2021-04-20 08:40:20 -03:00
Build perf daemon: Add daemon command 2021-02-09 15:42:57 -03:00
builtin-annotate.c perf annotate: Add itrace options support 2021-06-16 15:07:42 -03:00
builtin-bench.c
builtin-buildid-cache.c perf buildid-cache: Add --debuginfod option to specify a server to fetch debug files 2020-12-28 12:20:39 -03:00
builtin-buildid-list.c perf buildid-list: Initialize zstd_data 2021-05-17 20:39:17 -03:00
builtin-c2c.c perf c2c: Support record for hybrid platform 2021-06-01 11:06:35 -03:00
builtin-config.c
builtin-daemon.c Merge remote-tracking branch 'torvalds/master' into perf/core 2021-03-29 10:39:10 -03:00
builtin-data.c perf data: Add JSON export 2021-04-29 10:30:58 -03:00
builtin-diff.c libperf: Move 'idx' from tools/perf to perf_evsel::idx 2021-07-09 14:04:28 -03:00
builtin-evlist.c perf evlist: Support pipe mode display 2020-12-17 14:36:17 -03:00
builtin-ftrace.c perf ftrace: Fix access to pid in array when setting a pid filter 2021-04-23 15:58:10 -03:00
builtin-help.c
builtin-inject.c perf inject: Close inject.output on exit 2021-07-15 17:27:52 -03:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-list.c
builtin-lock.c perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
builtin-mem.c perf mem: Fix wrong verbose output for recording events 2021-06-01 11:05:30 -03:00
builtin-probe.c perf probe: Do not show @plt function by default 2021-07-07 10:28:10 -03:00
builtin-record.c perf record: Add a dummy event on hybrid systems to collect metadata records 2021-07-09 14:04:32 -03:00
builtin-report.c perf report: Free generated help strings for sort option 2021-07-15 17:27:52 -03:00
builtin-sched.c perf sched: Fix record failure when CONFIG_SCHEDSTATS is not set 2021-07-18 09:36:37 -03:00
builtin-script.c perf script: Fix memory 'threads' and 'cpus' leaks on exit 2021-07-15 17:28:14 -03:00
builtin-stat.c perf stat: Merge uncore events by default for hybrid platform 2021-07-14 10:05:35 -03:00
builtin-timechart.c
builtin-top.c libperf: Move 'leader' from tools/perf to perf_evsel::leader 2021-07-09 14:04:31 -03:00
builtin-trace.c perf trace: Free strings in trace__parse_events_option() 2021-07-15 17:35:57 -03:00
builtin-version.c
builtin.h perf daemon: Add daemon command 2021-02-09 15:42:57 -03:00
check-headers.sh perf tools: Copy uapi/asm/perf_regs.h from the kernel for MIPS 2021-06-01 10:07:46 -03:00
command-list.txt perf stat: Enable iostat mode for x86 platforms 2021-04-20 08:40:20 -03:00
CREDITS
design.txt
Makefile perf tools: Add a build-test variant to use in builds from a tarball 2021-04-20 08:43:58 -03:00
Makefile.config perf build: Install perf_dlfilter.h 2021-07-01 16:14:38 -03:00
Makefile.perf perf trace: Fix the perf trace link location 2021-07-07 10:28:10 -03:00
MANIFEST scripts/bpf: Abstract eBPF API target parameter 2021-03-04 18:39:45 -08:00
perf-archive.sh perf archive: Fix filtering of empty build-ids 2021-03-06 16:54:31 -03:00
perf-completion.sh
perf-iostat.sh perf stat: Enable iostat mode for x86 platforms 2021-04-20 08:40:20 -03:00
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf debug: Move debug initialization earlier 2021-05-27 13:24:22 -03:00
perf.h