perf cs-etm: Linking PE contextID with perf thread mechanic
Link contextID packets received from the decoder with the perf tool thread mechanic so that we know the specifics of the process currently executing. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Tested-by: Leo Yan <leo.yan@linaro.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/20190524173508.29044-16-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
c152d4d49a
commit
0a6be300eb
@@ -402,6 +402,24 @@ cs_etm_decoder__buffer_exception_ret(struct cs_etm_packet_queue *queue,
|
||||
CS_ETM_EXCEPTION_RET);
|
||||
}
|
||||
|
||||
static ocsd_datapath_resp_t
|
||||
cs_etm_decoder__set_tid(struct cs_etm_queue *etmq,
|
||||
const ocsd_generic_trace_elem *elem,
|
||||
const uint8_t trace_chan_id)
|
||||
{
|
||||
pid_t tid;
|
||||
|
||||
/* Ignore PE_CONTEXT packets that don't have a valid contextID */
|
||||
if (!elem->context.ctxt_id_valid)
|
||||
return OCSD_RESP_CONT;
|
||||
|
||||
tid = elem->context.context_id;
|
||||
if (cs_etm__etmq_set_tid(etmq, tid, trace_chan_id))
|
||||
return OCSD_RESP_FATAL_SYS_ERR;
|
||||
|
||||
return OCSD_RESP_CONT;
|
||||
}
|
||||
|
||||
static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
|
||||
const void *context,
|
||||
const ocsd_trc_index_t indx __maybe_unused,
|
||||
@@ -440,6 +458,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
|
||||
trace_chan_id);
|
||||
break;
|
||||
case OCSD_GEN_TRC_ELEM_PE_CONTEXT:
|
||||
resp = cs_etm_decoder__set_tid(etmq, elem, trace_chan_id);
|
||||
break;
|
||||
case OCSD_GEN_TRC_ELEM_ADDR_NACC:
|
||||
case OCSD_GEN_TRC_ELEM_TIMESTAMP:
|
||||
case OCSD_GEN_TRC_ELEM_CYCLE_COUNT:
|
||||
|
Reference in New Issue
Block a user