Re: [PATCH 10/10] perf hisi-ptt: Add decoder version compatibility

From: Sizhe Liu

Date: Wed Jul 29 2026 - 04:21:18 EST



On 2026/7/14 1:49, Bjorn Helgaas wrote:
On Thu, Jun 04, 2026 at 03:50:05PM +0800, Sizhe Liu wrote:
The hisi_ptt packet decoder now performs detailed field-level parsing
of TLP header DW2 and DW3 based on the message type classified from
DW0 (added in the previous patches). However, trace data recorded
with older versions of the tool does not contain the information
needed for this detailed parsing, and should continue to use the
generic field-name-only output.
Add blank line between paragraphs. Also applies to 05/10.

Introduce a version field (V1/V2) in the auxtrace info record to
distinguish between the two data formats:
IMO a blank line here would also improve readability. And consider
indenting bullet points a couple spaces. Also applies to other commit
logs in this series, including sample formats.

- V1 (legacy): auxtrace priv contains only PMU type. DW2 and DW3
are printed with generic field names only, no message-type-based
field decoding.
- V2 (current): auxtrace priv contains PMU type and version. DW2
and DW3 are decoded according to the TLP message type (MWr, Msg,
Atomic, IO, CPL, Cfg) with detailed field names.
Could use imperative mood, e.g.,

- V1 (legacy): auxtrace priv contains only PMU type. Print DW2 and
DW3 generic field names only, no message-type-based field
decoding.

- V2 (current): auxtrace priv contains PMU type and version. Decode
DW2 and DW3 according to the TLP message type (MWr, Msg, Atomic,
IO, CPL, Cfg) with detailed field names.
Thanks, all the preceding suggestions will be modified in v2.
At recording time, set the version to HISI_PTT_DECODER_V2 in the
auxtrace info. At decoding time, determine the version from the
priv data size and the version field:
- If priv_size >= V2, read the version from priv[1].
- If priv_size < V2, assume V1 for backward compatibility.
- If version is unknown (future), warn and decode auxtrace as v2.

Also add the version to the dump output alongside the PMU type.
Adjust hisi_ptt_pkt_size position to adapt to compilation.
AFAICS this series adds new functionality and probably doesn't qualify
for "stable" tags, given the documented rules. But I think the
maintainers are pretty aggressive about backporting things anyway.
Hi Bjorn,
Thanks for your response and for clarifying the policy regarding the stable tag.
You're right, patches 03-10 in this series are new functionality and shouldwait
for the next merge window.

For patch 01 and patch 02, they do fix the issue of inaccurate packet parsing,
I think it is better to separate them from the patch series.
I am sending them individually after fixing the C bitfields issues if that makes things clearer.

If you have any suggestions on this split, please feel free to let me know.

Regards,
Sizhe