From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22813 invoked by alias); 30 Sep 2015 20:52:01 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 22800 invoked by uid 89); 30 Sep 2015 20:52:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 30 Sep 2015 20:52:00 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1BF6C8EA4A for ; Wed, 30 Sep 2015 20:51:59 +0000 (UTC) Received: from smallhat.boston.devel.redhat.com (vpn-62-110.rdu2.redhat.com [10.10.62.110]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8UKpwZe014199; Wed, 30 Sep 2015 16:51:58 -0400 Subject: Re: systemd and kernel process To: Josh Stone , Systemtap List References: <560C2FDB.9000709@RedHat.com> <560C453D.8060207@redhat.com> From: Steve Dickson Message-ID: <560C4B6D.3090707@RedHat.com> Date: Wed, 30 Sep 2015 20:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560C453D.8060207@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-q3/txt/msg00158.txt.bz2 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 to see if the NFS kernel process are or are not running... Sorry for the noise and thank you for your response! steved.