From: sashiko-bot@kernel.org
To: "Sizhe Liu" <liusizhe5@huawei.com>
Cc: linux-perf-users@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 10/10] perf hisi-ptt: Add decoder version compatibility
Date: Thu, 04 Jun 2026 08:03:56 +0000 [thread overview]
Message-ID: <20260604080356.9F8761F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260604075005.2219785-11-liusizhe5@huawei.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The code silently accepts unknown future decoder versions without warning the user, contradicting the commit message.
--
commit 81956f61abf20a5e88b7e9d82765dace1fbc899f
Author: Sizhe Liu <liusizhe5@huawei.com>
perf hisi-ptt: Add decoder version compatibility
This commit introduces a version field to the hisi_ptt auxtrace info record
to distinguish between legacy and detailed packet parsing formats. It updates
the recording and decoding logic to process the data accurately based on the
detected version.
> diff --git a/tools/perf/util/hisi-ptt.c b/tools/perf/util/hisi-ptt.c
> index e321f393601b8..4f52cfb4e1903 100644
> --- a/tools/perf/util/hisi-ptt.c
> +++ b/tools/perf/util/hisi-ptt.c
[ ... ]
> @@ -159,10 +166,13 @@ int hisi_ptt_process_auxtrace_info(union perf_event *event,
> {
[ ... ]
> ptt->machine = &session->machines.host; /* No kvm support */
> ptt->auxtrace_type = auxtrace_info->type;
> ptt->pmu_type = auxtrace_info->priv[0];
> -
> + ptt->version = priv_size >= HISI_PTT_AUXTRACE_PRIV_SIZE_V2 ?
> + (u32)auxtrace_info->priv[1] : HISI_PTT_DECODER_V1;
[Severity: Medium]
The commit message explicitly states: "If version is unknown (future), warn
and decode auxtrace as v2."
Does hisi_ptt_process_auxtrace_info() implement this promised warning?
It appears to silently assign the future version directly from
auxtrace_info->priv[1] without bounds checking or notifying the user. Could a
warning be added here to match the stated design intent and prevent potential
compatibility issues from being masked?
> ptt->auxtrace.process_event = hisi_ptt_process_event;
> ptt->auxtrace.process_auxtrace_event = hisi_ptt_process_auxtrace_event;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260604075005.2219785-1-liusizhe5@huawei.com?part=10
prev parent reply other threads:[~2026-06-04 8:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 7:49 [PATCH 00/10] perf hisi-ptt: Enhance TLP packet decoder with field-level parsing and versioning Sizhe Liu
2026-06-04 7:49 ` [PATCH 01/10] perf hisi-ptt: Fix spelling and abbreviation errors Sizhe Liu
2026-06-04 7:49 ` [PATCH 02/10] perf hisi-ptt: Fix PTT trace TLP Header parsing Sizhe Liu
2026-06-04 7:59 ` sashiko-bot
2026-06-04 7:49 ` [PATCH 03/10] perf hisi-ptt: Rename hisi_ptt_4dw union for reuse Sizhe Liu
2026-06-04 7:49 ` [PATCH 04/10] perf hisi-ptt: Abstract trace data buf and offset Sizhe Liu
2026-06-04 7:50 ` [PATCH 05/10] perf hisi-ptt: Complete the field names for 4DW and 8DW packets Sizhe Liu
2026-06-04 7:50 ` [PATCH 06/10] perf hisi-ptt: Extract the raw data printing part Sizhe Liu
2026-06-04 7:50 ` [PATCH 07/10] perf hisi-ptt: Merge 4DW and 8DW HEAD0 printing Sizhe Liu
2026-06-04 7:50 ` [PATCH 08/10] perf hisi-ptt: Add parsing of supported message types Sizhe Liu
2026-06-04 8:01 ` sashiko-bot
2026-06-04 7:50 ` [PATCH 09/10] perf hisi-ptt: Add field-level parsing for header DW2/DW3 Sizhe Liu
2026-06-04 7:58 ` sashiko-bot
2026-06-04 7:50 ` [PATCH 10/10] perf hisi-ptt: Add decoder version compatibility Sizhe Liu
2026-06-04 8:03 ` sashiko-bot [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=20260604080356.9F8761F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=liusizhe5@huawei.com \
--cc=sashiko-reviews@lists.linux.dev \
/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