Hello, @derekbruening
I'm experimenting with starting DR from the application. Using start/stop API described here
https://dynamorio.org/dr__app_8h.html#abcdedd068a4d264401c31767355ec218 it was possible to make a global start and stop.
main() {
dr_set();
dr_start();
some_function();
dr_stop();
dr_clean();
}
But if I calls to these functions in the thread function, there is a freeze. The logs show that start is called 2 times and stop never once(for 8 threads). join in the main waits for all threads.
pthread_finction(){
pthread_mutex_lock(&lock);
if (count == 0) {
dr_set();
count+=1;
}
dr_start();
pthread_mutex_unlock(&lock);
some_function();
pthread_mutex_lock(&lock);
dr_stop();
if (count == THREAD_NUM) {
dr_clean();
}
pthread_mutex_unlock(&lock);
}
As I understand from the description of start/stop API functions they are called globally.
Q: If I want to trace functions in a thread, like I showed in the example, can I use the start/stop API (maybe I used it incorrectly for this) or should I go to the annotation approach?
BR,
Artem