Commit Graph

10 Commits

Author SHA1 Message Date
Lluís Vilanova 5b808275f3 trace: Multi-backend tracing
Adds support to compile QEMU with multiple tracing backends at the same time.

For example, you can compile QEMU with:

  $ ./configure --enable-trace-backends=ftrace,dtrace

Where 'ftrace' can be handy for having an in-flight record of events, and 'dtrace' can be later used to extract more information from the system.

This patch allows having both available without recompiling QEMU.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-06-09 15:43:40 +02:00
Lluís Vilanova 1dad2ce973 trace: [tracetool] Minimize the amount of per-backend code
Backends now only contain the essential backend-specific code, and most of the work is moved to frontend code.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-07 19:07:18 +02:00
Lluís Vilanova 53158adc23 trace: [tracetool] Cosmetic changes
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-07 19:07:17 +02:00
Lluís Vilanova 9c24a52e29 trace: [tracetool] Spacing changes
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-07 19:07:17 +02:00
Lluís Vilanova ad7443e40a trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy'
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-07 19:07:17 +02:00
Lluís Vilanova 7d08f0da90 trace: [tracetool] Add method 'Event.api' to build event names
Makes it easier to ensure proper naming across the different frontends and backends.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-07 19:07:17 +02:00
Stefan Hajnoczi b3ef0ade57 tracetool: avoid str.rpartition() Python 2.5 function
The str.rpartition() function is related to str.split() and is used for
splitting strings.  It was introduced in Python 2.5 and therefore cannot
be used in tracetool as Python 2.4 compatibility is required.

Replace the code using str.rsplit().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01 20:15:28 +01:00
Stefan Hajnoczi 45d6c78775 tracetool: use Python 2.4-compatible __import__() arguments
In Python 2.5 keyword arguments were added to __import__().  Avoid using
them to achieve Python 2.4 compatibility.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01 20:15:28 +01:00
Lluís Vilanova 52ef093ace tracetool: Add support for the 'dtrace' backend
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18 14:03:00 +01:00
Lluís Vilanova 650ab98d1d tracetool: Rewrite infrastructure as python modules
The tracetool script is written in shell and has hit several portability
problems due to shell quirks or external tools across host platforms.
Additionally the amount of string processing and lack of real data
structures makes it tough to implement code generator backends for
tracers that are more complex.

This patch replaces the shell version of tracetool with a Python
version.  The new tracetool design is:

  scripts/tracetool.py - top-level script
  scripts/tracetool/backend/ - tracer backends live here (simple, ust)
  scripts/tracetool/format/  - output formats live here (.c, .h)

There is common code for trace-events definition parsing so that
backends can focus on generating code rather than parsing input.

Support for all existing backends (nop, stderr, simple, ust,
and dtrace) is added back in follow-up patches.

[Commit description written by Stefan Hajnoczi]

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18 14:02:59 +01:00