linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Coresight ML <coresight@lists.linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Leo Yan <leo.yan@linaro.org>, Namhyung Kim <namhyung@kernel.org>,
	Robert Walker <robert.walker@arm.com>,
	Jiri Olsa <jolsa@redhat.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Mike Leach <mike.leach@linaro.org>
Subject: Re: [PATCH v7 0/8] perf cs-etm: Add support for sample flags
Date: Mon, 4 Feb 2019 16:27:58 -0300	[thread overview]
Message-ID: <20190204192758.GJ5593@kernel.org> (raw)
In-Reply-To: <CANLsYky9fUcCkek3CWh8vXpRN07YbnnPirWxtRLum13a1FEQ2g@mail.gmail.com>

Em Mon, Feb 04, 2019 at 11:41:28AM -0700, Mathieu Poirier escreveu:
> On Tue, 29 Jan 2019 at 05:29, Leo Yan <leo.yan@linaro.org> wrote:
> >
> > This patch seris adds support for sample flags so can facilitate perf
> > to print sample flags for branch instruction.
> >
> > Patch 0001 is used to save last branch information in packet structure,
> > this includes instruction type, subtype and condition flag to help
> > making decision for which branch instruction it is.  It passes related
> > information from decoder layer to cs-etm.c, so we use cs-etm.c as a
> > central place to set sample flags.
> >
> > Patch 0002 is used to set sample flags for instruction range packet.
> >
> > Patch 0003 is used to set sample flags for trace discontinuity packet.
> >
> > Patches 0004/0005/0006 are preparation for exception packet handling:
> > Patch 0004 addes exception number in packet; pacth 0005/0006 is to use
> > traceID/metadata tuple to access metadata pointer based on traceID, this
> > can help decide if the CPU is connected with ETMv3 or ETMv4, ETMv3 and
> > ETMv4 have totally different definition for exception numbers.
> >
> > Patch 0007 sets sample flags for exception packet; patch 0008 support
> > sample flags for exception return packet.
> >
> > This patch set is applied on the acme's perf core branch with the latest
> > commit bdec77cfe58d ("Merge remote-tracking branch 'tip/perf/urgent'
> > into perf/core").
> >
> > This patch set has been verified for x86 and arm64 perf building and
> > also is verified with below command:
> >
> > Before:
> >
> >   # perf script -F,-time,+flags -k vmlinux
> >
> >   [...]
> >
> >   main  6650 [001]          1              branches:                                f7b08490 lib_loop_test+0xc (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                f7b084b0 lib_loop_test+0x2c (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:                                  6b65a8 main+0x1c (/root/coresight_test/main)
> >   main  6650 [001]          1              branches:                                  6b6448 printf@plt+0x8 (/root/coresight_test/main)
> >   main  6650 [001]          1              branches:                                  6b642c _init+0x18 (/root/coresight_test/main)
> >   main  6650 [001]          1              branches:                                f7b2d23c [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b2906e [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b255ee [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:                                f7b25634 [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >
> >   [...]
> >
> >
> > After:
> >
> >   # perf script -F,-time,+flags -k vmlinux
> >
> >   [...]
> >
> >   main  6650 [001]          1              branches:   jmp                          f7b08490 lib_loop_test+0xc (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b084a2 lib_loop_test+0x1e (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   return                       f7b084b0 lib_loop_test+0x2c (/root/coresight_test/libcstest.so)
> >   main  6650 [001]          1              branches:   call                           6b65a8 main+0x1c (/root/coresight_test/main)
> >   main  6650 [001]          1              branches:   return                         6b6448 printf@plt+0x8 (/root/coresight_test/main)
> >   main  6650 [001]          1              branches:   return                         6b642c _init+0x18 (/root/coresight_test/main)
> >   main  6650 [001]          1              branches:   call                         f7b2d23c [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   call                         f7b2906e [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   jcc                          f7b2559a [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   jmp                          f7b255ee [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >   main  6650 [001]          1              branches:   call                         f7b25634 [unknown] (/usr/lib/arm-linux-gnueabihf/ld-2.27.so)
> >
> >   [...]
> 
> Good day Arnaldo,
> 
> I have reviewed, compiled and tested this patchset - please consider
> for inclusion.


Thanks, I'll check it after I push perf/urgent, that is almost ready.

> Regards,
> Mathieu
> 
> >
> >
> > Changes from v6:
> > * Addressed Mathieu's suggestion for patch 0005, refined its commit log
> >   and comment and fixed cs_etm__get_cpu() definitions in header file;
> >   also tested with perf for Arm and x86 buildings.
> > * Added Mathieu's review tags.
> >
> > Changes from v5:
> > * Addressed Rob's suggestion to add specification info for exception
> >   number encoding;
> > * Added Rob's review tag in patch 0007.
> >
> > Changes from v4:
> > * Fixed typos in comments, and removed redundant info from commit log;
> > * Addressed Mathieu's suggestion to add helper functions for metadata
> >   fields (CS_ETM_CPU and CS_ETM_MAGIC) accessing;
> > * Addressed Mathieu's suggestion to include headers with alphabetical
> >   order.
> >
> > Changes from v3:
> > * Fixed typos in commit logs;
> > * Rearranged fields in cs_etm_packet by grouping with same variable
> >   types;
> > * Fixed ETMv4 exception number which pointed by Mike;
> > * Fixed ETMv4 SVC / SMC / HVC in the same CALL, by checking svc
> >   instruction to distinguish them;
> > * Refine ETMv4 return exception packet handling.
> >
> > Changes from v2:
> > * Addressed Mathieu's suggestion to split one big patch to 3 small
> >   patches for setting sample flags, one is for instruction range
> >   packet, one is for discontinuity packet and one is for exception
> >   packet.
> > * Added supporting for ETMv3 exception packet.
> > * Followed Mathieu's suggestion to move all sample flags handling
> >   from decoder layer to cs-etm.c, thus it has enough info to set flags
> >   based on trace context in single place.
> >
> > Changes from v1:
> > * Moved exception packets handling patches into patch series 'perf
> >   cs-etm: Correct packets handling'.
> > * Added sample flags fixing up for TRACE_OFF packet.
> > * Created a new function which is used to maintain flags fixing up.
> >
> >
> > Leo Yan (8):
> >   perf cs-etm: Add last instruction information in packet
> >   perf cs-etm: Set sample flags for instruction range packet
> >   perf cs-etm: Set sample flags for trace discontinuity
> >   perf cs-etm: Add exception number in exception packet
> >   perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata
> >   perf cs-etm: Add traceID in packet
> >   perf cs-etm: Set sample flags for exception packet
> >   perf cs-etm: Set sample flags for exception return packet
> >
> >  .../perf/util/cs-etm-decoder/cs-etm-decoder.c |  41 +-
> >  .../perf/util/cs-etm-decoder/cs-etm-decoder.h |   6 +
> >  tools/perf/util/cs-etm.c                      | 394 +++++++++++++++++-
> >  tools/perf/util/cs-etm.h                      |  53 ++-
> >  4 files changed, 476 insertions(+), 18 deletions(-)
> >
> > --
> > 2.17.1
> >

-- 

- Arnaldo

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

      reply	other threads:[~2019-02-04 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29 12:28 [PATCH v7 0/8] perf cs-etm: Add support for sample flags Leo Yan
2019-01-29 12:28 ` [PATCH v7 1/8] perf cs-etm: Add last instruction information in packet Leo Yan
2019-01-29 12:28 ` [PATCH v7 2/8] perf cs-etm: Set sample flags for instruction range packet Leo Yan
2019-01-29 12:28 ` [PATCH v7 3/8] perf cs-etm: Set sample flags for trace discontinuity Leo Yan
2019-01-29 12:28 ` [PATCH v7 4/8] perf cs-etm: Add exception number in exception packet Leo Yan
2019-01-29 12:28 ` [PATCH v7 5/8] perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata Leo Yan
2019-01-29 12:28 ` [PATCH v7 6/8] perf cs-etm: Add traceID in packet Leo Yan
2019-01-29 12:28 ` [PATCH v7 7/8] perf cs-etm: Set sample flags for exception packet Leo Yan
2019-01-29 12:28 ` [PATCH v7 8/8] perf cs-etm: Set sample flags for exception return packet Leo Yan
2019-02-04 18:41 ` [PATCH v7 0/8] perf cs-etm: Add support for sample flags Mathieu Poirier
2019-02-04 19:27   ` Arnaldo Carvalho de Melo [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=20190204192758.GJ5593@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=namhyung@kernel.org \
    --cc=robert.walker@arm.com \
    --cc=suzuki.poulose@arm.com \
    /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).