From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965475AbXDGHrr (ORCPT ); Sat, 7 Apr 2007 03:47:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965480AbXDGHrr (ORCPT ); Sat, 7 Apr 2007 03:47:47 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:52434 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965475AbXDGHrq (ORCPT ); Sat, 7 Apr 2007 03:47:46 -0400 Date: Sat, 07 Apr 2007 16:45:55 +0900 Message-ID: <876488zky4.wl%takeuchi_satoru@jp.fujitsu.com> From: Satoru Takeuchi To: Ingo Molnar , Linux Kernel Cc: Satoru Takeuchi Subject: Re: [BUG] scheduler: first timeslice of the exiting thread In-Reply-To: <877isozllw.wl%takeuchi_satoru@jp.fujitsu.com> References: <877isozllw.wl%takeuchi_satoru@jp.fujitsu.com> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/21.4 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 * * 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); }