linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Coresight ML <coresight@lists.linaro.org>,
	Leo Yan <leo.yan@linaro.org>, Al Grant <al.grant@arm.com>,
	branislav.rankov@arm.com, Denis Nikitin <denik@chromium.org>,
	"Suzuki K. Poulose" <suzuki.poulose@arm.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-perf-users@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v3] perf cs-etm: Split Coresight decode by aux records
Date: Tue, 1 Jun 2021 16:09:12 +0300	[thread overview]
Message-ID: <dcf7cbe3-2d97-bf99-7025-3f62e2f09be1@arm.com> (raw)
In-Reply-To: <CANLsYkynQbGRhOmyramX+nSHvVnH_nSJb=t03Dp-2WeXP3ZYAw@mail.gmail.com>



On 27/05/2021 18:37, Mathieu Poirier wrote:
> On Thu, 27 May 2021 at 07:46, James Clark <james.clark@arm.com> wrote:
>>
>>
>>
>> On 27/05/2021 13:42, James Clark wrote:
>>> Populate the auxtrace queues using AUX records rather than whole
>>> auxtrace buffers.
>>>
>> ...
>>> Snapshot mode still needs to be tested.
>>>
>>
>> Snapshot mode is also working, but needs the following patch applied to reverse aux_offset
>> from the end of the buffer to the beginning:
> 
> It might be better to send another revision with this patch included
> in to make sure everyone is looking at (and testing) the same thing.

I've sent v4 with it applied. There was actually a mistake which broke the normal mode,
so it was a good idea to apply it.

> 
>>
>> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
>> index 5d6c03488187..9db556e14dfa 100644
>> --- a/tools/perf/util/cs-etm.c
>> +++ b/tools/perf/util/cs-etm.c
>> @@ -2700,6 +2700,7 @@ static int cs_etm__queue_aux_fragment(struct perf_session *session,
>>         struct perf_record_auxtrace *auxtrace_event;
>>         union perf_event auxtrace_fragment;
>>         bool matchesCpuPid;
>> +       __u64 aux_offset;
>>         struct cs_etm_auxtrace *etm = container_of(session->auxtrace,
>>                                                    struct cs_etm_auxtrace,
>>                                                    auxtrace);
>> @@ -2730,19 +2731,26 @@ static int cs_etm__queue_aux_fragment(struct perf_session *session,
>>         else
>>                 matchesCpuPid = auxtrace_event->cpu == sample->cpu;
>>
>> +       /*
>> +        * In snapshot/overwrite mode, the head points to the end of the buffer so aux_offset needs
>> +        * to have the size subtracted so it points to the beginning as in normal mode.
>> +        */
>> +       if (aux_event->flags && PERF_AUX_FLAG_OVERWRITE)
>> +               aux_offset = aux_event->aux_offset - aux_event->aux_size;
>> +       else
>> +               aux_offset = aux_event->aux_offset;
>> +
>>         if (matchesCpuPid &&
>> -           aux_event->aux_offset >= auxtrace_event->offset &&
>> -           aux_event->aux_offset + aux_event->aux_size <=
>> -                       auxtrace_event->offset + auxtrace_event->size) {
>> +           aux_offset >= auxtrace_event->offset &&
>> +           aux_offset + aux_event->aux_size <= auxtrace_event->offset + auxtrace_event->size) {
>>                 /*
>>                  * If this AUX event was inside this buffer somewhere, create a new auxtrace event
>>                  * based on the sizes of the aux event, and queue that fragment.
>>                  */
>>                 auxtrace_fragment.auxtrace = *auxtrace_event;
>>                 auxtrace_fragment.auxtrace.size = aux_event->aux_size;
>> -               auxtrace_fragment.auxtrace.offset = aux_event->aux_offset;
>> -               file_offset += aux_event->aux_offset - auxtrace_event->offset +
>> -                               auxtrace_event->header.size;
>> +               auxtrace_fragment.auxtrace.offset = aux_offset;
>> +               file_offset += aux_offset - auxtrace_event->offset + auxtrace_event->header.size;
>>                 return auxtrace_queues__add_event(&etm->queues,
>>                                                session,
>>                                                &auxtrace_fragment,
>>
>>

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

      reply	other threads:[~2021-06-01 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 10:42 [RFC PATCH v3] perf cs-etm: Split Coresight decode by aux records James Clark
2021-05-27 13:46 ` James Clark
2021-05-27 15:37   ` Mathieu Poirier
2021-06-01 13:09     ` James Clark [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=dcf7cbe3-2d97-bf99-7025-3f62e2f09be1@arm.com \
    --to=james.clark@arm.com \
    --cc=acme@kernel.org \
    --cc=al.grant@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=branislav.rankov@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=denik@chromium.org \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=namhyung@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).