All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: James Clark <james.clark@arm.com>, coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org, anshuman.khandual@arm.com,
	Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>
Subject: Re: [PATCH] coresight: perf: Output trace id only once
Date: Tue, 24 Jan 2023 10:43:31 +0000	[thread overview]
Message-ID: <3fb9ff26-70a9-a686-8d42-d69ca3369d18@arm.com> (raw)
In-Reply-To: <b35ef425-c92b-2526-5115-6edcbd874f33@arm.com>

On 20/01/2023 15:43, James Clark wrote:
> 
> 
> On 20/01/2023 10:34, Suzuki K Poulose wrote:
>> With the dynamic traceid allocation scheme in, we output the
>> AUX_OUTPUT_HWID packet every time event->start() is called.
>> This could cause too many such records in the perf.data,
>> while only one per CPU throughout the life time of
>> the event is required. Make sure we only output it once.
>>
>> Before this patch:
>>    $ perf report -D | grep OUTPUT_HW_ID
>>    ...
>>    AUX_OUTPUT_HW_ID events:         55  (18.3%)
>>
>> After this patch:
>>
>>   $ perf report -D | grep OUTPUT_HW_ID
>>   ...
>>   AUX_OUTPUT_HW_ID events:          5  ( 1.9%)
>>
>> Cc: Mike Leach <mike.leach@linaro.org>
>> Cc: James Clark <james.clark@arm.com>
>> Cc: Leo Yan <leo.yan@linaro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>>   drivers/hwtracing/coresight/coresight-etm-perf.c | 16 ++++++++++++----
>>   drivers/hwtracing/coresight/coresight-etm-perf.h |  2 ++
>>   2 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
>> index 12fff661456e..a48c97da8165 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
>> @@ -495,10 +495,18 @@ 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);
>> +	/*
>> +	 * output cpu / trace ID in perf record, once for the lifetime
>> +	 * of the event.
>> +	 */
>> +	if (!cpumask_test_cpu(cpu, &event_data->aux_hwid_done)) {
>> +		cpumask_set_cpu(cpu, &event_data->aux_hwid_done);
> 
> I had a look for somewhere that's only called once after the aux buffer
> is available to avoid the new tracking bit, but didn't find anywhere
> obvious. We can always move it later anyway.
> 
> Reviewed-by: James Clark <james.clark@arm.com>
> 

Thanks, pushed to next

https://git.kernel.org/coresight/c/a646ca099b18

Suzuki


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2023-01-24 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 10:34 [PATCH] coresight: perf: Output trace id only once Suzuki K Poulose
2023-01-20 15:43 ` James Clark
2023-01-24 10:43   ` Suzuki K Poulose [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fb9ff26-70a9-a686-8d42-d69ca3369d18@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@arm.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mike.leach@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.