public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: Stan Cox <scox@redhat.com>
Cc: systemtap@sourceware.org
Subject: Re: new static user probe types
Date: Wed, 22 Jul 2009 10:42:00 -0000	[thread overview]
Message-ID: <1248259327.7890.29.camel@springer.wildebeest.org> (raw)
In-Reply-To: <4A64B8AF.6030304@redhat.com>

On Mon, 2009-07-20 at 14:34 -0400, Stan Cox wrote:
> I did some tweaking and a bit more testing.  Running a program which 
> invokes a probe in a loop.  Invoked via stap running a script with only 
> a begin in it.
> utrace 0.71user 0.34system 0:01.10elapsed # probe is a syscall, no arg setup
> kprobe 0.72user 0.33system 0:01.09elapsed # probe is a syscall, no arg setup
> uprobe 0.57user 0.09system 0:00.68elapsed # probe is a nop, possibly 
> also arg setup

So uprobes is the clear winner for almost zero-overhead when disabled.

> Invoked via stap running a script which actually has handlers for the probes
> utrace 0.82user 4.28system 0:05.17elapsed
> kprobe 1.59user 5.18system 0:08.50elapsed
> uprobe 1.17user 11.12system 0:12.35elapsed

But it has the largest overhead when enabled. Clearly we want the uprobe
mechanism when probes are disabled, but the utrace mechanism when probes
are enabled!

Would it be possible to change the uprobes mechanism for inserting trap
instructions to insert any instructions (sequence)?

Then we could have the best of both worlds, or could even decide at
runtime what to insert to when the probe gets enabled.

You would make sure that there are enough nops in the place of the probe
point for the instruction sequence you want to replace and then the
uprobes insert instruction mechanism would (after checking it had enough
nop space) insert the instruction sequence (preferable the one used by
the utrace mechanism).

It would also help with implementing the idea for the ENABLED mechanism
idea suggested in
http://sourceware.org/bugzilla/show_bug.cgi?id=10013#c2
but there you would replace a specific instruction with another (the
inserting mechanism should check of course).

So, it might be a bit like what Srikar posted to utrace-devel:
https://www.redhat.com/archives/utrace-devel/2009-June/msg00018.html
But with the Ubp (ubp_bkpt insn) replaced with inserting of an
"arbitrary" instruction instead of a trap (and possibly a check that the
instruction being replaced is the intended one). And without the need
for Ssol in that case.

Cheers,

Mark

  reply	other threads:[~2009-07-22 10:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26 21:26 Stan Cox
2009-07-15 16:19 ` Stan Cox
2009-07-15 18:39   ` Josh Stone
2009-07-15 20:47     ` Stan Cox
2009-07-15 21:57       ` Josh Stone
2009-07-16 13:44         ` Stan Cox
2009-07-20 18:34   ` Stan Cox
2009-07-22 10:42     ` Mark Wielaard [this message]
2009-07-22 14:39       ` Frank Ch. Eigler
2009-07-22 17:10         ` Mark Wielaard
2009-07-29 15:44           ` Stan Cox
2009-07-29 15:51             ` Stan Cox
2009-07-23  3:07       ` Roland McGrath
2009-07-23 10:28         ` Mark Wielaard
2009-07-23 14:40           ` Frank Ch. Eigler
2009-07-23 19:33           ` Roland McGrath

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=1248259327.7890.29.camel@springer.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=scox@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).