lkml.org 
[lkml]   [2007]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUG] scheduler: first timeslice of the exiting thread
At Sat, 07 Apr 2007 16:31:39 +0900,
Satoru Takeuchi wrote:
> Test programs(attached in the mail):
>
> - satprocess.c: Process model. It creates a child process and wait for it
> several times. Each child process exits immediately.
> - satthread.c: Thread model. It creates a child thread and join it several
> times. Each child thread exits immediately.
> - fork_exit.stp: systemtap script to overlook satprocess/satthread

Oh, I sent a old systemtap script. Correct one is here.

Satoru

/// fork_exit.stp /////////////////////////////////////////////////////////////
/*
* fork_exit.stp - Overlooks sched_fork()/exit_exit() for satprocess/satthread
* and prints some information
*
* Copyright (C) 2007 Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*/

function is_my_testpro(comm)
{
if (comm == "satthread" || comm == "satprocess")
return 1
else
return 0
}

function print_log(name, pid, tgid, ppid, time_slice)
{
printf("%s: pid = %d, tgid = %d, ppid = %d, time_slice = %u\n",
name, pid, tgid, ppid, time_slice);
}

probe kernel.function("sched_fork")
{
if (is_my_testpro(kernel_string($p->comm)))
print_log("fork",
$p->pid, $p->tgid, $p->parent->pid, $p->time_slice);
}

probe kernel.function("sched_exit")
{
if (is_my_testpro(kernel_string($p->comm)))
print_log("exit",
$p->pid, $p->tgid, $p->parent->pid, $p->time_slice);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-07 09:51    [W:0.341 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site