aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/backend
AgeCommit message (Collapse)AuthorFilesLines
2023-04-24tracetool: use relative paths for '#line' preprocessor directivesThomas De Schampheleire3-3/+9
The event filename is an absolute path. Convert it to a relative path when writing '#line' directives, to preserve reproducibility of the generated output when different base paths are used. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20230406080045.21696-1-thomas.de_schampheleire@nokia.com>
2021-02-01trace: make the 'log' backend timestamp configurableStefan Hajnoczi1-6/+13
Timestamps in tracing output can be distracting. Make it possible to control tid/timestamp printing with -msg timestamp=on|off. The default is no tid/timestamps. Previously they were always printed. Suggested-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210125113507.224287-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2021-01-04tracetool: show trace-events filename/lineno in fmt string errorsStefan Hajnoczi3-0/+12
The compiler encounters trace event format strings in generated code. Format strings are error-prone and therefore clear compiler errors are important. Use the #line directive to show the trace-events filename and line number in format string errors: https://gcc.gnu.org/onlinedocs/gcc-10.2.0/cpp/Line-Control.html For example, if the cpu_in trace event's %u is changed to %p the following error is reported: trace-events:29:18: error: format ‘%p’ expects argument of type ‘void *’, but argument 7 has type ‘unsigned int’ [-Werror=format=] Line 29 in trace-events is where cpu_in is defined. This works for any trace-events file in the QEMU source tree and the correct path is displayed. Unfortunately there does not seem to be a way to set the column, so "18" is not the right character on that line. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200827142915.108730-5-stefanha@redhat.com>
2020-08-21libqemuutil, qapi, trace: convert to mesonPaolo Bonzini2-6/+2
This shows how to do some "computations" in meson.build using its array and dictionary data structures, and also a basic usage of the sourceset module for conditional compilation. Notice the new "if have_system" part of util/meson.build, which fixes a bug in the old build system was buggy: util/dbus.c was built even for non-softmmu builds, but the dependency on -lgio was lost when the linking was done through libqemuutil.a. Because all of its users required gio otherwise, the bug was hidden. Meson instead propagates libqemuutil's dependencies down to its users, and shows the problem. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-07-30tracetool: carefully define SDT_USE_VARIADICStefan Hajnoczi1-0/+4
The dtrace backend defines SDT_USE_VARIADIC as a workaround for a conflict with a LTTng UST header file, which requires SDT_USE_VARIADIC to be defined. LTTng UST <lttng/tracepoint.h> breaks if included after generated dtrace headers because SDT_USE_VARIADIC will already be defined: #ifdef LTTNG_UST_HAVE_SDT_INTEGRATION #define SDT_USE_VARIADIC <-- error, it's already defined #include <sys/sdt.h> Be more careful when defining SDT_USE_VARIADIC. This fixes the build when both the dtrace and ust tracers are enabled at the same time. Fixes: 27e08bab94f7c6ebe0b75938c98c394c969e3fd8 ("tracetool: work around ust <sys/sdt.h> include conflict") Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20200729153926.127083-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-07-07tracetool: work around ust <sys/sdt.h> include conflictStefan Hajnoczi1-0/+6
Both the dtrace and ust backends may include <sys/sdt.h> but LTTng Userspace Tracer 2.11 and later requires SDT_USE_VARIADIC to be defined before including the header file. This is a classic problem with C header files included from different parts of a program. If the same header is included twice within the same compilation unit then the first inclusion determines the macro environment. Work around this by defining SDT_USE_VARIADIC in the dtrace backend too. It doesn't hurt and fixes a missing STAP_PROBEV() compiler error when the ust backend is enabled together with the dtrace backend. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20200625140757.237012-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-06-24scripts/tracetool: Update maintainer email addressPhilippe Mathieu-Daudé5-5/+5
There is an effort in progress to generate a QEMU Python package. As I'm not sure this old email is still valid, update it to not produce package with broken maintainer email. Patch created mechanically by running: $ sed -i 's,\(__email__ *= "\)stefanha@linux.vnet.ibm.com",\1stefanha@redhat.com",' \ $(git grep -l 'email.*stefanha@linux.vnet.ibm.com') Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20200511082816.696-1-philmd@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-02-07scripts/tracetool: Remove shebang headerPhilippe Mathieu-Daudé7-7/+0
Patch created mechanically by running: $ chmod 644 $(git grep -lF '#!/usr/bin/env python' \ | xargs grep -L 'if __name__.*__main__') $ sed -i "/^#\!\/usr\/bin\/\(env\ \)\?python.\?$/d" \ $(git grep -lF '#!/usr/bin/env python' \ | xargs grep -L 'if __name__.*__main__') Reported-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Suggested-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200130163232.10446-9-philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2018-12-12tracetool: Include thread id information in log backendFabiano Rosas1-1/+1
Currently the log backend prints the process id of QEMU at the start of each output line, but since threads share the same PID there is no clear distinction between their outputs. Having the thread id present in the log makes it easier to see when output comes from different threads. E.g.: 12423@1538597569.672527:qemu_mutex_lock waiting on mutex 0x1103ee60 (/root/qemu/util/main-loop.c:236) ... 12430@1538597569.503928:qemu_mutex_unlock released mutex 0x1103ee60 (/root/qemu/cpus.c:1238) 12431@1538597569.503937:qemu_mutex_locked taken mutex 0x1103ee60 (/root/qemu/cpus.c:1257) ^here In the above, 12423 is the main process id and 12430 & 12431 are the two vcpu threads. (qemu) info cpus * CPU #0: thread_id=12430 CPU #1: thread_id=12431 Suggested-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-06-29trace: Fix format string for the struct timeval members casted to size_tPhilippe Mathieu-Daudé1-1/+1
This fixes when using GCC with -Wformat-signedness: migration/trace.h: In function ‘_nocheck__trace_dirty_bitmap_load_success’: migration/trace.h:6368:24: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘long unsigned int’ [-Werror=format=] qemu_log("%d@%zd.%06zd:dirty_bitmap_load_success " "" "\n", ~~^ %ld migration/trace.h:6370:18: (size_t)_now.tv_sec, (size_t)_now.tv_usec ~~~~~~~~~~~~~~~~~~~ migration/trace.h:6368:30: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘long unsigned int’ [-Werror=format=] qemu_log("%d@%zd.%06zd:dirty_bitmap_load_success " "" "\n", ~~~~^ %06ld migration/trace.h:6370:39: (size_t)_now.tv_sec, (size_t)_now.tv_usec ~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-03-12log-for-trace.h: Split out parts of log.h used by trace.hPeter Maydell1-7/+6
A persistent build problem we see is where a source file accidentally omits the #include of log.h. This slips through local developer testing because if you configure with the default (log) trace backend trace.h will pull in log.h for you. Compilation fails only if some other backend is selected. To make this error cause a compile failure regardless of the configured trace backend, split out the parts of log.h that trace.h requires into a new log-for-trace.h header. Since almost all manual uses of the log.h functions will use constants or functions which aren't in log-for-trace.h, this will let us catch missing #include "qemu/log.h" more consistently. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180213140029.8308-1-peter.maydell@linaro.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-08-01trace: add TRACE_<event>_BACKEND_DSTATE()Stefan Hajnoczi7-0/+45
QEMU keeps track of trace event enabled/disabled state and provides monitor commands to inspect and modify the "dstate". SystemTap and LTTng UST maintain independent enabled/disabled states for each trace event, the other backends rely on QEMU dstate. Introduce a new per-event macro that combines backend-specific dstate like this: #define TRACE_MY_EVENT_BACKEND_DSTATE() ( \ QEMU_MY_EVENT_ENABLED() || /* SystemTap */ \ tracepoint_enabled(qemu, my_event) /* LTTng UST */ || \ false) This will be used to extend trace_event_get_state() in the next patch. [Daniel Berrange pointed out that QEMU_MY_EVENT_ENABLED() must be true by default, not false. This way events will fire even if the DTrace implementation does not implement the SystemTap semaphores feature. Ubuntu Precise uses lttng-ust-dev 2.0.2 which does not have tracepoint_enabled(), so we need a compatibility wrapper to keep Travis builds passing. --Stefan] Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170731140718.22010-2-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> fixup! trace: add TRACE_<event>_BACKEND_DSTATE()
2017-07-17trace: [tcg, trivial] Re-align generated codeLluís Vilanova6-28/+29
Last patch removed a nesting level in generated code. Re-align all code generated by backends to be 4-column aligned. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Emilio G. Cota <cota@braap.org> Message-id: 149915824586.6295.17820926011082409033.stgit@frigg.lan Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-01-31trace: switch to modular code generation for sub-directoriesDaniel P. Berrange3-3/+12
Introduce rules in the top level Makefile that are able to generate trace.[ch] files in every subdirectory which has a trace-events file. The top level directory is handled specially, so instead of creating trace.h, it creates trace-root.h. This allows sub-directories to include the top level trace-root.h file, without ambiguity wrt to the trace.g file in the current sub-dir. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170125161417.31949-7-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-10-27trace: Fix 'char **' compilation error in simple backendFam Zheng1-1/+2
Currently, the generated function body will do "strlen(arg)" but the argument could be 'char **' or 'char * const *'. Avoid that by excluding such cases in is_string check. Reported by patchew's "make docker-test-mingw@fedora". Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1477453806-21097-1-git-send-email-famz@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-12trace: introduce a formal group name for trace eventsDaniel P. Berrange7-20/+20
The declarations in the generated-tracers.h file are assuming there's only ever going to be one instance of this header, as they are not namespaced. When we have one header per event group, if a single source file needs to include multiple sets of trace events, the symbols will all clash. This change thus introduces a '--group NAME' arg to the 'tracetool' program. This will cause all the symbols in the generated header files to be given a unique namespace. If no group is given, the group name 'common' is used, which is suitable for the current usage where there is only one global trace-events file used for code generation. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 1475588159-30598-21-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-10-12trace: remove the TraceEventID and TraceEventVCPUID enumsDaniel P. Berrange1-2/+2
The TraceEventID and TraceEventVCPUID enums constants are no longer actually used for anything critical. The TRACE_EVENT_COUNT limit is used to determine the size of the TraceEvents array, and can be removed if we just NULL terminate the array instead. The TRACE_VCPU_EVENT_COUNT limit is used as a magic value for marking non-vCPU events, and also for declaring the size of the trace dstate mask in the CPUState struct. The former usage can be replaced by a dedicated constant TRACE_EVENT_VCPU_NONE, defined as (uint32_t)-1. For the latter usage, we can simply define a constant for the number of VCPUs, avoiding the need for the full enum. The only other usages of the enum values can be replaced by accesing the id/vcpu_id fields via the named TraceEvent structs. Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-11-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-10-12trace: remove duplicate control.h includes in generated-tracers.hDaniel P. Berrange3-4/+1
The format/h.py file adds an include for control.h to generated-tracers.h. ftrace, log and syslog, then add more duplicate includes for control.h. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-8-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-09-05trace: add syslog tracing backendPaul Durrant1-0/+45
This patch adds a tracing backend which sends output using syslog(). The syslog backend is limited to POSIX compliant systems. openlog() is called with facility set to LOG_DAEMON, with the LOG_PID option. Trace events are logged at level LOG_INFO. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Message-id: 1470318254-29989-1-git-send-email-paul.durrant@citrix.com Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-07-18trace: Conditionally trace events based on their per-vCPU stateLluís Vilanova5-27/+40
Events with the 'vcpu' property are conditionally emitted according to their per-vCPU state. Other events are emitted normally based on their global tracing state. Note that the per-vCPU condition check applies to all tracing backends. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-03-22Clean up includes some moreMarkus Armbruster1-5/+1
Manually drop redundant includes that scripts/clean-includes misses, e.g. because they're hidden in generator programs, or they use the wrong kind of delimiter. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-02-16scripts/tracetool: Include qemu/osdep.h in generated .c filesPeter Maydell1-1/+2
Include qemu/osdep.h as the first include in generated .c files, so they don't implicitly rely on some other included header to pull it in. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-02-03trace: convert stderr backend to logPaolo Bonzini1-4/+5
[Also update .travis.yml --enable-trace-backends=stderr --Stefan] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-10-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-02-06trace: Print PID and time in stderr tracesDr. David Alan Gilbert1-1/+9
When debugging migration it's useful to know the PID of each trace message so you can figure out if it came from the source or the destination. Printing the time makes it easy to do latency measurements or timings between trace points. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1421746875-9962-1-git-send-email-dgilbert@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-28trace: avoid Python 2.5 all() in tracetoolStefan Hajnoczi1-1/+2
Red Hat Enterprise Linux 5 ships Python 2.4.3. The all() function was added in Python 2.5 so we cannot use it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
2014-06-09trace: Multi-backend tracingLluís Vilanova1-7/+8
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-05-07trace: [tracetool] Minimize the amount of per-backend codeLluís Vilanova7-313/+153
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-07trace: [tracetool] Show list of frontends and backends sorted by nameLluís Vilanova1-1/+1
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-07trace: [tracetool] Add method 'Event.api' to build event namesLluís Vilanova4-13/+15
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-02-19Modified the tracetool framework for LTTng 2.xMohamad Gebai1-56/+45
* A new format is required to generate definitions for ust tracepoints. Files ust_events_h.py and ust_events_c.py define common macros, while new function ust_events_h in events.py does the actual definition of each tracepoint. * ust.py generates the new interface for calling userspace tracepoints with LTTng 2.x, replacing trace_name(args) to tracepoint(name, args). * As explained in ust_events_c.py, -Wredundant-decls gives a warning when compiling with gcc 4.7 or older. This is specific to lttng-ust so for now use a pragma clause to avoid getting a warning. Signed-off-by: Mohamad Gebai <mohamad.gebai@polymtl.ca> Reviewed-by: Alex Bennée <alex@bennee.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-01-27trace: fix simple trace "disable" keywordStefan Hajnoczi1-1/+2
The trace-events "disable" keyword turns an event into a nop at compile-time. This is important for high-frequency events that can impact performance. The "disable" keyword is currently broken in the simple trace backend. This patch fixes the problem as follows: Trace events are identified by their TraceEventID number. When events are disabled there are two options for assigning TraceEventID numbers: 1. Skip disabled events and don't assign them a number. 2. Assign numbers for all events regardless of the disabled keyword. The simple trace backend and its binary file format uses approach #1. The tracetool infrastructure has been using approach #2 for a while. The result is that the numbers used in simple trace files do not correspond with TraceEventIDs. In trace/simple.c we assumed that they are identical and therefore emitted bogus numbers. This patch fixes the bug by using TraceEventID for trace_event_id() while sticking to approach #1 for simple trace file numbers. This preserves simple trace file format compatibility. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-01-27trace: [simple] Do not include "trace/simple.h" in generated tracer headersLluís Vilanova1-3/+0
The header is not necessary, given that the simple backend does not define any inlined tracing routines. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-03trace: Add ftrace tracing backendEiichi Tsukata1-0/+54
This patch adds a ftrace tracing backend which sends trace event to ftrace marker file. You can effectively compare qemu trace data and kernel(especially, kvm.ko when using KVM) trace data. The ftrace backend is restricted to Linux only. To try out the ftrace backend: $ ./configure --trace-backend=ftrace $ make if you use KVM, enable kvm events in ftrace: # sudo echo 1 > /sys/kernel/debug/tracing/events/kvm/enable After running qemu by root user, you can get the trace: # cat /sys/kernel/debug/tracing/trace Signed-off-by: Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: [stderr] Port to generic event information and new control interfaceLluís Vilanova1-19/+8
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: [simple] Port to generic event information and new control interfaceLluís Vilanova1-13/+5
The backend is forced to dump event numbers using 64 bits, as TraceEventID is an enum. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: Provide a generic tracing event descriptorLluís Vilanova1-0/+23
Uses tracetool to generate a backend-independent tracing event description (struct TraceEvent). The values for such structure are generated with the non-public "events" backend ("events-c" frontend). The generation of the defines to check if an event is statically enabled is also moved to the "events" backend ("events-h" frontend). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: [tracetool] Explicitly identify public backendsLluís Vilanova5-1/+28
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>
2012-12-23build: Use separate makefile for "trace/"Lluís Vilanova1-1/+1
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> -- Changes in v2: * Do not depend on "qemu-timer-common.o". * Use "$(obj)" in rules to refer to the build sub-directory. * Remove dependencies against "$(GENERATED_HEADERS)". Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-11-16Avoid all systemtap reserved wordsDaniel P. Berrange1-1/+10
Over time various systemtap reserved words have been blacklisted in the trace backend generator. The list is not complete though, so there is continued risk of problems in the future. Preempt such problems by specifying the full list of systemtap keywords listed in its parser as identified here: http://sourceware.org/ml/systemtap/2012-q4/msg00157.html Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-09-23dtrace backend: add function to reserved wordsAlon Levy1-1/+1
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-08-14trace/simple: Fix compiler warning for 32 bit hostsStefan Weil1-1/+1
gcc complains when a 32 bit pointer is casted to a 64 bit integer. Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19Simpletrace v2: Support multiple arguments, strings.Harsh Prateek Bora1-19/+71
Existing simpletrace backend allows to trace at max 6 args and does not support strings. This newer tracelog format gets rid of fixed size records and therefore allows to trace variable number of args including strings. Sample trace with strings: v9fs_version 0.000 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L v9fs_version_return 6.705 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-05-01tracetool: avoid pkgutil.iter_modules() Python 2.7 functionStefan Hajnoczi1-2/+6
The pkgutil.iter_modules() function provides a way to enumerate child modules. Unfortunately it's missing in Python <2.7 so we must implement similar behavior ourselves. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-04-18tracetool: handle DTrace keywords 'in', 'next', 'self'Stefan Hajnoczi1-4/+4
Language keywords cannot be used as argument names. The DTrace backend appends an underscore to the argument name in order to make the argument name legal. This patch adds 'in', 'next', and 'self' keywords to dtrace.py. Also drop the unnecessary argument name lstrip() call. The Arguments.build() method already ensures there is no space around argument names. Furthermore it is misleading to do the lstrip() *after* checking against keywords because the keyword check would not match if spaces were in the name. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Alon Levy <alevy@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-04-18tracetool: Add support for the 'dtrace' backendLluís Vilanova1-0/+97
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add support for the 'ust' backendLluís Vilanova1-0/+90
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add support for the 'simple' backendLluís Vilanova1-0/+55
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add support for the 'stderr' backendLluís Vilanova1-0/+56
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Rewrite infrastructure as python modulesLluís Vilanova1-0/+111
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>