Re: Using KERN_KDGETBUF thread values
Re: Using KERN_KDGETBUF thread values
- Subject: Re: Using KERN_KDGETBUF thread values
- From: Shantonu Sen <email@hidden>
- Date: Thu, 17 May 2012 09:25:43 -0700
It's not current_thread() (a pointer), it's a 64-bit non-repeating thread ID (thread_tid(current_thread()))
What information are you trying to get? You can try using proc_info(PROC_PIDTHREADID64INFO).
Shantonu
On May 14, 2012, at 12:21 PM, James Boulton <email@hidden> wrote:
> I'm using sysctl / KERN_KDGETBUF to get some profiling information and arg5 of the kd_buf structure returned is the currently executing thread (as returned by current_thread() in the XNU kernel).
>
> I'm trying to figure out how to use this thread id to get some useful details about the thread, but I cant seem to figure out how to do this.
>
> If I try and use the value with any standard thread functions I get an error of MACH_SEND_INVALID_DEST. I assume this value is a kernel thread id of some kind (it doesnt appear to be a pointer) and not a mach port. It looks like I should be using something like thread_get_kernel_port to get the send right to the thread, but this also comes back with MACH_SEND_INVALID_DEST.
>
> Any kernel guru's out there, I'd really appreciate some help! :o)
>
> Cheers,
> -- James
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden