Received: from eggs.gnu.org ([208.118.235.92]:48070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlYc-0006xM-UZ for qemu-devel@nongnu.org; Tue, 08 May 2012 10:38:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRlYV-00015s-E1 for qemu-devel@nongnu.org; Tue, 08 May 2012 10:38:30 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:34193 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlYV-00012v-3i for qemu-devel@nongnu.org; Tue, 08 May 2012 10:38:23 -0400 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id q48EcLSm029843 for ; Tue, 8 May 2012 16:38:21 +0200 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id EBF156B006A for ; Tue, 8 May 2012 16:38:20 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 8 May 2012 16:38:20 +0200 Message-Id: <20120508143820.18271.25000.stgit@fimbulvetr.bsc.es> In-Reply-To: <20120508143813.18271.15731.stgit@fimbulvetr.bsc.es> References: <20120508143813.18271.15731.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 1/7] tracetool: Explicitly identify public backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public backends are those printed by "--list-backends" and thus considere= d valid by the configure script. Signed-off-by: Llu=C3=ADs Vilanova --- scripts/tracetool.py | 4 ++-- scripts/tracetool/backend/__init__.py | 16 +++++++++++++++- scripts/tracetool/backend/dtrace.py | 3 +++ scripts/tracetool/backend/simple.py | 3 +++ scripts/tracetool/backend/stderr.py | 3 +++ scripts/tracetool/backend/ust.py | 3 +++ 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index c003cf6..a79ec0f 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -90,8 +90,8 @@ def main(args): arg_format =3D arg =20 elif opt =3D=3D "--list-backends": - backends =3D tracetool.backend.get_list() - out(", ".join([ b for b,_ in backends ])) + public_backends =3D tracetool.backend.get_list(only_public =3D= True) + out(", ".join([ b for b,_ in public_backends ])) sys.exit(0) elif opt =3D=3D "--check-backend": check_backend =3D True diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/ba= ckend/__init__.py index be43472..f0314ee 100644 --- a/scripts/tracetool/backend/__init__.py +++ b/scripts/tracetool/backend/__init__.py @@ -17,6 +17,16 @@ considered its short description. All backends must generate their contents through the 'tracetool.out' ro= utine. =20 =20 +Backend attributes +------------------ + +=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D +Attribute Description +=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D +PUBLIC If exists and is set to 'True', the backend is considered "pub= lic". +=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + + Backend functions ----------------- =20 @@ -42,7 +52,7 @@ import os import tracetool =20 =20 -def get_list(): +def get_list(only_public =3D False): """Get a list of (name, description) pairs.""" res =3D [("nop", "Tracing disabled.")] modnames =3D [] @@ -57,6 +67,10 @@ def get_list(): continue module =3D module[1] =20 + public =3D getattr(module, "PUBLIC", False) + if only_public and not public: + continue + doc =3D module.__doc__ if doc is None: doc =3D "" diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/back= end/dtrace.py index 9cab75c..5bcf513 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -16,6 +16,9 @@ __email__ =3D "stefanha@linux.vnet.ibm.com" from tracetool import out =20 =20 +PUBLIC =3D True + + PROBEPREFIX =3D None =20 def _probeprefix(): diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/back= end/simple.py index fbb5717..9a4f512 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -16,6 +16,9 @@ __email__ =3D "stefanha@linux.vnet.ibm.com" from tracetool import out =20 =20 +PUBLIC =3D True + + def c(events): out('#include "trace.h"', '', diff --git a/scripts/tracetool/backend/stderr.py b/scripts/tracetool/back= end/stderr.py index 917fde7..a10fbb8 100644 --- a/scripts/tracetool/backend/stderr.py +++ b/scripts/tracetool/backend/stderr.py @@ -16,6 +16,9 @@ __email__ =3D "stefanha@linux.vnet.ibm.com" from tracetool import out =20 =20 +PUBLIC =3D True + + def c(events): out('#include "trace.h"', '', diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend= /ust.py index 31a2ff0..ea36995 100644 --- a/scripts/tracetool/backend/ust.py +++ b/scripts/tracetool/backend/ust.py @@ -16,6 +16,9 @@ __email__ =3D "stefanha@linux.vnet.ibm.com" from tracetool import out =20 =20 +PUBLIC =3D True + + def c(events): out('#include ', '#undef mutex_lock',