Skip to contentSkip to conversation

io_uring: make tracing format consistent

PATCH Superseded Dylan Yudaken 2 participants 2 messages Mar 15, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: make tracing format consistent

Make the tracing formatting for user_data and flags consistent.

Having consistent formatting allows one for example to grep for a specific user_data/flags and be able to trace a single sqe through easily.

Change user_data to be %llu everywhere, and flags to be %u. Additionally remove the '=' for flags in io_uring_req_failed, again for consistency.

---
 include/trace/events/io_uring.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
include/trace/events/io_uring.h +8 -8
index 18d4341c581c..92446436b3ac 100644
@@ -327,11 +327,11 @@ TRACE_EVENT(io_uring_complete,
 	TP_ARGS(ctx, req, user_data, res, cflags),
 
 	TP_STRUCT__entry (
-		__field(  void *,	ctx		)
-		__field(  void *,	req		)
-		__field(  u64,		user_data	)
-		__field(  int,		res		)
-		__field(  unsigned,	cflags		)
+		__field(  void *,		ctx		)
+		__field(  void *,		req		)
+		__field(  unsigned long long, 	user_data	)
+		__field(  int,			res		)
+		__field(  unsigned,		cflags		)
 	),
 
 	TP_fast_assign(
@@ -342,9 +342,9 @@ TRACE_EVENT(io_uring_complete,
 		__entry->cflags		= cflags;
 	),
 
-	TP_printk("ring %p, req %p, user_data 0x%llx, result %d, cflags %x",
+	TP_printk("ring %p, req %p, user_data %llu, result %d, cflags %u",
 		__entry->ctx, __entry->req,
-		(unsigned long long)__entry->user_data,
+		__entry->user_data,
 		__entry->res, __entry->cflags)
 );
 
@@ -530,7 +530,7 @@ TRACE_EVENT(io_uring_req_failed,
 	),
 
 	TP_printk("ring %p, req %p, user_data %llu, "
-		"op %d, flags=0x%x, prio=%d, off=%llu, addr=%llu, "
+		"op %d, flags %u, prio=%d, off=%llu, addr=%llu, "
 		  "len=%u, rw_flags=0x%x, buf_index=%d, "
 		  "personality=%d, file_index=%d, pad=0x%llx/%llx, error=%d",
 		  __entry->ctx, __entry->req, __entry->user_data,

base-commit: f3b6a41eb2bbdf545a42e54d637c34f4b1fdf5b9

Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 7 lines · Dylan Yudaken

Make the tracing formatting for user_data and flags consistent.

Having consistent formatting allows one for example to grep for a specific user_data/flags and be able to trace a single sqe through easily.

Change user_data to be %llu everywhere, and flags to be %u. Additionally remove the '=' for flags in io_uring_req_failed, again for consistency.

Shouldn't we rather make flags be %x everywhere? Doesn't make a lot of sense to have a flag based value be in decimal.

Ditto on user_data actually, I would guess the most common use case is stuffing an address in there. And if it's a masked value, then it's easier to read in hex too.

Hmm?

Signature · 1 line
Jens Axboe