From: Alon Levy <alevy@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
Date: Tue, 28 May 2013 09:57:59 -0400 [thread overview]
Message-ID: <1369749479.31959.10.camel@localhost> (raw)
In-Reply-To: <2097579382.8902454.1369747513212.JavaMail.root@redhat.com>
On Tue, 2013-05-28 at 09:25 -0400, Alon Levy wrote:
> > Il 28/05/2013 14:33, Alon Levy ha scritto:
> > > On Tue, 2013-05-28 at 14:18 +0200, Paolo Bonzini wrote:
> > >> Il 28/05/2013 14:09, Alon Levy ha scritto:
> > >>>>> + --probe-prefix=qemu.local \
> > >>>>
> > >>>> Why change the prefix?
Actually the problem is having two stp files (qemu-system-x86_64.stp &
qemu-system-x86_64.local.stp) in the same directory providing the same
probes is not workable with stap. In pass 2 it doesn't have any specific
order of going through the directory. Solutions
1. have a different prefix
2. introduce another subdirectory
x86_64-softmmu/local.stp/qemu-system-x86_64.stp
> > >>>
> > >>> It was one way to verify I was using the correct file. I'll change it
> > >>> back.
> > >>>
> > >>> But in general does it make sense for you to have this in addition to
> > >>> the existing stp file?
> > >>
> > >> I think it does (with the same prefix so that you can share the
> > >> scripts). But I'm not sure how you'd use it. :) Can you show an
> > >> example and also put it in the commit message?
> > >
> > > I though it would be useful to have a bunch of scripts for developers. I
> > > have the following (didn't fix yet to use the same prefix):
> >
> > Ok, so it's just a matter of using the -I option to stap. That's the
> > bit that has to be in the commit message.
>
> Yes. Note that you add a directory, not a file. The only sure way to notice which hooks were used I found is looking at the generated c file.
>
> >
> > Thanks!
> >
> > Paolo
> >
> > > diff --git a/scripts/stap-qxl-generic b/scripts/stap-qxl-generic
> > > new file mode 100755
> > > index 0000000..1c21911
> > > --- /dev/null
> > > +++ b/scripts/stap-qxl-generic
> > > @@ -0,0 +1,4 @@
> > > +#!/bin/bash -x
> > > +STP=$0.stp
> > > +ROOT=`dirname $0`/../
> > > +sudo stap -v -I $ROOT/x86_64-softmmu $STP
> > > diff --git a/scripts/stap-qxl-generic.stp b/scripts/stap-qxl-generic.stp
> > > new file mode 100644
> > > index 0000000..e201e69
> > > --- /dev/null
> > > +++ b/scripts/stap-qxl-generic.stp
> > > @@ -0,0 +1,24 @@
> > > +probe begin { printf("starting qxl generic probe\n") }
> > > +
> > > +global call, threads
> > > +
> > > +probe qemu.local.qxl* {
> > > + //printf("%d: %s: %s\n", tid(), pp(), $$vars)
> > > + //print_ubacktrace()
> > > + call[tid(), probefunc()] <<< 1
> > > + threads[tid()] <<< 1
> > > +}
> > > +
> > > +probe timer.s(%( $# > 0 %? $1 %: 5 %)) {
> > > + ansi_clear_screen()
> > > + printf("%10s %45s %s\n", "TID", "", "HITS");
> > > + foreach([t] in threads-) {
> > > + printf("%10d %45s %d\n", t, "", @count(threads[t]));
> > > + }
> > > + printf("%10s %45s %s\n",
> > > + "TID", "CALL", "HITS")
> > > + foreach([tid, name] in call-) {
> > > + printf("%10d %45s %d\n", tid, name,
> > > + @count(call[tid, name]))
> > > + }
> > > +}
> > >
> > >
> > >>
> > >> Paolo
> > >>
> > >>
> > >
> > >
> >
> >
> >
>
next prev parent reply other threads:[~2013-05-28 13:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-27 2:19 [Qemu-devel] [RFC] Add a stp file for usage from build directory Alon Levy
2013-05-27 6:32 ` Paolo Bonzini
2013-05-28 12:09 ` Alon Levy
2013-05-28 12:18 ` Paolo Bonzini
2013-05-28 12:33 ` Alon Levy
2013-05-28 12:37 ` Paolo Bonzini
2013-05-28 13:25 ` Alon Levy
2013-05-28 13:57 ` Alon Levy [this message]
2013-05-28 14:17 ` Paolo Bonzini
2013-05-28 15:24 ` Stefan Hajnoczi
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=1369749479.31959.10.camel@localhost \
--to=alevy@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).