Skip to contentSkip to conversation

Documentation: tracing: update format of sched_wakeup in example

PATCH In review Ali Zahraee 2 participants 2 messages Mar 14, 2024 – Apr 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: tracing: update format of sched_wakeup in example

The format of the sched_wakeup event is used as an example in the documentation. But the given format is obsolete. This patch updates the format in the example to match the current format of this event.

---
 Documentation/trace/events.rst | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
Documentation/trace/events.rst +13 -12
index 759907c20e75..65fe205c95e6 100644
@@ -129,24 +129,25 @@ event::
 	# cat /sys/kernel/tracing/events/sched/sched_wakeup/format
 
 	name: sched_wakeup
-	ID: 60
+	ID: 70
 	format:
 		field:unsigned short common_type;	offset:0;	size:2;
+                	signed:0;
 		field:unsigned char common_flags;	offset:2;	size:1;
-		field:unsigned char common_preempt_count;	offset:3;	size:1;
-		field:int common_pid;	offset:4;	size:4;
-		field:int common_tgid;	offset:8;	size:4;
+                	signed:0;
+		field:unsigned char common_preempt_count;	offset:3;
+                	size:1; signed:0;
+		field:int common_pid;	offset:4;	size:4;	signed:1;
 
-		field:char comm[TASK_COMM_LEN];	offset:12;	size:16;
-		field:pid_t pid;	offset:28;	size:4;
-		field:int prio;	offset:32;	size:4;
-		field:int success;	offset:36;	size:4;
-		field:int cpu;	offset:40;	size:4;
+		field:char comm[16];	offset:8;	size:16;	signed:0;
+		field:pid_t pid;	offset:24;	size:4;	signed:1;
+		field:int prio;	offset:28;	size:4;	signed:1;
+		field:int target_cpu;	offset:32;	size:4;	signed:1;
 
-	print fmt: "task %s:%d [%d] success=%d [%03d]", REC->comm, REC->pid,
-		   REC->prio, REC->success, REC->cpu
+	print fmt: "comm=%s pid=%d prio=%d target_cpu=%03d", REC->comm, REC->pid,
+        	        REC->prio, REC->target_cpu
 
-This event contains 10 fields, the first 5 common and the remaining 5
+This event contains 8 fields, the first 4 common and the remaining 4
 event-specific.  All the fields for this event are numeric, except for
 'comm' which is a string, a distinction important for event filtering.
 
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 14 lines · On Thu, 14 Mar 2024 15:41:36 +0100 Ali Zahraee <[email protected]> wrote:

The format of the sched_wakeup event is used as an example in the documentation. But the given format is obsolete. This patch updates the format in the example to match the current format of this event.

---
 Documentation/trace/events.rst | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
Documentation/trace/events.rst +0 -0
index 759907c20e75..65fe205c95e6 100644

Documentation/trace/events.rst event:: · line 132

Quoted 5 lines
Documentation/trace/events.rst +1 -1
@@ -129,24 +129,25 @@ event::
 	# cat /sys/kernel/tracing/events/sched/sched_wakeup/format
 
 	name: sched_wakeup
-	ID: 60
+	ID: 70

Really don't need to change that, as it's defined at compile time and may be different. For example, I have:

system: sched
name: sched_wakeup
ID: 297

Documentation/trace/events.rst event:: · line 135

Quoted 3 lines
Documentation/trace/events.rst +1 -0
 	format:
 		field:unsigned short common_type;	offset:0;	size:2;
+                	signed:0;

Don't line break the fields, as new lines are part of the format.

Documentation/trace/events.rst event:: · line 139

Quoted 7 lines
Documentation/trace/events.rst +3 -3
 		field:unsigned char common_flags;	offset:2;	size:1;
-		field:unsigned char common_preempt_count;	offset:3;	size:1;
-		field:int common_pid;	offset:4;	size:4;
-		field:int common_tgid;	offset:8;	size:4;
+                	signed:0;
+		field:unsigned char common_preempt_count;	offset:3;
+                	size:1; signed:0;

Again, the above needs to be on one line.

Thanks,

-- Steve

Quoted 22 lines
Documentation/trace/events.rst +8 -8
+		field:int common_pid;	offset:4;	size:4;	signed:1;
 
-		field:char comm[TASK_COMM_LEN];	offset:12;	size:16;
-		field:pid_t pid;	offset:28;	size:4;
-		field:int prio;	offset:32;	size:4;
-		field:int success;	offset:36;	size:4;
-		field:int cpu;	offset:40;	size:4;
+		field:char comm[16];	offset:8;	size:16;	signed:0;
+		field:pid_t pid;	offset:24;	size:4;	signed:1;
+		field:int prio;	offset:28;	size:4;	signed:1;
+		field:int target_cpu;	offset:32;	size:4;	signed:1;
 
-	print fmt: "task %s:%d [%d] success=%d [%03d]", REC->comm, REC->pid,
-		   REC->prio, REC->success, REC->cpu
+	print fmt: "comm=%s pid=%d prio=%d target_cpu=%03d", REC->comm, REC->pid,
+        	        REC->prio, REC->target_cpu
 
-This event contains 10 fields, the first 5 common and the remaining 5
+This event contains 8 fields, the first 4 common and the remaining 4
 event-specific.  All the fields for this event are numeric, except for
 'comm' which is a string, a distinction important for event filtering.