This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Killing staprun/stapio cleanly from another process


On Mon, 2007-09-17 at 14:11 -0400, Frank Ch. Eigler wrote:
> Mike Mason <mmlnx@us.ibm.com> writes:
> 
> > [...]  So if I fork/exec staprun from a program, then want to kill
> > staprun/stapio from that same program, how can I do it?  I only have
> > staprun's pid. [...]
> 
> Try sending the signal to the process group (negative of staprun pid).

That only works if you ran staprun.  If you ran stap, you need to use
the negative of stap's pid.  In other words you need the negative of the
pgid which is the pid of the process group leader.    You can get the
pgid for any pid by looking at /proc/{pid}/stat.  5th field is pgid.

An alternative for controlling stapio would be to use the new procfs
interface, which is so new we don't have docs checked in yet.

Martin



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]