Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2015 23:02:46 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Yue Chen <ycyc321@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: How to traverse kernel threads?
Message-ID:  <20150321220246.GE14650@dft-labs.eu>
In-Reply-To: <CAKtBrB4h13ZFJ=V0fvkDeTG-L6=e5Uz9%2BHfYc8vY523Y3X6N0A@mail.gmail.com>
References:  <CAKtBrB4h13ZFJ=V0fvkDeTG-L6=e5Uz9%2BHfYc8vY523Y3X6N0A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 21, 2015 at 05:54:24PM -0400, Yue Chen wrote:
> Dear all,
> 
> Is there an easy way to traverse all the kernel threads (including
> modules') in a FreeBSD kernel module?
> The resulting structure would be `` struct thread * ''.
> 

Well if you read kthread_add you can see you just need to traverse
threads linked into proc0.

Chances are you also want to traverse kernel process (see kproc_create).

The real question though is what are you trying to achieve.

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150321220246.GE14650>