diff options
author | Lluís Vilanova <vilanova@ac.upc.edu> | 2013-03-05 14:47:26 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-03-28 14:19:57 +0100 |
commit | 93fba1618ddbbef8bedd8d684cf356586c94bbb1 (patch) | |
tree | 613b841320e0754da3046d7cbc6698c537e96cb2 /scripts/tracetool/backend/__init__.py | |
parent | e280ff5e9159ed227a117339c1157143627cab96 (diff) |
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/backend/__init__.py')
-rw-r--r-- | scripts/tracetool/backend/__init__.py | 16 |
1 files changed, 15 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 = "" |