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/

Reply via email to