DTrace copyin with struct doesn't work?

Yuri yuri at rawbw.com
Wed Jul 24 18:13:21 UTC 2013


This simple .d script fails:

---script begin---
#!/usr/sbin/dtrace -s

struct my_args {
    int ii;
};

fbt::sys_select:entry
{
   printf("sys_select %i", ((struct my_args*)copyin(arg1, sizeof (struct 
my_args)))->ii);
}
---script end---

dtrace: error on enabled probe ID 1 (ID 33598: 
fbt:kernel:sys_select:entry): invalid address (0xffffff82ff0799d8) in 
action #1 at DIF offset 40
dtrace: error on enabled probe ID 1 (ID 33598: 
fbt:kernel:sys_select:entry): invalid address (0xffffff82fefb19d8) in 
action #1 at DIF offset 40

Function sys_select is defined in kern/sys_generic.c:
int
sys_select(struct thread *td, struct select_args *uap)


arg1 in DTrace script should correspond to uap argument of sys_select, 
and dereferencing should always produce an int.

Yuri


More information about the freebsd-hackers mailing list