linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 0/5] perf cs-etm: Track exception level
       [not found] <20230612111403.100613-1-james.clark@arm.com>
@ 2023-06-12 18:32 ` Arnaldo Carvalho de Melo
  2023-06-13  8:56   ` James Clark
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-06-12 18:32 UTC (permalink / raw)
  To: James Clark
  Cc: coresight, Suzuki K Poulose, Mike Leach, Leo Yan, Peter Zijlstra,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Ian Rogers, Adrian Hunter, John Garry, Will Deacon,
	linux-arm-kernel, linux-perf-users, linux-kernel

Em Mon, Jun 12, 2023 at 12:13:57PM +0100, James Clark escreveu:
> Changes since v2:
> 
>   * Rename prev_thread -> prev_packet_thread and prev_el ->
>     prev_packet_el
>   * Add a comment about tracking the previous packet's thread
> 
> Changes since v1:
> 
>   * Always assume host kernel when the trace was captured at EL1 (nVHE)
>   * Fix EL validation to work with ETMv3
>   * Add a commit to make PID format accessible from struct
>     cs_etm_auxtrace

Please take a look in my tmp.perf-tools-next branch, there were some
conflicts I had to fix as those files were touched by refactorings for
addr_location and thread reference counting.

⬢[acme@toolbox perf-tools-next]$ git log --oneline -10
aa53fb2c482e70c2 (HEAD -> perf-tools-next) perf cs-etm: Add exception level consistency check
2918e9895224541f perf cs-etm: Track exception level
f492a33909829a75 perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
e29ec19b0751c6b2 perf cs-etm: Use previous thread for branch sample source IP
e9e03e9c3ca7088c perf cs-etm: Only track threads instead of PID and TIDs
6fd34445b8c94aa7 perf map: Fix double 'struct map' reference free found with -DREFCNT_CHECKING=1
e9c0a7f63e45e76f perf srcline: Optimize comparision against SRCLINE_UNKNOWN
fd87a79c7ed62804 perf hist: Fix srcline memory leak
933f9651d47cdda2 perf srcline: Change free_srcline to zfree_srcline
d22cfb063bcc674e perf callchain: Use pthread keys for tls callchain_cursor
⬢[acme@toolbox perf-tools-next]$


- Arnaldo
 
> ======
> 
> Some fixes to support an issue reported by Denis Nikitin where decoding
> trace that contains different EL1 and EL2 kernels can crash or go into
> an infinite loop because the wrong kernel maps are used for the decode.
> 
> This still doesn't support distinguishing guest and host userspace,
> we'd still have to fix the timestamps and do a bit more work to
> correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a
> possible outcome of cs_etm__cpu_mode(). As far as I know this could
> never have been returned anyway because machine__is_host(machine) was
> always true due to session.machines.host being hard coded. And I'm not
> sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL
> and PERF_RECORD_MISC_HYPERVISOR in this scenario.
> 
> The first commit is a tidy up, second fixes a bug that I found when
> comparing the exception level and thread of branch records, the third
> is the main fix, and the last commit is some extra error checking. 
> 
> Applies to acme/perf-tools-next (42713dafc)
> 
> James Clark (5):
>   perf cs-etm: Only track threads instead of PID and TIDs
>   perf cs-etm: Use previous thread for branch sample source IP
>   perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
>   perf cs-etm: Track exception level
>   perf cs-etm: Add exception level consistency check
> 
>  .../perf/util/cs-etm-decoder/cs-etm-decoder.c |  33 +-
>  .../perf/util/cs-etm-decoder/cs-etm-decoder.h |   4 +-
>  tools/perf/util/cs-etm.c                      | 282 ++++++++++--------
>  tools/perf/util/cs-etm.h                      |  13 +-
>  4 files changed, 184 insertions(+), 148 deletions(-)
> 
> -- 
> 2.34.1
> 

-- 

- Arnaldo

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 0/5] perf cs-etm: Track exception level
  2023-06-12 18:32 ` [PATCH v3 0/5] perf cs-etm: Track exception level Arnaldo Carvalho de Melo
@ 2023-06-13  8:56   ` James Clark
  2023-06-13 19:42     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: James Clark @ 2023-06-13  8:56 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: coresight, Suzuki K Poulose, Mike Leach, Leo Yan, Peter Zijlstra,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Ian Rogers, Adrian Hunter, John Garry, Will Deacon,
	linux-arm-kernel, linux-perf-users, linux-kernel



On 12/06/2023 19:32, Arnaldo Carvalho de Melo wrote:
> Em Mon, Jun 12, 2023 at 12:13:57PM +0100, James Clark escreveu:
>> Changes since v2:
>>
>>   * Rename prev_thread -> prev_packet_thread and prev_el ->
>>     prev_packet_el
>>   * Add a comment about tracking the previous packet's thread
>>
>> Changes since v1:
>>
>>   * Always assume host kernel when the trace was captured at EL1 (nVHE)
>>   * Fix EL validation to work with ETMv3
>>   * Add a commit to make PID format accessible from struct
>>     cs_etm_auxtrace
> 
> Please take a look in my tmp.perf-tools-next branch, there were some
> conflicts I had to fix as those files were touched by refactorings for
> addr_location and thread reference counting.
> 

Yeah I got the same result and the tests are still passing. Thanks for
fixing those.

> ⬢[acme@toolbox perf-tools-next]$ git log --oneline -10
> aa53fb2c482e70c2 (HEAD -> perf-tools-next) perf cs-etm: Add exception level consistency check
> 2918e9895224541f perf cs-etm: Track exception level
> f492a33909829a75 perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
> e29ec19b0751c6b2 perf cs-etm: Use previous thread for branch sample source IP
> e9e03e9c3ca7088c perf cs-etm: Only track threads instead of PID and TIDs
> 6fd34445b8c94aa7 perf map: Fix double 'struct map' reference free found with -DREFCNT_CHECKING=1
> e9c0a7f63e45e76f perf srcline: Optimize comparision against SRCLINE_UNKNOWN
> fd87a79c7ed62804 perf hist: Fix srcline memory leak
> 933f9651d47cdda2 perf srcline: Change free_srcline to zfree_srcline
> d22cfb063bcc674e perf callchain: Use pthread keys for tls callchain_cursor
> ⬢[acme@toolbox perf-tools-next]$
> 
> 
> - Arnaldo
>  
>> ======
>>
>> Some fixes to support an issue reported by Denis Nikitin where decoding
>> trace that contains different EL1 and EL2 kernels can crash or go into
>> an infinite loop because the wrong kernel maps are used for the decode.
>>
>> This still doesn't support distinguishing guest and host userspace,
>> we'd still have to fix the timestamps and do a bit more work to
>> correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a
>> possible outcome of cs_etm__cpu_mode(). As far as I know this could
>> never have been returned anyway because machine__is_host(machine) was
>> always true due to session.machines.host being hard coded. And I'm not
>> sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL
>> and PERF_RECORD_MISC_HYPERVISOR in this scenario.
>>
>> The first commit is a tidy up, second fixes a bug that I found when
>> comparing the exception level and thread of branch records, the third
>> is the main fix, and the last commit is some extra error checking. 
>>
>> Applies to acme/perf-tools-next (42713dafc)
>>
>> James Clark (5):
>>   perf cs-etm: Only track threads instead of PID and TIDs
>>   perf cs-etm: Use previous thread for branch sample source IP
>>   perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
>>   perf cs-etm: Track exception level
>>   perf cs-etm: Add exception level consistency check
>>
>>  .../perf/util/cs-etm-decoder/cs-etm-decoder.c |  33 +-
>>  .../perf/util/cs-etm-decoder/cs-etm-decoder.h |   4 +-
>>  tools/perf/util/cs-etm.c                      | 282 ++++++++++--------
>>  tools/perf/util/cs-etm.h                      |  13 +-
>>  4 files changed, 184 insertions(+), 148 deletions(-)
>>
>> -- 
>> 2.34.1
>>
> 

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 0/5] perf cs-etm: Track exception level
  2023-06-13  8:56   ` James Clark
@ 2023-06-13 19:42     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-06-13 19:42 UTC (permalink / raw)
  To: James Clark
  Cc: coresight, Suzuki K Poulose, Mike Leach, Leo Yan, Peter Zijlstra,
	Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, Ian Rogers, Adrian Hunter, John Garry, Will Deacon,
	linux-arm-kernel, linux-perf-users, linux-kernel

Em Tue, Jun 13, 2023 at 09:56:29AM +0100, James Clark escreveu:
> 
> 
> On 12/06/2023 19:32, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Jun 12, 2023 at 12:13:57PM +0100, James Clark escreveu:
> >> Changes since v2:
> >>
> >>   * Rename prev_thread -> prev_packet_thread and prev_el ->
> >>     prev_packet_el
> >>   * Add a comment about tracking the previous packet's thread
> >>
> >> Changes since v1:
> >>
> >>   * Always assume host kernel when the trace was captured at EL1 (nVHE)
> >>   * Fix EL validation to work with ETMv3
> >>   * Add a commit to make PID format accessible from struct
> >>     cs_etm_auxtrace
> > 
> > Please take a look in my tmp.perf-tools-next branch, there were some
> > conflicts I had to fix as those files were touched by refactorings for
> > addr_location and thread reference counting.
> > 
> 
> Yeah I got the same result and the tests are still passing. Thanks for
> fixing those.

Thanks for double checking that!

- Arnaldo
 
> > ⬢[acme@toolbox perf-tools-next]$ git log --oneline -10
> > aa53fb2c482e70c2 (HEAD -> perf-tools-next) perf cs-etm: Add exception level consistency check
> > 2918e9895224541f perf cs-etm: Track exception level
> > f492a33909829a75 perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
> > e29ec19b0751c6b2 perf cs-etm: Use previous thread for branch sample source IP
> > e9e03e9c3ca7088c perf cs-etm: Only track threads instead of PID and TIDs
> > 6fd34445b8c94aa7 perf map: Fix double 'struct map' reference free found with -DREFCNT_CHECKING=1
> > e9c0a7f63e45e76f perf srcline: Optimize comparision against SRCLINE_UNKNOWN
> > fd87a79c7ed62804 perf hist: Fix srcline memory leak
> > 933f9651d47cdda2 perf srcline: Change free_srcline to zfree_srcline
> > d22cfb063bcc674e perf callchain: Use pthread keys for tls callchain_cursor
> > ⬢[acme@toolbox perf-tools-next]$
> > 
> > 
> > - Arnaldo
> >  
> >> ======
> >>
> >> Some fixes to support an issue reported by Denis Nikitin where decoding
> >> trace that contains different EL1 and EL2 kernels can crash or go into
> >> an infinite loop because the wrong kernel maps are used for the decode.
> >>
> >> This still doesn't support distinguishing guest and host userspace,
> >> we'd still have to fix the timestamps and do a bit more work to
> >> correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a
> >> possible outcome of cs_etm__cpu_mode(). As far as I know this could
> >> never have been returned anyway because machine__is_host(machine) was
> >> always true due to session.machines.host being hard coded. And I'm not
> >> sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL
> >> and PERF_RECORD_MISC_HYPERVISOR in this scenario.
> >>
> >> The first commit is a tidy up, second fixes a bug that I found when
> >> comparing the exception level and thread of branch records, the third
> >> is the main fix, and the last commit is some extra error checking. 
> >>
> >> Applies to acme/perf-tools-next (42713dafc)
> >>
> >> James Clark (5):
> >>   perf cs-etm: Only track threads instead of PID and TIDs
> >>   perf cs-etm: Use previous thread for branch sample source IP
> >>   perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace
> >>   perf cs-etm: Track exception level
> >>   perf cs-etm: Add exception level consistency check
> >>
> >>  .../perf/util/cs-etm-decoder/cs-etm-decoder.c |  33 +-
> >>  .../perf/util/cs-etm-decoder/cs-etm-decoder.h |   4 +-
> >>  tools/perf/util/cs-etm.c                      | 282 ++++++++++--------
> >>  tools/perf/util/cs-etm.h                      |  13 +-
> >>  4 files changed, 184 insertions(+), 148 deletions(-)
> >>
> >> -- 
> >> 2.34.1
> >>
> > 

-- 

- Arnaldo

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-13 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230612111403.100613-1-james.clark@arm.com>
2023-06-12 18:32 ` [PATCH v3 0/5] perf cs-etm: Track exception level Arnaldo Carvalho de Melo
2023-06-13  8:56   ` James Clark
2023-06-13 19:42     ` Arnaldo Carvalho de Melo

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).