1 Reply Latest reply: Jan 13, 2010 7:30 PM by 807559 RSS

    Getting pthread id in dtrace lwp-create probe

    807559
      Hi,

      I want to use dtrace to provide a mapping between the user thread id (i.e. the thread id returned during a pthread_create) to the corresponding LWP id.

      I am trying to use:

      # dtrace -n 'proc:::lwp-create{printf("%d : %d created %d", pid, tid, args[0]->pr_lwpid)}'

      However, the output looks like:
      12 4469 lwp_create:lwp-create 1712 : 1 created 2
      13 4469 lwp_create:lwp-create 1712 : 1 created 3
      13 4469 lwp_create:lwp-create 1712 : 1 created 4
      13 4469 lwp_create:lwp-create 1712 : 1 created 5
      13 4469 lwp_create:lwp-create 1712 : 1 created 6
      13 4469 lwp_create:lwp-create 1712 : 1 created 7
      13 4469 lwp_create:lwp-create 1712 : 1 created 8
      13 4469 lwp_create:lwp-create 1712 : 1 created 9


      It seems like I am not getting the right thread id (the one from pthread_create).

      Any idea?

      Thanks in advance,
      Regards,
      Raj Iyer