summaryrefslogtreecommitdiff
path: root/scripts/tracetool/backend
AgeCommit message (Collapse)AuthorFilesLines
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>