From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout08.his.huawei.com (canpmsgout08.his.huawei.com [113.46.200.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65E183CF049; Thu, 4 Jun 2026 07:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.223 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780559420; cv=none; b=d+L0CyzYkMz7bx5RYXA+DXfCPK890Kg2/8EByxESE3USfsFP61l2G61UBTRU7puBUqs+1QuS2TOvyL6T5iGYco5RdCKb3L0ji4ehOxcXNXxXXgADADLEHtMLb71u5y1VOjX3iQRyl6ym6mfPa+mokXVrGxkIjfz/e1YN7Nq1hiM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780559420; c=relaxed/simple; bh=Ro6/E6xOKUCBYhaGNxYd4ktvW7scQZL/Dy3q1Qt6rlk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jn4DnNpyZOldiQjq9qWioUkRP3cuPlVMxowfv6fz5JWhkGlJnOU8xy/N8ynh9CdVB2LC8sK7ph0SON+DfRT7hV7LOos0wu7ZbnTw5mT8sJwmwsDW1XB0wTjCfecrmu37N9GWCvUhQrqk6eUhG3YYqDBfG7KG0cwac0VUFezNj9c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=wkgUTtvc; arc=none smtp.client-ip=113.46.200.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="wkgUTtvc" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=U0bZ6/5IF5u6IblAtoXo0vDn8/JhU8/jFh51QnHbslU=; b=wkgUTtvcqEqDW31caCt5WvhxzdZJkB2iN2lbhp5RtvQUsgWZLl/iVTR44OwRC6w6WjZunmttz +79tkYmqdUVEVyWorwp+I0e810IT1jdrXQy9sJhXbOCjDluvQLSaifLXbTUNnXywGmDlvQ/kY6n y7xmAWuqpclxcp8ztcNTHG4= Received: from mail.maildlp.com (unknown [172.19.163.214]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4gWGk62qtPzmVW0; Thu, 4 Jun 2026 15:42:22 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 24B4440561; Thu, 4 Jun 2026 15:50:14 +0800 (CST) Received: from kwepemn200012.china.huawei.com (7.202.194.135) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 4 Jun 2026 15:50:13 +0800 Received: from huawei.com (10.50.163.32) by kwepemn200012.china.huawei.com (7.202.194.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 4 Jun 2026 15:50:12 +0800 From: Sizhe Liu To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , , Subject: [PATCH 07/10] perf hisi-ptt: Merge 4DW and 8DW HEAD0 printing Date: Thu, 4 Jun 2026 15:50:02 +0800 Message-ID: <20260604075005.2219785-8-liusizhe5@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20260604075005.2219785-1-liusizhe5@huawei.com> References: <20260604075005.2219785-1-liusizhe5@huawei.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemn200012.china.huawei.com (7.202.194.135) Merge the printing of HEAD0 for both 4DW and 8DW TLP headers into hisi_ptt_print_head0(). This unifies the entry point and makes it easier to add HEAD1/HEAD2/HEAD3 field parsing in subsequent patches. Signed-off-by: Sizhe Liu --- .../hisi-ptt-decoder/hisi-ptt-pkt-decoder.c | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c b/tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c index a5b66e0f7827..9ec84d398cc1 100644 --- a/tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c +++ b/tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c @@ -122,6 +122,30 @@ static void hisi_ptt_print_pkt(struct hisi_ptt_pkt_buf *pkt_buf, pkt_buf->pos += HISI_PTT_FIELD_LENGTH; } +static void hisi_ptt_print_head0(struct hisi_ptt_pkt_buf *pkt_buf) +{ + const char *color = PERF_COLOR_BLUE; + union hisi_ptt_field_data dw; + + dw.value = le32_to_cpu(*(__le32 *)(pkt_buf->buf + pkt_buf->pos)); + hisi_ptt_print_raw_record(pkt_buf->pos, dw.value); + + if (pkt_buf->pkt_type == HISI_PTT_4DW_PKT) + color_fprintf(stdout, color, + " %s %x %s %x %s %x %s %x %s %x %s %x %s %x %s %x\n", + "Format", dw.dw0_4dw.format, + "Type", dw.dw0_4dw.type, + "T9", dw.dw0_4dw.t9, "T8", dw.dw0_4dw.t8, + "TH", dw.dw0_4dw.th, "SO", dw.dw0_4dw.so, + "Length", dw.dw0_4dw.len, + "Time", dw.dw0_4dw.time); + else + color_fprintf(stdout, color, " %s\n", + hisi_ptt_8dw_pkt_field_name[HISI_PTT_8DW_HEAD0]); + + pkt_buf->pos += HISI_PTT_FIELD_LENGTH; +} + static int hisi_ptt_8dw_pkt_desc(struct hisi_ptt_pkt_buf *pkt_buf) { int i; @@ -133,35 +157,22 @@ static int hisi_ptt_8dw_pkt_desc(struct hisi_ptt_pkt_buf *pkt_buf) continue; } + if (i == HISI_PTT_8DW_HEAD0) { + hisi_ptt_print_head0(pkt_buf); + continue; + } + hisi_ptt_print_pkt(pkt_buf, hisi_ptt_8dw_pkt_field_name[i]); } return hisi_ptt_pkt_size[HISI_PTT_8DW_PKT]; } -static void hisi_ptt_4dw_print_dw0(struct hisi_ptt_pkt_buf *pkt_buf) -{ - const char *color = PERF_COLOR_BLUE; - union hisi_ptt_field_data dw; - - dw.value = le32_to_cpu(*(__le32 *)(pkt_buf->buf + pkt_buf->pos)); - hisi_ptt_print_raw_record(pkt_buf->pos, dw.value); - - color_fprintf(stdout, color, - " %s %x %s %x %s %x %s %x %s %x %s %x %s %x %s %x\n", - "Format", dw.dw0_4dw.format, "Type", dw.dw0_4dw.type, - "T9", dw.dw0_4dw.t9, "T8", dw.dw0_4dw.t8, - "TH", dw.dw0_4dw.th, "SO", dw.dw0_4dw.so, - "Length", dw.dw0_4dw.len, "Time", dw.dw0_4dw.time); - - pkt_buf->pos += HISI_PTT_FIELD_LENGTH; -} - static int hisi_ptt_4dw_pkt_desc(struct hisi_ptt_pkt_buf *pkt_buf) { int i; - hisi_ptt_4dw_print_dw0(pkt_buf); + hisi_ptt_print_head0(pkt_buf); for (i = HISI_PTT_4DW_HEAD1; i < HISI_PTT_4DW_TYPE_MAX; i++) hisi_ptt_print_pkt(pkt_buf, hisi_ptt_4dw_pkt_field_name[i]); -- 2.33.0