public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "Stone, Joshua I" <joshua.i.stone@intel.com>
To: Mike Mason <mmlnx@us.ibm.com>
Cc: Perry Cheng <perryche@us.ibm.com>, systemtap@sources.redhat.com
Subject: Re: Instrumenting context-switching
Date: Wed, 31 Oct 2007 19:04:00 -0000	[thread overview]
Message-ID: <20071031173915.GA28295@jistone-expr.sc.intel.com> (raw)
In-Reply-To: <4728AE84.2090608@us.ibm.com>

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

  parent reply	other threads:[~2007-10-31 19:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 13:42 Perry Cheng
2007-10-31 16:34 ` Mike Mason
2007-10-31 16:48   ` Masami Hiramatsu
2007-10-31 19:04   ` Stone, Joshua I [this message]
2007-10-31 19:19     ` Stone, Joshua I

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071031173915.GA28295@jistone-expr.sc.intel.com \
    --to=joshua.i.stone@intel.com \
    --cc=mmlnx@us.ibm.com \
    --cc=perryche@us.ibm.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).