linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf script: Print PERF_AUX_FLAG_COLLISION flag
Date: Wed, 28 May 2025 15:09:03 -0300	[thread overview]
Message-ID: <aDdRP6v_q0vqen5t@x1> (raw)
In-Reply-To: <20250528153519.188644-1-leo.yan@arm.com>

On Wed, May 28, 2025 at 04:35:19PM +0100, Leo Yan wrote:
> Print out the collision flag for AUX trace data. This is helpful for
> inspecting sample collisions.
> 
> After:
> 
>   0x217b60@/data_nvme1n1/niayan01/upstream/perf.data [0x40]: event: 11
>   .
>   . ... raw event: size 64 bytes
>   .  0000:  0b 00 00 00 00 00 40 00 d2 ef 3f 00 00 00 00 00  ......@...?.....
>   .  0010:  ff 0f 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
>   .  0020:  1c 01 00 00 1c 01 00 00 10 bf 38 d6 11 01 00 00  ..........8.....
>   .  0030:  03 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00  ................
> 
>   3 1176120114960 0x217b60 [0x40]: PERF_RECORD_AUX offset: 0x3fefd2 size: 0xfff flags: 0x8 [C]
> 
> The added character '[C]' indicates the collision.

Simple enough.
 
> Signed-off-by: Leo Yan <leo.yan@arm.com>

Thanks, applied to perf-tools-next,

- Arnaldo
> ---
>  tools/perf/util/event.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
> index c23b77f8f854..2c3081e5c81a 100644
> --- a/tools/perf/util/event.c
> +++ b/tools/perf/util/event.c
> @@ -448,12 +448,13 @@ int perf_event__exit_del_thread(const struct perf_tool *tool __maybe_unused,
>  
>  size_t perf_event__fprintf_aux(union perf_event *event, FILE *fp)
>  {
> -	return fprintf(fp, " offset: %#"PRI_lx64" size: %#"PRI_lx64" flags: %#"PRI_lx64" [%s%s%s]\n",
> +	return fprintf(fp, " offset: %#"PRI_lx64" size: %#"PRI_lx64" flags: %#"PRI_lx64" [%s%s%s%s]\n",
>  		       event->aux.aux_offset, event->aux.aux_size,
>  		       event->aux.flags,
>  		       event->aux.flags & PERF_AUX_FLAG_TRUNCATED ? "T" : "",
>  		       event->aux.flags & PERF_AUX_FLAG_OVERWRITE ? "O" : "",
> -		       event->aux.flags & PERF_AUX_FLAG_PARTIAL   ? "P" : "");
> +		       event->aux.flags & PERF_AUX_FLAG_PARTIAL   ? "P" : "",
> +		       event->aux.flags & PERF_AUX_FLAG_COLLISION ? "C" : "");
>  }
>  
>  size_t perf_event__fprintf_itrace_start(union perf_event *event, FILE *fp)
> -- 
> 2.34.1

      reply	other threads:[~2025-05-28 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 15:35 [PATCH] perf script: Print PERF_AUX_FLAG_COLLISION flag Leo Yan
2025-05-28 18:09 ` 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=aDdRP6v_q0vqen5t@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@arm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@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).