summaryrefslogtreecommitdiffstats
path: root/scripts/tracetool
Commit message (Collapse)AuthorAgeFilesLines
...
* tracetool: Add module for the 'h' formatLluís Vilanova2012-04-181-0/+45
| | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* tracetool: Add module for the 'c' formatLluís Vilanova2012-04-181-0/+20
| | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* tracetool: Rewrite infrastructure as python modulesLluís Vilanova2012-04-184-666/+472
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tracetool: Forbid argument name 'next'Kevin Wolf2012-04-051-0/+4
| | | | | | | | | It has happened more than once that patches that look perfectly sane and work with simpletrace broke systemtap because they use 'next' as an argument name for a tracing function. However, 'next' is a keyword for systemtap, so we shouldn't use it. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori2012-04-021-4/+18
|\ | | | | | | | | | | | | * stefanha/tracing: tracetool: dtrace: handle in and next reserved words tracetool: dtrace disabled-events fix Makefile.target: code stp dependency on trace-events
| * tracetool: dtrace: handle in and next reserved wordsAlon Levy2012-03-301-4/+6
| | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * tracetool: dtrace disabled-events fixLee Essen2012-03-301-0/+12
| | | | | | | | | | | | | | | | | | If there are "disabled" entries in the trace-events file then linetod_nop() is called if the backend is dtrace, it's currently not present. Also equivalent fix for stap. Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Fix conversion from lower to upper case with Turkish localeStefan Weil2012-03-311-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some locale settings let make fail or create wrong results because tr '[:lower:]' '[:upper:]' which is used to convert from lower to upper case depends on the locale. With locale tr_TR.UTF-8, lower case 'i' is not converted to 'I'. This results in wrong entries in config-host.h like these ones: #define CONFIG_QEMU_PREFiX "/usr/local" #define CONFIG_QEMU_BiNDiR "/usr/local/bin" This problem was reported by Emre Ersin. The same problem occurs when configure creates the target specific files config-target.mak. They get wrong declarations: TARGET_CRiS=y TARGET_i386=y TARGET_MiCROBLAZE=y TARGET_MiPS64=y TARGET_MiPS=y TARGET_UNiCORE32=y It is sufficient to restrict the conversion to the characters a-z. Using this explicit range avoids the dependency on the locale settings and is also shorter. v2: POSIX says that 'tr a-z' is unspecified outside of the POSIX locale, so we must set LC_ALL=C to make sure that we are using POSIX (hint from Eric Blake, thanks). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* tracetool: Omit useless QEMU_*_ENABLED() checkStefan Hajnoczi2012-03-121-3/+1
| | | | | | | | | | | | | | | | SystemTap provides a "semaphore" that can optionally be tested before executing a trace event. The purpose of this mechanism is to skip expensive tracing code when the trace event is disabled. For example, some applications may have trace events that format or convert strings for trace events. This expensive processing should only be done in the case where the trace event is enabled. Since QEMU's generated trace events never have such special-purpose code, there is no reason to add the semaphore check. Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: Provide a per-event status define for conditional compilationLluís Vilanova2012-03-121-1/+8
| | | | | | | | | | | | | | | Adds a 'TRACE_${NAME}_ENABLED' preprocessor define for each tracing event in "trace.h". This lets the user conditionally compile code with a relatively high execution cost that is only necessary when producing the tracing information for an event that is enabled. Note that events using this define will probably have the "disable" property by default, in order to avoid such costs on regular builds. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: allow PRI*64 at beginning and ending of format stringStefan Hajnoczi2011-09-171-7/+13
| | | | | | | | | | | | | | | | | | | The tracetool parser only picks up PRI*64 and other format string macros when enclosed between double quoted strings. Lift this restriction by extracting everything after the closing ')' as the format string: cpu_set_apic_base(uint64_t val) "%016"PRIx64 ^^ ^^ One trick here: it turns out that backslashes in the format string like "\n" were being interpreted by echo(1). Fix this by using the POSIX printf(1) command instead. Although it normally does not make sense to include backslashes in trace event format strings, an injected newline causes tracetool to emit a broken header file and I want to eliminate cases where broken output is emitted, even if the input was bad. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* trace: [stderr] add support for dynamically enabling/disabling eventsLluís2011-09-011-5/+28
| | | | | | | | Uses the generic interface provided in "trace/control.h" in order to provide a programmatic interface as well as command line and monitor controls. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: [simple] disable all trace points by defaultLluís2011-09-011-7/+2
| | | | | | | | Note that this refers to the backend-specific state (whether the output must be generated), not the event "disabled" property (which always uses the "nop" backend). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: always use the "nop" backend on events with the "disable" keywordLluís2011-09-011-13/+2
| | | | | | | Any event with the keyword/property "disable" generates an empty trace event using the "nop" backend, regardless of the current backend. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: generalize the "property" concept in the trace-events fileLluís2011-09-011-40/+33
| | | | | | | | | | This adds/modifies the following functions: * get_name: Get _only_ the event name * has_property: Return whether an event has a property (keyword before the event name) Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: move backend-specific code into the trace/ directoryLluís2011-09-011-1/+1
| | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: [ust] fix generation of 'trace.c' on events without argsLluís2011-04-261-3/+4
| | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* tracetool: allow ) in trace output stringPaolo Bonzini2011-04-261-1/+1
| | | | | | | | | Be greedy in matching the trailing "\)*" pattern. Otherwise, all the text in the trace string up to the last closed parenthesis is taken as part of the prototype. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* tracetool: Add optional argument to specify dtrace probe namesJes Sorensen2011-03-061-6/+13
| | | | | | | | | | | Optional feature allowing a user to generate the probe list to match the name of the binary, in case they wish to install qemu under a different name than qemu-{system,user},<arch> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Stefan Hajnoczi <stefaha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* New trace-event backend: stderrFabien Chouteau2011-01-291-2/+58
| | | | | | | | | | | This backend sends trace events to standard error output during the emulation. Also add a "--list-backends" option to tracetool, so configure script can display the list of available backends. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Add scripts directoryBlue Swirl2011-01-201-0/+573
Move build and user scripts into scripts directory. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud