I'm using this dtrace script from here to try to find when context switches occur for the threads of a java program.
I'm trying to match the data gathered from the script with trace data gathered from the running program (things like method entry/exit). I get the pthread id of the running thread using a short JNI method that simply returns the value of pthread_self().
The problem i'm having is that the thread id I get from calling pthread_self() is completely different from any thread id I get in the dtrace script. I'm wondering if it's because i'm calling pthread_self() incorrectly since it returns a pointer, however it's been hard to find information about what pthread_t actually is on mac osx.