From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhKj3-0005bM-Up for qemu-devel@nongnu.org; Tue, 28 May 2013 10:18:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhKit-0008HQ-Tf for qemu-devel@nongnu.org; Tue, 28 May 2013 10:18:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhKit-0008HI-LF for qemu-devel@nongnu.org; Tue, 28 May 2013 10:17:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4SEHwqC014765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 May 2013 10:17:58 -0400 Message-ID: <51A4BC8A.1070805@redhat.com> Date: Tue, 28 May 2013 16:17:46 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1369621146-17095-1-git-send-email-alevy@redhat.com> <51A2FE14.2050501@redhat.com> <1369742995.31959.1.camel@localhost> <51A4A079.4020603@redhat.com> <1369744385.31959.7.camel@localhost> <51A4A512.7050206@redhat.com> <2097579382.8902454.1369747513212.JavaMail.root@redhat.com> <1369749479.31959.10.camel@localhost> In-Reply-To: <1369749479.31959.10.camel@localhost> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org 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 >>>>> >>>>> >>>> >>>> >>> >>> >>> >> > >