I have more values I want to pass into a USDT probe than there are availble arguments in the probe macros. So I decided to get around this by copying the data into a structure on the stack and then passing the address of that structure to the probe. Likewise in the probe I do a copyin into a D script structure and then operate on that data. This seems to work, but after talking to a coworker I was wondering if probes are actually running concurrently with the applications thus the structure on the stack could possibly be overwritten/reclaimed before the copyin() in the probe happens. --td -- This message posted from opensolaris.org
Casper.Dik at Sun.COM
2007-Jun-27 14:28 UTC
[dtrace-discuss] copyin of stack addresses in a USDT
>This seems to work, but after talking to a coworker I was wondering if probes are actually running concurrently with the applications thus the structure on the stack could possibly be overwritten/reclaimed before the copyin() in the probe happens.Copyin and such run in probe context; i.e., they run synchronous with the execution of the code. But it is true for all kernel operations that data can change while it is being copied (and if it''s copied once in your probe and once in a syscall, the two copyin results may be different. Casper