summaryrefslogtreecommitdiff
path: root/scripts/tracetool
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2013-03-05 14:47:26 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-28 14:19:57 +0100
commit93fba1618ddbbef8bedd8d684cf356586c94bbb1 (patch)
tree613b841320e0754da3046d7cbc6698c537e96cb2 /scripts/tracetool
parente280ff5e9159ed227a117339c1157143627cab96 (diff)
downloadqemu-93fba1618ddbbef8bedd8d684cf356586c94bbb1.zip
trace: [tracetool] Explicitly identify public backends
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>
Diffstat (limited to 'scripts/tracetool')
-rw-r--r--scripts/tracetool/backend/__init__.py16
-rw-r--r--scripts/tracetool/backend/dtrace.py3
-rw-r--r--scripts/tracetool/backend/simple.py4
-rw-r--r--scripts/tracetool/backend/stderr.py3
-rw-r--r--scripts/tracetool/backend/ust.py3
5 files changed, 28 insertions, 1 deletions
diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/backend/__init__.py
index be43472f7b..f0314ee376 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 ad5eb3b0ab..e31bc799f8 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 e4b4a7f05d..ac864f38ce 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 917fde7c15..a10fbb83f4 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 31a2ff0404..ea36995092 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',