public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Perry Cheng <perryche@us.ibm.com>
To: systemtap@sources.redhat.com
Subject: Instrumenting context-switching
Date: Wed, 31 Oct 2007 13:42:00 -0000	[thread overview]
Message-ID: <OFC86D8062.3754ED5D-ON85257385.004AC02A-85257385.004B48D4@us.ibm.com> (raw)

Instrumenting the context switch code has long been delicate.   I can't 
seem to find any help on this particular topic on the wiki (specifically, 
the examples).

In the past, following some hints from old docs and mailing list, it has 
been enough to instrument the __switch_to method to get the prev and next 
tasks.  The method one level higher is switch_to which, being a macro, is 
not instrumentable.  Lately, I've switched from an older i386 kernel to a 
new x86_64 kernel and now __switch_to no longer is instrumentable with 
kprobes.   The higher-level context_switch itself does not seem probe-able 
because it is a static inline method.  Even higherup, we have the call to 
context_switch from schedule but instrumenting that would require using a 
specific line number which seems rather fragile because of greater 
reliance of debugging code and susceptibility to kernel code change.

So, on an x86_64 kernel, how do I instrument this method?

Perry

             reply	other threads:[~2007-10-31 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31 13:42 Perry Cheng [this message]
2007-10-31 16:34 ` Mike Mason
2007-10-31 16:48   ` Masami Hiramatsu
2007-10-31 19:04   ` Stone, Joshua I
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=OFC86D8062.3754ED5D-ON85257385.004AC02A-85257385.004B48D4@us.ibm.com \
    --to=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).