From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23024 invoked by alias); 31 Oct 2007 19:04:29 -0000 Received: (qmail 23015 invoked by uid 22791); 31 Oct 2007 19:04:28 -0000 X-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SUBJ_HAS_UNIQ_ID X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 Oct 2007 19:04:24 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 31 Oct 2007 12:04:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.21,352,1188802800"; d="scan'208";a="309060567" Received: from jistone-expr.sc.intel.com ([172.25.115.17]) by azsmga001.ch.intel.com with ESMTP; 31 Oct 2007 12:04:22 -0700 Received: from jistone-expr.sc.intel.com (localhost.localdomain [127.0.0.1]) by jistone-expr.sc.intel.com (8.13.8/8.13.8) with ESMTP id l9VHdFUf028397; Wed, 31 Oct 2007 10:39:15 -0700 Received: (from jistone@localhost) by jistone-expr.sc.intel.com (8.13.8/8.13.8/Submit) id l9VHdFvk028396; Wed, 31 Oct 2007 10:39:15 -0700 X-Authentication-Warning: jistone-expr.sc.intel.com: jistone set sender to joshua.i.stone@intel.com using -f Date: Wed, 31 Oct 2007 19:04:00 -0000 From: "Stone, Joshua I" To: Mike Mason Cc: Perry Cheng , systemtap@sources.redhat.com Subject: Re: Instrumenting context-switching Message-ID: <20071031173915.GA28295@jistone-expr.sc.intel.com> References: <4728AE84.2090608@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4728AE84.2090608@us.ibm.com> User-Agent: Mutt/1.4.2.2i X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00268.txt.bz2 Mike Mason wrote: > The scheduler tapset probes context_switch() on x86_64, but that doesn't > help much. context_switch() is an inline and, thus, the entry parameters > prev and next aren't accessible via SystemTap. You can still effectively get prev and next if you use a pair of probes. A probe at the beginning of context_switch is still on the old thread, so current == prev. A probe on finish_task_switch is in the context of the new thread, so current == next. You can access various fields in current by using the context.stp tapset, or use task_current() to get the actual task_struct pointer. These functions are used for scheduler.cpu_off and scheduler.cpu_off, since they are architecture-independent locations in the scheduler. Josh