Commit e70bb54d authored by sunliming's avatar sunliming Committed by Steven Rostedt (Google)
Browse files

tracing: Modify print_fields() for fields output order

Now the print_fields() print trace event fields in reverse order. Modify
it to the positive sequence.

Example outputs for a user event:
	test0 u32 count1; u32 count2

Output before:
	example-2547    [000] .....   325.666387: test0: count2=0x2 (2) count1=0x1 (1)

Output after:
	example-2742    [002] .....   429.769370: test0: count1=0x1 (1) count2=0x2 (2)

Link: https://lore.kernel.org/linux-trace-kernel/20230525085232.5096-1-sunliming@kylinos.cn



Fixes: 80a76994 ("tracing: Add "fields" option to show raw trace event fields")
Signed-off-by: default avatarsunliming <sunliming@kylinos.cn>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent cfac4ed7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -847,7 +847,7 @@ static void print_fields(struct trace_iterator *iter, struct trace_event_call *c
	int ret;
	void *pos;

	list_for_each_entry(field, head, link) {
	list_for_each_entry_reverse(field, head, link) {
		trace_seq_printf(&iter->seq, " %s=", field->name);
		if (field->offset + field->size > iter->ent_size) {
			trace_seq_puts(&iter->seq, "<OVERFLOW>");