qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>,
	"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 01/11] trace: [tracetool] Explicitly identify public backends
Date: Thu, 28 Mar 2013 14:25:42 +0100	[thread overview]
Message-ID: <1364477152-26994-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1364477152-26994-1-git-send-email-stefanha@redhat.com>

From: Lluís Vilanova <vilanova@ac.upc.edu>

Public backends are those printed by "--list-backends" and thus considered valid
by the configure script.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 scripts/tracetool.py                  |  4 ++--
 scripts/tracetool/backend/__init__.py | 16 +++++++++++++++-
 scripts/tracetool/backend/dtrace.py   |  3 +++
 scripts/tracetool/backend/simple.py   |  4 ++++
 scripts/tracetool/backend/stderr.py   |  3 +++
 scripts/tracetool/backend/ust.py      |  3 +++
 6 files changed, 30 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 = arg
 
         elif opt == "--list-backends":
-            backends = tracetool.backend.get_list()
-            out(", ".join([ b for b,_ in backends ]))
+            public_backends = tracetool.backend.get_list(only_public = True)
+            out(", ".join([ b for b,_ in public_backends ]))
             sys.exit(0)
         elif opt == "--check-backend":
             check_backend = True
diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/backend/__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' routine.
 
 
+Backend attributes
+------------------
+
+========= ====================================================================
+Attribute Description
+========= ====================================================================
+PUBLIC    If exists and is set to 'True', the backend is considered "public".
+========= ====================================================================
+
+
 Backend functions
 -----------------
 
@@ -42,7 +52,7 @@ import os
 import tracetool
 
 
-def get_list():
+def get_list(only_public = False):
     """Get a list of (name, description) pairs."""
     res = [("nop", "Tracing disabled.")]
     modnames = []
@@ -57,6 +67,10 @@ def get_list():
             continue
         module = module[1]
 
+        public = getattr(module, "PUBLIC", False)
+        if only_public and not public:
+            continue
+
         doc = module.__doc__
         if doc is None:
             doc = ""
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index ad5eb3b..e31bc79 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -16,6 +16,9 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 from tracetool import out
 
 
+PUBLIC = True
+
+
 PROBEPREFIX = None
 
 def _probeprefix():
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index e4b4a7f..ac864f3 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -15,6 +15,10 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 
 from tracetool import out
 
+
+PUBLIC = True
+
+
 def is_string(arg):
     strtype = ('const char*', 'char*', 'const char *', 'char *')
     if arg.lstrip().startswith(strtype):
diff --git a/scripts/tracetool/backend/stderr.py b/scripts/tracetool/backend/stderr.py
index 917fde7..a10fbb8 100644
--- a/scripts/tracetool/backend/stderr.py
+++ b/scripts/tracetool/backend/stderr.py
@@ -16,6 +16,9 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 from tracetool import out
 
 
+PUBLIC = 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__      = "stefanha@linux.vnet.ibm.com"
 from tracetool import out
 
 
+PUBLIC = True
+
+
 def c(events):
     out('#include <ust/marker.h>',
         '#undef mutex_lock',
-- 
1.8.1.4

  reply	other threads:[~2013-03-28 13:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 13:25 [Qemu-devel] [PULL 00/11] Tracing patches Stefan Hajnoczi
2013-03-28 13:25 ` Stefan Hajnoczi [this message]
2013-03-28 13:25 ` [Qemu-devel] [PATCH 02/11] trace: Provide a generic tracing event descriptor Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 03/11] trace: Provide a detailed event control interface Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 04/11] trace: [monitor] Use new " Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 05/11] trace: [default] Port to generic event information and new " Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 06/11] trace: [simple] " Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 07/11] trace: [stderr] " Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 08/11] trace: rebuild generated-events.o when configuration changes Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 09/11] .gitignore: add trace/generated-events.[ch] Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 10/11] .gitignore: rename trace/generated-tracers.dtrace Stefan Hajnoczi
2013-03-28 13:25 ` [Qemu-devel] [PATCH 11/11] vl: add runstate_set tracepoint 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=1364477152-26994-2-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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).