wkz / ply

Light-weight Dynamic Tracer for Linux
https://wkz.github.io/ply
GNU General Public License v2.0
402 stars 156 forks source link

Does the "field:__data_loc " supported? #33

Closed xumn3348 closed 2 years ago

xumn3348 commented 3 years ago

test case: tracepoint:irq/irq_handler_entry

Symptom:it Cann't print data->name because data->name's type is "field:__data_loc char[] name; offset:12; size:4; signed:0".

name: irq_handler_entry ID: 52 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:int irq;  offset:8;   size:4; signed:1;
field:__data_loc char[] name;   offset:12;  size:4; signed:0;

print fmt: "irq=%d name=%s", REC->irq, __get_str(name).

wkz commented 3 years ago

I did some initial work on this (and #34) on the tracepoint branch. It is very rough still, but have a look at it and see what you think about it. In your case you could try something like...

ply -c "sleep 3"  't:irq/irq_handler_entry { @[dyn(data->name)] = count(); }'

...for example.

xumn3348 commented 3 years ago

a great job, it works. thanks very much.

wkz commented 2 years ago

Fixed in a2cc639