Re: [PATCH v3 0/8] perf cs-etm: Correct packets handling
From: Arnaldo Carvalho de Melo
Date: Thu Dec 13 2018 - 08:11:20 EST
Em Wed, Dec 12, 2018 at 11:45:44AM -0700, Mathieu Poirier escreveu:
> On Tue, 11 Dec 2018 at 00:40, Leo Yan <leo.yan@xxxxxxxxxx> wrote:
> >
> > perf cs-etm module converts decoder elements to packets and then we have
> > more context crossing packets to generate synthenize samples, finally
> > perf tool can faciliate samples for statistics and report the results.
> >
> > This patch series is to address several issues found related with
> > packets handling and samples generation when worked firstly on branch
> > sample flags support for Arm CoreSight trace data, so this patch series
> > is dependency for sample flags setting, will send another dedicated
> > patch series for sample flags later.
> >
> > In this patch series, the first two patches are mainly to fix issues in
> > cs_etm__flush(): patch 0001 corrects packets swapping in cs_etm__flush()
> > and this can fix the wrong branch sample caused by the missed packets
> > swapping; patch 0002 is to fix the wrong samples generation with stale
> > packets at the end of trace block.
> >
> > Patch 0003 and 0004 are for minor fixing; patch 0003 removes unused field
> > 'cs_etm_decoder::trace_on', this can simplize the switch-case code for all
> > discontinuity packet generation by using one code block; patch 0004 is to
> > refactor enumeration cs_etm_sample_type.
> >
> > Patch 0005 is to rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY, we use
> > a more general packet type to present trace discontinuity, so it can be
> > used by TRACE_ON event, and also can be used by NO_SYNC and EO_TRACE
> > elements.
> >
> > Patch 0006 is used to support NO_SYNC packet, otherwise the trace
> > decoding cannot reflect the tracing discontinuity caused by NO_SYNC
> > packet.
> >
> > Patch 0007 is used to support EO_TRACE packet, which also introduces
> > the tracing discontinuity at the end of trace and we should save last
> > trace data for it.
> >
> > Patch 0008 is used to generate branch sample for exception packets.
> >
> > Credit to Mike Leach and Robert Walker who made me clear for underlying
> > mechanism for NO_SYNC/EO_TRACE elements, Mike also shared the detailed
> > explanation for why we can treat NO_SYNC and TRACE_ON elements as the
> > same, so except following Mike & Rob suggestion for trace discontinuity
> > consolidation, most commit log of patches 0006/0007 also come from
> > Mike's explanation.
> >
> > This patch series is applied directly on the acme's perf/core branch [1]
> > with latest commit aaab25f03e9e ("perf trace: Allow selecting use the
> > use of the ordered_events code").
> >
> > With applying the dependency patch, this patch series has been tested
> > for branch samples dumping with below command on Juno board:
> >
> > # perf script -F,-time,+ip,+sym,+dso,+addr,+symoff -k vmlinux
>
> Good day Arnaldo,
>
> I have reviewed all the changes in this set - please consider adding
> to your next branch. Let me know if you want a pull request.
Thanks, applied manually, pushing now to my tmp.perf/core branch, please
take a look at the commit log messages to see if I didn't messed up
anything. :-)
- Arnaldo