mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Athira Rajeev <atrajeev@linux.ibm.com>
To: Wang Yan <wangyan01@kylinos.cn>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	namhyung@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	irogers@google.com, adrian.hunter@intel.com,
	james.clark@linaro.org, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf powerpc-vpadtl: Fix raw_size of DTL samples
Date: Fri, 28 Aug 2026 17:29:00 +0530	[thread overview]
Message-ID: <85CF9B6A-8E46-4D5E-8AAD-A9B3B75DF6BF@linux.ibm.com> (raw)
In-Reply-To: <20260825094733.1031566-1-wangyan01@kylinos.cn>



> On 25 Aug 2026, at 3:17 PM, Wang Yan <wangyan01@kylinos.cn> wrote:
> 
> In powerpc_vpadtl_sample(), raw_data of the synthetic sample points to a
> struct powerpc_vpadtl_entry (48 bytes), but raw_size is set to
> sizeof(record).  record is a struct powerpc_vpadtl_entry pointer, so
> sizeof(record) is the size of the pointer (8 bytes on 64-bit) rather
> than the size of the record itself.
> 
> As a result, consumers that bound their access to raw_data by raw_size
> only see or copy the first 8 bytes of each DTL entry instead of the full
> record.
> 
> Use sizeof(*record) so that raw_size reflects the actual length of the
> raw data.
> 
> Fixes: 8644834a482a ("perf powerpc: Process the DTL entries in queue and deliver samples")
> Signed-off-by: Wang Yan <wangyan01@kylinos.cn>
Reviewed-by: Athira Rajeev <atrajeev@linux.ibm.com>

Thanks
Athira
> ---
> tools/perf/util/powerpc-vpadtl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/powerpc-vpadtl.c b/tools/perf/util/powerpc-vpadtl.c
> index 710f3093f3f9..af6783cfdb53 100644
> --- a/tools/perf/util/powerpc-vpadtl.c
> +++ b/tools/perf/util/powerpc-vpadtl.c
> @@ -196,7 +196,7 @@ static int powerpc_vpadtl_sample(struct powerpc_vpadtl_entry *record,
> sample.cpumode = PERF_RECORD_MISC_KERNEL;
> sample.time = save;
> sample.raw_data = record;
> - sample.raw_size = sizeof(record);
> + sample.raw_size = sizeof(*record);
> event.sample.header.type = PERF_RECORD_SAMPLE;
> event.sample.header.misc = sample.cpumode;
> event.sample.header.size = sizeof(struct perf_event_header);
> -- 
> 2.25.1
> 


  reply	other threads:[~2026-08-28 11:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  9:47 Wang Yan
2026-08-28 11:59 ` Athira Rajeev [this message]
2026-08-30 13:37   ` Arnaldo Carvalho de Melo

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=85CF9B6A-8E46-4D5E-8AAD-A9B3B75DF6BF@linux.ibm.com \
    --to=atrajeev@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wangyan01@kylinos.cn \
    /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

all inboxes | Powered by JetHome®