> >-----Original Message----- >From: Steven Rostedt <rostedt@xxxxxxxxxxx> >Sent: Friday, January 14, 2022 12:04 PM >To: Chen, Hongzhan <hongzhan.chen@xxxxxxxxx> >Cc: linux-trace-devel@xxxxxxxxxxxxxxx>, Kiszka <linux-trace-devel@xxxxxxxxxxxxxxx>; Kiszka, Jan <jan.kiszka@xxxxxxxxxxx> >Subject: Re: [Questions][trace-cmd/libtraceevent] how to correctly parse info out from specifial format of event? > >On Fri, 14 Jan 2022 03:28:37 +0000 >"Chen, Hongzhan" <hongzhan.chen@xxxxxxxxx> wrote: >> >> Following is two dumps, please check: >> >> >> >> smokey-447 [000] 320.193156: cobalt_pthread_create: 74 02 00 00 bf 01 00 00 40 37 4b aa ab 7f 00 00 00 00 00 00 18 00 38 00 00 00 00 00 fe 7f 00 00 60 c3 24 90 ff ff ff ff 5c 81 21 90 ff ff ff ff d8 bd 8c 80 90 c1 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> > >> >common_type: 0x0274 = 628 (matches the ID) >> >common_flags: 00 >> >common_preempt_count: 00 >> >common_pid: 0x000001bf : 447 >> > >> >pth: 0x00007fabaa4b3f40 (whatever that is) >> >policy: 0x00000000 >> >param_ex: 0x00180038 (offset = 0x38 (56) len=0x18 (24) >> >> Thanks for your quick reply. ?? >> >> On my X86 platform , it is printed as 0x380018(offset should be 0x18 >> len = 0x38). It should point to the end of field param_ex > >How did you get that? The above shows the 4 bytes are: > > > field:__data_loc char[] param_ex; offset:20; size:4; signed:1; > >And if you take the 4 bytes at offset 20 from above we get: > > 18 00 38 00 > >And since this is little endian, that turns into: > > 0x00380018 > > >> (field:__data_loc char[] param_ex; offset:20; size:4; >> signed:1) where store its data per my understanding. Please correct >> me if I am wrong. >> >> > > >> > >> >Hmm, the offset points to that set of zeros at the end. >> > >> >How was this event created? >> >> The event definition please refer to https://gitlab.com/Xenomai/xenomai-hacker-space/-/blob/master/kernel/cobalt/trace/cobalt-posix.h >> > >That references other files. Are those other files taken from the Linux kernel? Yes, taken from Linux kernel and built together with Linux kernel. Regards Hongzhan Chen > >Specifically: > >#include <linux/tracepoint.h> >#include <linux/trace_seq.h> #include <trace/define_trace.h> -- Steve