Skip to contentSkip to conversation

tracing: Show padding as unsigned short

PATCH In review Steven Rostedt 2 participants 3 messages Nov 16, 2011 – Nov 21, 2011 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Show padding as unsigned short

RT added two bytes to trace migrate disable counting to the trace events and used two bytes of the padding to make the change. The structures and all were updated correctly, but the display in the event formats was not:

cat /debug/tracing/events/sched/sched_switch/format

name: sched_switch
ID: 51
format:

	field:unsigned short common_type;	offset:0;	size:2;	signed:0;
	field:unsigned char common_flags;	offset:2;	size:1;	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:unsigned short common_migrate_disable;	offset:8;	size:2;	signed:0;
	field:int common_padding;	offset:10;	size:2;	signed:0;

The field for common_padding has the correct size and offset, but the use of "int" might confuse some parsers (and people that are reading it). This needs to be changed to "unsigned short".

kernel/trace/trace_events.c +1 -1
index 37d3ffb..c71844c 100644
@@ -117,7 +117,7 @@ static int trace_define_common_fields(void)
 	__common_field(unsigned char, preempt_count);
 	__common_field(int, pid);
 	__common_field(unsigned short, migrate_disable);
-	__common_field(int, padding);
+	__common_field(unsigned short, padding);
 
 	return ret;
 }
#1 lore raw
Quoted 30 lines · Steven Rostedt

RT added two bytes to trace migrate disable counting to the trace events and used two bytes of the padding to make the change. The structures and all were updated correctly, but the display in the event formats was not:

cat /debug/tracing/events/sched/sched_switch/format

name: sched_switch
ID: 51
format:
       field:unsigned short common_type;       offset:0;       size:2; signed:0; field:unsigned char common_flags;       offset:2;       size:1; 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:unsigned short common_migrate_disable;    offset:8;       size:2; signed:0; field:int common_padding;       offset:10;      size:2; signed:0;

The field for common_padding has the correct size and offset, but the use of "int" might confuse some parsers (and people that are reading it). This needs to be changed to "unsigned short".

kernel/trace/trace_events.c +0 -0
index 37d3ffb..c71844c 100644

kernel/trace/trace_events.c static int trace_define_common_fields(void) · line 123

Quoted 8 lines
kernel/trace/trace_events.c +1 -1
@@ -117,7 +117,7 @@ static int trace_define_common_fields(void)
        __common_field(unsigned char, preempt_count);
        __common_field(int, pid);
        __common_field(unsigned short, migrate_disable);
-       __common_field(int, padding);
+       __common_field(unsigned short, padding);
 
        return ret;
  }

This one should also be included in 3.0.9-rt26
Thanks

John Kacur
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#2 lore raw
Quoted 3 lines · John Kacur

This one should also be included in 3.0.9-rt26
Thanks

Yes it was added in -rt3, where my stable was based on -rt2. My scripts picked it up when I ran it against -rt3.

-- Steve