mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
e280ff5e91
commit
93fba1618d
6 changed files with 30 additions and 3 deletions
|
@ -90,8 +90,8 @@ def main(args):
|
||||||
arg_format = arg
|
arg_format = arg
|
||||||
|
|
||||||
elif opt == "--list-backends":
|
elif opt == "--list-backends":
|
||||||
backends = tracetool.backend.get_list()
|
public_backends = tracetool.backend.get_list(only_public = True)
|
||||||
out(", ".join([ b for b,_ in backends ]))
|
out(", ".join([ b for b,_ in public_backends ]))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif opt == "--check-backend":
|
elif opt == "--check-backend":
|
||||||
check_backend = True
|
check_backend = True
|
||||||
|
|
|
@ -17,6 +17,16 @@ considered its short description.
|
||||||
All backends must generate their contents through the 'tracetool.out' routine.
|
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
|
Backend functions
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
@ -42,7 +52,7 @@ import os
|
||||||
import tracetool
|
import tracetool
|
||||||
|
|
||||||
|
|
||||||
def get_list():
|
def get_list(only_public = False):
|
||||||
"""Get a list of (name, description) pairs."""
|
"""Get a list of (name, description) pairs."""
|
||||||
res = [("nop", "Tracing disabled.")]
|
res = [("nop", "Tracing disabled.")]
|
||||||
modnames = []
|
modnames = []
|
||||||
|
@ -57,6 +67,10 @@ def get_list():
|
||||||
continue
|
continue
|
||||||
module = module[1]
|
module = module[1]
|
||||||
|
|
||||||
|
public = getattr(module, "PUBLIC", False)
|
||||||
|
if only_public and not public:
|
||||||
|
continue
|
||||||
|
|
||||||
doc = module.__doc__
|
doc = module.__doc__
|
||||||
if doc is None:
|
if doc is None:
|
||||||
doc = ""
|
doc = ""
|
||||||
|
|
|
@ -16,6 +16,9 @@ __email__ = "stefanha@linux.vnet.ibm.com"
|
||||||
from tracetool import out
|
from tracetool import out
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC = True
|
||||||
|
|
||||||
|
|
||||||
PROBEPREFIX = None
|
PROBEPREFIX = None
|
||||||
|
|
||||||
def _probeprefix():
|
def _probeprefix():
|
||||||
|
|
|
@ -15,6 +15,10 @@ __email__ = "stefanha@linux.vnet.ibm.com"
|
||||||
|
|
||||||
from tracetool import out
|
from tracetool import out
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC = True
|
||||||
|
|
||||||
|
|
||||||
def is_string(arg):
|
def is_string(arg):
|
||||||
strtype = ('const char*', 'char*', 'const char *', 'char *')
|
strtype = ('const char*', 'char*', 'const char *', 'char *')
|
||||||
if arg.lstrip().startswith(strtype):
|
if arg.lstrip().startswith(strtype):
|
||||||
|
|
|
@ -16,6 +16,9 @@ __email__ = "stefanha@linux.vnet.ibm.com"
|
||||||
from tracetool import out
|
from tracetool import out
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC = True
|
||||||
|
|
||||||
|
|
||||||
def c(events):
|
def c(events):
|
||||||
out('#include "trace.h"',
|
out('#include "trace.h"',
|
||||||
'',
|
'',
|
||||||
|
|
|
@ -16,6 +16,9 @@ __email__ = "stefanha@linux.vnet.ibm.com"
|
||||||
from tracetool import out
|
from tracetool import out
|
||||||
|
|
||||||
|
|
||||||
|
PUBLIC = True
|
||||||
|
|
||||||
|
|
||||||
def c(events):
|
def c(events):
|
||||||
out('#include <ust/marker.h>',
|
out('#include <ust/marker.h>',
|
||||||
'#undef mutex_lock',
|
'#undef mutex_lock',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue