public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: fche@redhat.com (Frank Ch. Eigler)
Cc: dcnltc@us.ibm.com, systemtap@sourceware.org
Subject: Re: user instruction tracing patch?
Date: Wed, 14 Nov 2007 21:59:00 -0000	[thread overview]
Message-ID: <20071114215940.5A0DB26F8B6@magilla.localdomain> (raw)
In-Reply-To: Frank Ch. Eigler's message of  Wednesday, 14 November 2007 16:27:57 -0500 <y0mzlxg4iw2.fsf@ton.toronto.redhat.com>

> Since utrace will provide the pt_regs structure, the probe handler
> bodies will be able to call e.g. backtrace(), probefunc(), and really
> should have some structured access to the registers (a new tapset
> function like register:long ("name") ?)

In general to access all registers you can't always use pt_regs directly;
the details vary by machine.  You can get many of them on the common
machines (x86, ppc).  A simple embedded-C tapset approach for each machine
is certainly an easy place to start.  For full generality, you'll need to
use the formal utrace_regset interfaces instead.  The elfutils libraries
have full information on mapping register names and DWARF numbers to the
formats these interfaces expose, though they could use more sugar.  There
is a variety of ways you could use that info in the translator to expose
register access to the script language.

>   probe process(PID).itrace if (condition) { }

So this is special syntax constrained to just testing a script variable?
Or it's any complex expression reducible to only reading global script
variables?  Or what exactly?  

I like this syntax when it's just a general thing for skipping out probe
hits.  (In fact, you can call it awk and say it's really just a
one-statement probe body since {...} is just a statement.)  

But when its real use is to cause acts that change the value of evaluating
the condition to hook into immediately changing the state of low-level
tracing features that produce the probe hits, then I want to know exactly
what the language semantics guarantees about the timely control of that state.

>   probe process(PID).function("NAME") { condition = 1 }
>   probe process(PID).function("NAME").return { condition = 0 }

For likely answers to my first question, doesn't seem much different from
an explicit enable/disable command, just more obscure when reading the script.
If the variable is not otherwise used, wouldn't that compile to the same as:

    probe process(PID).function("NAME") { enable process(PID).itrace; }
    probe process(PID).function("NAME").return { disable process(PID).itrace; }

or whatever syntax explicit enable/disable has?


Thanks,
Roland

  reply	other threads:[~2007-11-14 21:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 17:58 Dave Nomura
2007-11-14 21:29 ` Frank Ch. Eigler
2007-11-14 21:59   ` Roland McGrath [this message]
2007-11-14 23:17     ` Frank Ch. Eigler
2007-11-14 23:39       ` Roland McGrath
2007-11-15  3:59         ` Frank Ch. Eigler
2007-11-16  0:04           ` Jim Keniston
2007-11-16 17:18             ` Frank Ch. Eigler
2007-11-16 18:36               ` Jim Keniston
2007-11-16 19:21                 ` Frank Ch. Eigler
2007-11-16 20:20                   ` Jim Keniston
2007-11-16 20:29                     ` Roland McGrath
2007-11-16 20:38                     ` Frank Ch. Eigler
2007-11-16 21:08                       ` Jim Keniston
2007-11-16 21:25                         ` Frank Ch. Eigler
2007-11-16 21:51                           ` Jim Keniston
2007-11-16 22:23                             ` Frank Ch. Eigler
2007-11-27 14:13                               ` Dave Nomura
2007-11-27 15:14                                 ` Frank Ch. Eigler
2007-12-03 18:09                                   ` Dave Nomura
2007-12-10 18:00                                     ` Frank Ch. Eigler
2008-02-04 16:58                                       ` Dave Nomura
2008-03-10 18:49   ` Dave Nomura
2008-03-17 15:16     ` Frank Ch. Eigler
     [not found]       ` <47E157A8.3010508@us.ibm.com>
2008-03-19 18:42         ` Frank Ch. Eigler

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=20071114215940.5A0DB26F8B6@magilla.localdomain \
    --to=roland@redhat.com \
    --cc=dcnltc@us.ibm.com \
    --cc=fche@redhat.com \
    --cc=systemtap@sourceware.org \
    /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).