Thread (28 messages) 28 messages, 2 authors, 2025-10-01
STALE275d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH blktrace v2 21/22] blkparse: parse zone append completions

From: Johannes Thumshirn <hidden>
Date: 2025-09-25 15:06:02
Also in: linux-block, lkml
Subsystem: the rest · Maintainer: Linus Torvalds

Parse completion of Zone Append commands in blkparse.

Signed-off-by: Johannes Thumshirn <redacted>
---
 blkparse_fmt.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/blkparse_fmt.c b/blkparse_fmt.c
index 2767edd..725ddbe 100644
--- a/blkparse_fmt.c
+++ b/blkparse_fmt.c
@@ -327,9 +327,31 @@ static char *parse_field(char *act, struct per_cpu_info *pci,
 	return p;
 }
 
-static void process_zoned(char *act, struct blk_io_trace2 *t, char *name)
+static void process_zoned(char *act, struct blk_io_trace2 *t,
+			  unsigned long long elapsed, char *name)
 {
 	switch (act[1]) {
+	case 'A':	/* Zone Append */
+		if (elapsed != -1ULL) {
+			if (t_sec(t))
+				fprintf(ofp, "%llu + %u (%8llu) [%d]\n",
+					(unsigned long long) t->sector,
+					t_sec(t), elapsed, t->error);
+			else
+				fprintf(ofp, "%llu (%8llu) [%d]\n",
+					(unsigned long long) t->sector,
+					elapsed, t->error);
+		} else {
+			if (t_sec(t))
+				fprintf(ofp, "%llu + %u [%d]\n",
+					(unsigned long long) t->sector,
+					t_sec(t), t->error);
+			else
+				fprintf(ofp, "%llu [%d]\n",
+					(unsigned long long) t->sector,
+					t->error);
+		}
+		break;
 	case 'P': /* Zone Plug */
 		fprintf(ofp, "[%s]\n", name);
 		break;
@@ -471,7 +493,7 @@ static void process_default(char *act, struct per_cpu_info *pci,
 		break;
 
 	case 'Z':	/* Zoned command */
-		process_zoned(act, t, name);
+		process_zoned(act, t, elapsed, name);
 		break;
 	default:
 		fprintf(stderr, "Unknown action %c\n", act[0]);
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help