diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/scripts/tracetool/format/__init__.py | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/scripts/tracetool/format/__init__.py')
-rw-r--r-- | qemu/scripts/tracetool/format/__init__.py | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/qemu/scripts/tracetool/format/__init__.py b/qemu/scripts/tracetool/format/__init__.py deleted file mode 100644 index 812570ff6..000000000 --- a/qemu/scripts/tracetool/format/__init__.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Format management. - - -Creating new formats --------------------- - -A new format named 'foo-bar' corresponds to Python module -'tracetool/format/foo_bar.py'. - -A format module should provide a docstring, whose first non-empty line will be -considered its short description. - -All formats must generate their contents through the 'tracetool.out' routine. - - -Format functions ----------------- - -======== ================================================================== -Function Description -======== ================================================================== -generate Called to generate a format-specific file. -======== ================================================================== - -""" - -__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" -__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" -__license__ = "GPL version 2 or (at your option) any later version" - -__maintainer__ = "Stefan Hajnoczi" -__email__ = "stefanha@linux.vnet.ibm.com" - - -import os - -import tracetool - - -def get_list(): - """Get a list of (name, description) pairs.""" - res = [] - modnames = [] - for filename in os.listdir(tracetool.format.__path__[0]): - if filename.endswith('.py') and filename != '__init__.py': - modnames.append(filename.rsplit('.', 1)[0]) - for modname in sorted(modnames): - module = tracetool.try_import("tracetool.format." + modname) - - # just in case; should never fail unless non-module files are put there - if not module[0]: - continue - module = module[1] - - doc = module.__doc__ - if doc is None: - doc = "" - doc = doc.strip().split("\n")[0] - - name = modname.replace("_", "-") - res.append((name, doc)) - return res - - -def exists(name): - """Return whether the given format exists.""" - if len(name) == 0: - return False - name = name.replace("-", "_") - return tracetool.try_import("tracetool.format." + name)[1] - - -def generate(events, format, backend): - if not exists(format): - raise ValueError("unknown format: %s" % format) - format = format.replace("-", "_") - func = tracetool.try_import("tracetool.format." + format, - "generate")[1] - if func is None: - raise AttributeError("format has no 'generate': %s" % format) - func(events, backend) |