Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sizhe Liu" <liusizhe5@huawei.com>
Cc: linux-pci@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 7/8] hwtracing: hisi_ptt: Add pattern PMU config for trace format selection
Date: Thu, 03 Sep 2026 08:17:01 +0000	[thread overview]
Message-ID: <20260903081701.7C2211F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260903075241.1445338-8-liusizhe5@huawei.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The `pattern` field in `struct hisi_ptt_trace_ctrl` is defined as a 1-bit bitfield, despite being documented and parsed as a 4-bit field.
- [Low] Typo in the newly added documentation: 'message-type-basedfield' is missing a space.
--

commit 089e32a211137f88a4d8b5c44e954565dc797fe5
Author: Sizhe Liu <liusizhe5@huawei.com>

hwtracing: hisi_ptt: Add pattern PMU config for trace format selection

This commit introduces a pattern PMU config field for controlling the TLP
header format traced by the hardware. It allows selecting between a legacy
format and a new format using a 4-bit configuration value.

> diff --git a/Documentation/trace/hisi-ptt.rst b/Documentation/trace/hisi-ptt.rst
> index f6a2655f99e57..c95eaa12f4d35 100644
> --- a/Documentation/trace/hisi-ptt.rst
> +++ b/Documentation/trace/hisi-ptt.rst
[ ... ]
> @@ -255,7 +255,28 @@ directly from the TLP header.
>       DW2 [                     Header DW2                            ]
>       DW3 [                     Header DW3                            ]
>  
> -5. Memory Management
> +5. Trace pattern
> +-----------------
> +
> +You can control whether the trace is taken with the new version of the
> +TLP header format by specifying the `pattern` parameter. The default
> +value is 0, which means the legacy format is used for backward
> +compatibility. The parameter value is 4 bit and bit[3:1] are currently
> +reserved for extension. Current supported values are shown below:
> +
> +- 4'b0000: legacy trace format
> +    DW2 and DW3 are printed with generic field names only, and
> +    no message-type-basedfield decoding.

[Severity: Low]
This isn't a bug, but there is a typo here: "message-type-basedfield" is
missing a space.

[ ... ]
> diff --git a/drivers/hwtracing/ptt/hisi_ptt.h b/drivers/hwtracing/ptt/hisi_ptt.h
> index 46030aa880811..584f65ba1e320 100644
> --- a/drivers/hwtracing/ptt/hisi_ptt.h
> +++ b/drivers/hwtracing/ptt/hisi_ptt.h
[ ... ]
> @@ -139,6 +142,7 @@ struct hisi_ptt_trace_ctrl {
>  	u32 filter:16;
>  	u32 format:1;
>  	u32 type:4;
> +	u32 pattern:1;
>  };

[Severity: Low]
Could this 1-bit bitfield inadvertently truncate the 4-bit pattern value?

The documentation and hisi_ptt_pmu_init_configs() parse the pattern as a
4-bit field, but assigning it to this 1-bit bitfield will truncate it.

If future extensions utilize the reserved bits (e.g., a value of 2 or 3),
the truncation would silently drop those bits, which could cause the
driver to mistakenly fall back to the legacy format.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260903075241.1445338-1-liusizhe5@huawei.com?part=7

  reply	other threads:[~2026-09-03  8:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  7:52 [PATCH v3 0/8] Enhance TLP packet decoder with field-level parsing and versioning Sizhe Liu
2026-09-03  7:52 ` [PATCH v3 1/8] perf hisi-ptt: Abstract trace data buf and offset Sizhe Liu
2026-09-03  7:59   ` sashiko-bot
2026-09-03  7:52 ` [PATCH v3 2/8] perf hisi-ptt: Complete the field names for 4DW and 8DW packets Sizhe Liu
2026-09-03  7:57   ` sashiko-bot
2026-09-03  7:52 ` [PATCH v3 3/8] perf hisi-ptt: Extract the raw data printing part Sizhe Liu
2026-09-03  8:00   ` sashiko-bot
2026-09-03  7:52 ` [PATCH v3 4/8] perf hisi-ptt: Merge 4DW and 8DW HEAD0 printing Sizhe Liu
2026-09-03  8:03   ` sashiko-bot
2026-09-03  7:52 ` [PATCH v3 5/8] perf hisi-ptt: Add parsing of supported message types Sizhe Liu
2026-09-03  8:07   ` sashiko-bot
2026-09-03  7:52 ` [PATCH v3 6/8] perf hisi-ptt: Add field-level parsing for header DW2/DW3 Sizhe Liu
2026-09-03  8:08   ` sashiko-bot
2026-09-03  7:52 ` [PATCH v3 7/8] hwtracing: hisi_ptt: Add pattern PMU config for trace format selection Sizhe Liu
2026-09-03  8:17   ` sashiko-bot [this message]
2026-09-03  7:52 ` [PATCH v3 8/8] perf hisi-ptt: Pass pattern version to decoder for compatibility Sizhe Liu
2026-09-03  8:15   ` sashiko-bot

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=20260903081701.7C2211F00A3A@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