From nobody Thu Oct 2 02:16:54 2025 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (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 7D4A530FF3A; Thu, 25 Sep 2025 15:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758812693; cv=none; b=fuzXU/PWWIUwPqT6nkO1LViymzqBttS11MGmRkGTdLrxo1udI5rPAbVqPG3lm4AyxoYMjF3DBmHa2CyXcZq4eVnVWarfav+77QsqwBLK8lBwQWmpOOghD/YyuUpa+LMg/8skqAlNwLDTQd4Dv1KTRsQLVOxwR7uV9Bm2WczPp7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758812693; c=relaxed/simple; bh=qtEv5uKcCuKEHByPUXcHd9IS96qiXSbnVERgrids0wI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Spbgj18JdH6ohD/cTOZQ+1dznSqgh1pR4ngOk9RkkrH2WEyA0u49m+RSdu2yrfUvPY066ShGoXuLSSftfVJNJ75o95z5nrN1MgYlC3bWXB1vwetZOImHbLszqQeBxXenKtYAHSwlT0J5W2FetXZyYbinnabFw0PPacLEYF9P4/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=ndmGy5M7; arc=none smtp.client-ip=216.71.153.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="ndmGy5M7" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1758812691; x=1790348691; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qtEv5uKcCuKEHByPUXcHd9IS96qiXSbnVERgrids0wI=; b=ndmGy5M7AfUawwNGfbzxNZqaAY1vHvmGbZCpvTYqqe+6ZFDxEhZ+OKAA W7H/uuIs0nfFW7tLge5ijbWq1Dg5VhuCJli1+RbkRL3wXsy2xKMHVWCv2 I9FhneAdYRrvGlgkQGkqUKIJ6vIcA6CfxkAXfjYa3ACWfS3CCjH20AaqB ss62lZuS9o+MvnsjFX6oeNbdlyL7cRGB7yWysxSk/kYdsOcQ4b24+gCPx iBGOIx788E9uvCymA3FA+Mfwl5lTJyIl2ISROzepuEVTiTgmuE5d5tdG5 VZwHkr0p/zflatAiYa3+1xK6PgSVk7/5LRlYnoiNEZ5gxw0Kj5TwyyTgS A==; X-CSE-ConnectionGUID: OFmpIydOTZ6sOpxF4bd/QQ== X-CSE-MsgGUID: aJUR2dURSC29vVOZfsa4uA== X-IronPort-AV: E=Sophos;i="6.18,292,1751212800"; d="scan'208";a="130348817" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 25 Sep 2025 23:04:50 +0800 IronPort-SDR: 68d55a13_TYmnQVZgwwBbsHJAg79IoTepjZe+X6NydRsLWgl3B2KZ0mP sxQA4FjvzJesDGwyMavF4ZE97/ko/bSMmiBNk7A== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 25 Sep 2025 08:04:51 -0700 WDCIronportException: Internal Received: from c02g55f6ml85.ad.shared (HELO C02G55F6ML85.wdc.com) ([10.224.183.46]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Sep 2025 08:04:48 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-btrace@vger.kernel.org, John Garry , Hannes Reinecke , Damien Le Moal , Christoph Hellwig , Naohiro Aota , Shinichiro Kawasaki , Chaitanya Kulkarni , "Martin K . Petersen" , Johannes Thumshirn Subject: [PATCH blktrace v2 04/22] blktrace: change size of action to 64 bits Date: Thu, 25 Sep 2025 17:04:09 +0200 Message-ID: <20250925150427.67394-5-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250925150427.67394-1-johannes.thumshirn@wdc.com> References: <20250925150427.67394-1-johannes.thumshirn@wdc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In order to add the zoned commands to blktrace's actions, the storage size needs to be increased to 64bits. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- act_mask.c | 4 ++-- blkparse.c | 2 +- blkparse_fmt.c | 15 ++++++++------- blkrawverify.c | 10 +++++----- blktrace.h | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/act_mask.c b/act_mask.c index 8f1b8d7..510c7e0 100644 --- a/act_mask.c +++ b/act_mask.c @@ -42,7 +42,7 @@ int find_mask_map(char *string) return -1; } =20 -int valid_act_opt(int x) +unsigned long long valid_act_opt(unsigned long long x) { - return (1 <=3D x) && (x < (1 << BLK_TC_SHIFT)); + return (1ull <=3D x) && (x < (1ull << BLK_TC_SHIFT)); } diff --git a/blkparse.c b/blkparse.c index 3f4d827..512a2d2 100644 --- a/blkparse.c +++ b/blkparse.c @@ -299,7 +299,7 @@ static int per_device_and_cpu_stats =3D 1; static int track_ios; static int ppi_hash_by_pid =3D 1; static int verbose; -static unsigned int act_mask =3D -1U; +static unsigned long long act_mask =3D -1U; static int stats_printed; static int bin_output_msgs =3D 1; int data_is_native =3D -1; diff --git a/blkparse_fmt.c b/blkparse_fmt.c index 9b83d1d..02c5a3c 100644 --- a/blkparse_fmt.c +++ b/blkparse_fmt.c @@ -8,6 +8,7 @@ #include #include #include +#include =20 #include "blktrace.h" =20 @@ -52,13 +53,13 @@ int add_format_spec(char *option) =20 static inline void fill_rwbs(char *rwbs, struct blk_io_trace *t) { - int w =3D t->action & BLK_TC_ACT(BLK_TC_WRITE); - int a =3D t->action & BLK_TC_ACT(BLK_TC_AHEAD); - int s =3D t->action & BLK_TC_ACT(BLK_TC_SYNC); - int m =3D t->action & BLK_TC_ACT(BLK_TC_META); - int d =3D t->action & BLK_TC_ACT(BLK_TC_DISCARD); - int f =3D t->action & BLK_TC_ACT(BLK_TC_FLUSH); - int u =3D t->action & BLK_TC_ACT(BLK_TC_FUA); + bool w =3D !!(t->action & BLK_TC_ACT(BLK_TC_WRITE)); + bool a =3D !!(t->action & BLK_TC_ACT(BLK_TC_AHEAD)); + bool s =3D !!(t->action & BLK_TC_ACT(BLK_TC_SYNC)); + bool m =3D !!(t->action & BLK_TC_ACT(BLK_TC_META)); + bool d =3D !!(t->action & BLK_TC_ACT(BLK_TC_DISCARD)); + bool f =3D !!(t->action & BLK_TC_ACT(BLK_TC_FLUSH)); + bool u =3D !!(t->action & BLK_TC_ACT(BLK_TC_FUA)); int i =3D 0; =20 if (f) diff --git a/blkrawverify.c b/blkrawverify.c index ed5d258..9c5d595 100644 --- a/blkrawverify.c +++ b/blkrawverify.c @@ -55,7 +55,7 @@ static struct trace_info traces[] =3D { #define N_TRACES (sizeof(traces) / sizeof(struct trace_info)) =20 struct act_info { - __u32 val; + __u64 val; char *string; }; =20 @@ -80,12 +80,12 @@ static struct act_info acts[] =3D { }; #define N_ACTS (sizeof(acts) / sizeof(struct act_info)) =20 -static char *act_to_str(__u32 action) +static char *act_to_str(__u64 action) { static char buf[1024]; unsigned int i; - unsigned int act =3D action & 0xffff; - unsigned int trace =3D (action >> BLK_TC_SHIFT) & 0xffff; + unsigned long long act =3D action & 0xffffffff; + unsigned long long trace =3D (action >> BLK_TC_SHIFT) & 0xffffffff; =20 if (act < N_ACTS) { sprintf(buf, "%s ", acts[act].string); @@ -97,7 +97,7 @@ static char *act_to_str(__u32 action) } } else - sprintf(buf, "Invalid action=3D%08x", action); + sprintf(buf, "Invalid action=3D%016llx", action); =20 return buf; } diff --git a/blktrace.h b/blktrace.h index 944fc08..74dfb48 100644 --- a/blktrace.h +++ b/blktrace.h @@ -144,7 +144,7 @@ extern void set_all_format_specs(char *); extern int add_format_spec(char *); extern void process_fmt(char *, struct per_cpu_info *, struct blk_io_trace= *, unsigned long long, int, unsigned char *); -extern int valid_act_opt(int); +extern unsigned long long valid_act_opt(unsigned long long); extern int find_mask_map(char *); extern char *find_process_name(pid_t); =20 --=20 2.51.0