* systemd and kernel process
@ 2015-09-30 18:54 Steve Dickson
2015-09-30 20:25 ` Josh Stone
0 siblings, 1 reply; 3+ messages in thread
From: Steve Dickson @ 2015-09-30 18:54 UTC (permalink / raw)
To: Systemtap List
Hello,
Is there a way for systemd to monitor kernel process?
By monitor I mean the existence.
Here the story... a systemd service calls a command
that creates a number kernel process/threads
then the command exits.
Is there a way for systemd to monitor those kernel process
even though it was told nothing about them?
tia,
steved.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: systemd and kernel process
2015-09-30 18:54 systemd and kernel process Steve Dickson
@ 2015-09-30 20:25 ` Josh Stone
2015-09-30 20:52 ` Steve Dickson
0 siblings, 1 reply; 3+ messages in thread
From: Josh Stone @ 2015-09-30 20:25 UTC (permalink / raw)
To: Steve Dickson, Systemtap List
On 09/30/2015 11:54 AM, Steve Dickson wrote:
> Hello,
>
> Is there a way for systemd to monitor kernel process?
> By monitor I mean the existence.
>
> Here the story... a systemd service calls a command
> that creates a number kernel process/threads
> then the command exits.
>
> Is there a way for systemd to monitor those kernel process
> even though it was told nothing about them?
I assume you mean that systemd created the kernel threads (indirectly),
and you want *systemtap* to monitor them?
You can use probe kprocess.create, which will hit for all new tasks. It
runs in the context of the parent thread. You can see if "task->mm" is
NULL to tell if it's a kernel thread.
If you need to run without kernel debuginfo, it's about the same thing
at probe kernel.trace("sched_process_fork"), and check "$child->mm".
There's also probe kprocess.start for the first time a new thread is
scheduled onto a cpu. This might be more useful if you want to probe
from the context of that thread itself, rather than the parent. I'm not
aware of an equivalent
Telling whether a new kernel thread came about via systemd is a trickier
question. Probably need to probe something more specific to whatever
you're looking for.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: systemd and kernel process
2015-09-30 20:25 ` Josh Stone
@ 2015-09-30 20:52 ` Steve Dickson
0 siblings, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2015-09-30 20:52 UTC (permalink / raw)
To: Josh Stone, Systemtap List
Hello,
On 09/30/2015 04:25 PM, Josh Stone wrote:
> On 09/30/2015 11:54 AM, Steve Dickson wrote:
>> Hello,
>>
>> Is there a way for systemd to monitor kernel process?
>> By monitor I mean the existence.
>>
>> Here the story... a systemd service calls a command
>> that creates a number kernel process/threads
>> then the command exits.
>>
>> Is there a way for systemd to monitor those kernel process
>> even though it was told nothing about them?
>
> I assume you mean that systemd created the kernel threads (indirectly),
> and you want *systemtap* to monitor them?
My bad... I sent the email to the wrong list...
autofill is not my friend! :-)
>
> You can use probe kprocess.create, which will hit for all new tasks. It
> runs in the context of the parent thread. You can see if "task->mm" is
> NULL to tell if it's a kernel thread.
>
> If you need to run without kernel debuginfo, it's about the same thing
> at probe kernel.trace("sched_process_fork"), and check "$child->mm".
>
> There's also probe kprocess.start for the first time a new thread is
> scheduled onto a cpu. This might be more useful if you want to probe
> from the context of that thread itself, rather than the parent. I'm not
> aware of an equivalent
>
>
> Telling whether a new kernel thread came about via systemd is a trickier
> question. Probably need to probe something more specific to whatever
> you're looking for.
>
Again... I need to be able to do a systemctl status <whatever>
to see if the NFS kernel process are or are not running...
Sorry for the noise and thank you for your response!
steved.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-30 20:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-30 18:54 systemd and kernel process Steve Dickson
2015-09-30 20:25 ` Josh Stone
2015-09-30 20:52 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).