* [Qemu-devel] [RFC] Add a stp file for usage from build directory
@ 2013-05-27 2:19 Alon Levy
2013-05-27 6:32 ` Paolo Bonzini
0 siblings, 1 reply; 10+ messages in thread
From: Alon Levy @ 2013-05-27 2:19 UTC (permalink / raw)
To: qemu-devel
For systemtap the location of the process being tapped is crucial, so
the existing stp file requires installation to use. A new file providing
qemu.local prefixed probes lets scripts run without an install step.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
Makefile.target | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/Makefile.target b/Makefile.target
index ce4391f..5d176e2 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -35,7 +35,7 @@ config-target.h: config-target.h-timestamp
config-target.h-timestamp: config-target.mak
ifdef CONFIG_TRACE_SYSTEMTAP
-stap: $(QEMU_PROG).stp
+stap: $(QEMU_PROG).stp $(QEMU_PROG).local.stp
ifdef CONFIG_USER_ONLY
TARGET_TYPE=user
@@ -51,6 +51,17 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events
--target-arch=$(TARGET_ARCH) \
--target-type=$(TARGET_TYPE) \
< $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
+
+$(QEMU_PROG).local.stp: $(SRC_PATH)/trace-events
+ $(call quiet-command,$(TRACETOOL) \
+ --format=stap \
+ --backend=$(TRACE_BACKEND) \
+ --binary=$(SRC_PATH)/$(TARGET_DIR)$(QEMU_PROG) \
+ --probe-prefix=qemu.local \
+ --target-arch=$(TARGET_ARCH) \
+ --target-type=$(TARGET_TYPE) \
+ < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).local.stp")
+
else
stap:
endif
--
1.8.2.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
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
0 siblings, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2013-05-27 6:32 UTC (permalink / raw)
To: Alon Levy; +Cc: qemu-devel
Il 27/05/2013 04:19, Alon Levy ha scritto:
> For systemtap the location of the process being tapped is crucial, so
> the existing stp file requires installation to use. A new file providing
> qemu.local prefixed probes lets scripts run without an install step.
>
> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>
> Makefile.target | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index ce4391f..5d176e2 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -35,7 +35,7 @@ config-target.h: config-target.h-timestamp
> config-target.h-timestamp: config-target.mak
>
> ifdef CONFIG_TRACE_SYSTEMTAP
> -stap: $(QEMU_PROG).stp
> +stap: $(QEMU_PROG).stp $(QEMU_PROG).local.stp
>
> ifdef CONFIG_USER_ONLY
> TARGET_TYPE=user
> @@ -51,6 +51,17 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events
> --target-arch=$(TARGET_ARCH) \
> --target-type=$(TARGET_TYPE) \
> < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
> +
> +$(QEMU_PROG).local.stp: $(SRC_PATH)/trace-events
> + $(call quiet-command,$(TRACETOOL) \
> + --format=stap \
> + --backend=$(TRACE_BACKEND) \
> + --binary=$(SRC_PATH)/$(TARGET_DIR)$(QEMU_PROG) \
This is not the build directory for out-of-tree builds.
> + --probe-prefix=qemu.local \
Why change the prefix?
Paolo
> + --target-arch=$(TARGET_ARCH) \
> + --target-type=$(TARGET_TYPE) \
> + < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).local.stp")
> +
> else
> stap:
> endif
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-27 6:32 ` Paolo Bonzini
@ 2013-05-28 12:09 ` Alon Levy
2013-05-28 12:18 ` Paolo Bonzini
2013-05-28 15:24 ` Stefan Hajnoczi
0 siblings, 2 replies; 10+ messages in thread
From: Alon Levy @ 2013-05-28 12:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Mon, 2013-05-27 at 08:32 +0200, Paolo Bonzini wrote:
> Il 27/05/2013 04:19, Alon Levy ha scritto:
> > For systemtap the location of the process being tapped is crucial, so
> > the existing stp file requires installation to use. A new file providing
> > qemu.local prefixed probes lets scripts run without an install step.
> >
> > Signed-off-by: Alon Levy <alevy@redhat.com>
> > ---
> >
> > Makefile.target | 13 ++++++++++++-
> > 1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/Makefile.target b/Makefile.target
> > index ce4391f..5d176e2 100644
> > --- a/Makefile.target
> > +++ b/Makefile.target
> > @@ -35,7 +35,7 @@ config-target.h: config-target.h-timestamp
> > config-target.h-timestamp: config-target.mak
> >
> > ifdef CONFIG_TRACE_SYSTEMTAP
> > -stap: $(QEMU_PROG).stp
> > +stap: $(QEMU_PROG).stp $(QEMU_PROG).local.stp
> >
> > ifdef CONFIG_USER_ONLY
> > TARGET_TYPE=user
> > @@ -51,6 +51,17 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events
> > --target-arch=$(TARGET_ARCH) \
> > --target-type=$(TARGET_TYPE) \
> > < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
> > +
> > +$(QEMU_PROG).local.stp: $(SRC_PATH)/trace-events
> > + $(call quiet-command,$(TRACETOOL) \
> > + --format=stap \
> > + --backend=$(TRACE_BACKEND) \
> > + --binary=$(SRC_PATH)/$(TARGET_DIR)$(QEMU_PROG) \
>
> This is not the build directory for out-of-tree builds.
I'll fix that.
>
> > + --probe-prefix=qemu.local \
>
> Why change the prefix?
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?
>
> Paolo
>
> > + --target-arch=$(TARGET_ARCH) \
> > + --target-type=$(TARGET_TYPE) \
> > + < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).local.stp")
> > +
> > else
> > stap:
> > endif
> >
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 12:09 ` Alon Levy
@ 2013-05-28 12:18 ` Paolo Bonzini
2013-05-28 12:33 ` Alon Levy
2013-05-28 15:24 ` Stefan Hajnoczi
1 sibling, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2013-05-28 12:18 UTC (permalink / raw)
To: Alon Levy; +Cc: qemu-devel
Il 28/05/2013 14:09, Alon Levy ha scritto:
>>> + --probe-prefix=qemu.local \
>>
>> Why change the prefix?
>
> 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?
Paolo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 12:18 ` Paolo Bonzini
@ 2013-05-28 12:33 ` Alon Levy
2013-05-28 12:37 ` Paolo Bonzini
0 siblings, 1 reply; 10+ messages in thread
From: Alon Levy @ 2013-05-28 12:33 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
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?
> >
> > 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):
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
>
>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 12:33 ` Alon Levy
@ 2013-05-28 12:37 ` Paolo Bonzini
2013-05-28 13:25 ` Alon Levy
0 siblings, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2013-05-28 12:37 UTC (permalink / raw)
To: Alon Levy; +Cc: qemu-devel
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?
>>>
>>> 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.
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
>>
>>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 12:37 ` Paolo Bonzini
@ 2013-05-28 13:25 ` Alon Levy
2013-05-28 13:57 ` Alon Levy
0 siblings, 1 reply; 10+ messages in thread
From: Alon Levy @ 2013-05-28 13:25 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
> 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?
> >>>
> >>> 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
> >>
> >>
> >
> >
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 13:25 ` Alon Levy
@ 2013-05-28 13:57 ` Alon Levy
2013-05-28 14:17 ` Paolo Bonzini
0 siblings, 1 reply; 10+ messages in thread
From: Alon Levy @ 2013-05-28 13:57 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
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
> > >>
> > >>
> > >
> > >
> >
> >
> >
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 13:57 ` Alon Levy
@ 2013-05-28 14:17 ` Paolo Bonzini
0 siblings, 0 replies; 10+ messages in thread
From: Paolo Bonzini @ 2013-05-28 14:17 UTC (permalink / raw)
To: Alon Levy; +Cc: qemu-devel
Il 28/05/2013 15:57, Alon Levy ha scritto:
> 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
Ah... that's a bit ugly. What about changing the name of the
"installed" .stp file, for example
x86_64-softmmu/qemu-system-x86_64.stp-installed and renaming it at "make
install" time? The local file instead is built as
x86_64-softmmu/qemu-system-x86_64.stp and is the only one that -I finds.
Paolo
>
>>>>>>
>>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory
2013-05-28 12:09 ` Alon Levy
2013-05-28 12:18 ` Paolo Bonzini
@ 2013-05-28 15:24 ` Stefan Hajnoczi
1 sibling, 0 replies; 10+ messages in thread
From: Stefan Hajnoczi @ 2013-05-28 15:24 UTC (permalink / raw)
To: Alon Levy; +Cc: Paolo Bonzini, qemu-devel
On Tue, May 28, 2013 at 08:09:55AM -0400, Alon Levy wrote:
> On Mon, 2013-05-27 at 08:32 +0200, Paolo Bonzini wrote:
> > Il 27/05/2013 04:19, Alon Levy ha scritto:
> > > For systemtap the location of the process being tapped is crucial, so
> > > the existing stp file requires installation to use. A new file providing
> > > qemu.local prefixed probes lets scripts run without an install step.
> > >
> > > Signed-off-by: Alon Levy <alevy@redhat.com>
> > > ---
> > >
> > > Makefile.target | 13 ++++++++++++-
> > > 1 file changed, 12 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Makefile.target b/Makefile.target
> > > index ce4391f..5d176e2 100644
> > > --- a/Makefile.target
> > > +++ b/Makefile.target
> > > @@ -35,7 +35,7 @@ config-target.h: config-target.h-timestamp
> > > config-target.h-timestamp: config-target.mak
> > >
> > > ifdef CONFIG_TRACE_SYSTEMTAP
> > > -stap: $(QEMU_PROG).stp
> > > +stap: $(QEMU_PROG).stp $(QEMU_PROG).local.stp
> > >
> > > ifdef CONFIG_USER_ONLY
> > > TARGET_TYPE=user
> > > @@ -51,6 +51,17 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events
> > > --target-arch=$(TARGET_ARCH) \
> > > --target-type=$(TARGET_TYPE) \
> > > < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
> > > +
> > > +$(QEMU_PROG).local.stp: $(SRC_PATH)/trace-events
> > > + $(call quiet-command,$(TRACETOOL) \
> > > + --format=stap \
> > > + --backend=$(TRACE_BACKEND) \
> > > + --binary=$(SRC_PATH)/$(TARGET_DIR)$(QEMU_PROG) \
> >
> > This is not the build directory for out-of-tree builds.
>
> I'll fix that.
>
> >
> > > + --probe-prefix=qemu.local \
> >
> > Why change the prefix?
>
> 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?
Yes, I think it makes sense.
Stefan
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-05-28 15:25 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-05-28 14:17 ` Paolo Bonzini
2013-05-28 15:24 ` Stefan Hajnoczi
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).