For example calling the following
# perf record -e cs_etm/20070000.etr/ -C 2,3 application1
and
# perf record -e cs_etm/20070000.etr/ -C 2 application1 # perf record -e cs_etm/20070000.etr/ -C 3 application1
look exactly the same to the kernel. That is, both example create two new events and there is currently now way to correlate them. In the first example we need to allow both events to use the same sink while preventing it in the latter.
I'm sorry, I thought in the first example, you were using the file descriptor parameter on perf_event_open to correlate the events - i.e. when creating the event for CPU 3 you pass it the event for CPU 2 and this indicates it will be using the same trace buffer.
And when the commands are separate, they really are two separate events, and if the second one is opened while the first is still active and using the same ETR, the second should fail, probably with EBUSY.
Al
Thanks for the comments, Mathieu
Al
So this would work:
# perf record -e cs_etm/20070000.etr/ -C 3 application1
I am open to discussion on the topic should someone think of something.
As with the cleanup set this code has been uploaded here [1].
Thanks, Mathieu
[1].https://git.linaro.org/people/mathieu.poirier/coresight.git perf-opencsd- master-cpu-wide-support
Mathieu Poirier (12): perf tools: Add defines for CONTEXTID configuration perf tools: Configure contextID tracing in CPU-wide mode perf tools: Configure timestsamp generation in CPU-wide mode perf tools: Configure SWITCH_EVENTS in CPU-wide mode perf tools: Add handling of itrace start events perf tools: Add handling of switch-CPU-wide events perf tools: Linking PE contextID with perf thread mechanic perf tools: Allocate decoder tree as needed perf tools: Make cs_etm__dump_event() work with CPU-wide scenarios perf tools: Add notion of time to the decoding code perf tools: Make function cs_etm_decoder__clear_buffer() public perf tools: Add support for CPU-wide trace scenarios
include/linux/coresight-pmu.h | 2 + tools/include/linux/coresight-pmu.h | 2 + tools/perf/arch/arm/util/cs-etm.c | 174 ++++++++++-- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 140 +++++++++- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 +- tools/perf/util/cs-etm.c | 334 ++++++++++++++++++++++-- tools/perf/util/cs-etm.h | 17 ++ 7 files changed, 623 insertions(+), 50 deletions(-)
-- 2.7.4
CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight