From patchwork Tue May 28 12:33:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 246856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 900ED2C0319 for ; Tue, 28 May 2013 22:33:40 +1000 (EST) Received: from localhost ([::1]:44613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhJ5u-0003ZL-QI for incoming@patchwork.ozlabs.org; Tue, 28 May 2013 08:33:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhJ5W-0003Yr-Qy for qemu-devel@nongnu.org; Tue, 28 May 2013 08:33:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhJ5R-0008UY-4r for qemu-devel@nongnu.org; Tue, 28 May 2013 08:33:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhJ5Q-0008UJ-Tt for qemu-devel@nongnu.org; Tue, 28 May 2013 08:33:09 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4SCX8wO029209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 May 2013 08:33:08 -0400 Received: from [10.36.7.94] (vpn1-7-94.ams2.redhat.com [10.36.7.94]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4SCX6bW013051; Tue, 28 May 2013 08:33:06 -0400 Message-ID: <1369744385.31959.7.camel@localhost> From: Alon Levy To: Paolo Bonzini Date: Tue, 28 May 2013 08:33:05 -0400 In-Reply-To: <51A4A079.4020603@redhat.com> References: <1369621146-17095-1-git-send-email-alevy@redhat.com> <51A2FE14.2050501@redhat.com> <1369742995.31959.1.camel@localhost> <51A4A079.4020603@redhat.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [RFC] Add a stp file for usage from build directory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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): > > 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])) + } +}