Re: [BUG] scheduler: first timeslice of the exiting thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
 *
 * 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux