forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coresight: events: PERF_RECORD_AUX_OUTPUT_HW_ID used for Trace ID
Use the perf_report_aux_output_id() call to output the CoreSight trace ID and associated CPU as a PERF_RECORD_AUX_OUTPUT_HW_ID record in the perf.data file. Signed-off-by: Mike Leach <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
- Loading branch information
1 parent
7d30d48
commit aa19bb4
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* Author: Mathieu Poirier <[email protected]> | ||
*/ | ||
|
||
#include <linux/bitfield.h> | ||
#include <linux/coresight.h> | ||
#include <linux/coresight-pmu.h> | ||
#include <linux/cpumask.h> | ||
|
@@ -448,6 +449,7 @@ static void etm_event_start(struct perf_event *event, int flags) | |
struct perf_output_handle *handle = &ctxt->handle; | ||
struct coresight_device *sink, *csdev = per_cpu(csdev_src, cpu); | ||
struct list_head *path; | ||
u64 hw_id; | ||
|
||
if (!csdev) | ||
goto fail; | ||
|
@@ -493,6 +495,11 @@ static void etm_event_start(struct perf_event *event, int flags) | |
if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF)) | ||
goto fail_disable_path; | ||
|
||
/* output cpu / trace ID in perf record */ | ||
hw_id = FIELD_PREP(CS_AUX_HW_ID_VERSION_MASK, CS_AUX_HW_ID_CURR_VERSION); | ||
hw_id |= FIELD_PREP(CS_AUX_HW_ID_TRACE_ID_MASK, coresight_trace_id_read_cpu_id(cpu)); | ||
perf_report_aux_output_id(event, hw_id); | ||
|
||
out: | ||
/* Tell the perf core the event is alive */ | ||
event->hw.state = 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters