>-----Original Message----- >From: Steven Rostedt <rostedt@xxxxxxxxxxx> >Sent: Friday, January 14, 2022 10:07 AM >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 01:37:08 +0000 >"Chen, Hongzhan" <hongzhan.chen@xxxxxxxxx> wrote: > >From your other email: > >> root@ecs-xenomai-isar:~# cat /sys/kernel/debug/tracing/events/cobalt_posix/cobalt_pthread_create/format >> name: cobalt_pthread_create >> ID: 628 >> 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 long pth; offset:8; size:8; signed:0; >> field:int policy; offset:16; size:4; signed:1; >> field:__data_loc char[] param_ex; offset:20; size:4; signed:1; >> >> print fmt: "pth=%p policy=%s param=' %s '", (void *)REC->pth, __print_symbolic(REC->policy, >> {0, "normal"}, {1, "fifo"}, {2, "rr"}, {11, "tp"}, {12, "quota"}, {10, "sporadic"}, {42, "cobalt"}, >> {43, "weak"}), cobalt_trace_parse_sched_params(p, REC->policy, (struct sched_param_ex *)(__get_dynamic_array(param_ex))) >> >> [2]: >> smokey-752 [000] d.~2 7970.727466: cobalt_pthread_getschedparam: pth=000000009bbc7fe0 policy=fifo param={ priority=50 } >> smokey-762 [000] .... 7970.727492: cobalt_pthread_create: pth=00000000983468a5 policy=quota param={ priority=1, group=0 } > > > >> 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 (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 Regards Hongzhan Chen > >> smokey-449 [000] 320.196623: cobalt_pthread_create: 74 02 00 00 c1 01 00 00 00 e7 6e a9 ab 7f 00 00 01 00 00 00 18 00 38 00 01 00 00 00 30 00 00 00 20 7c 82 77 fe 7f 00 00 60 7b 82 77 fe 7f 00 00 00 2b 89 18 55 a6 fa ba 40 37 4b aa ab 7f 00 00 3e 3d e2 00 7f 55 00 00 d0 7b 82 77 fe 7f 00 00 > >Although the above has content for that: > > "40 37 4b aa ab 7f 00 00 3e 3d e2 00 7f 55 00 00 d0 7b 82 77 fe 7f 00 00" > >-- Steve > > >
![]() |