736ec167 | 14-Jan-2014 |
Stefan Hajnoczi <stefanha@redhat.com> |
trace: fix simple trace "disable" keyword
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
trace: fix simple trace "disable" keyword
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>
show more ...
|
256a721d | 16-Apr-2012 |
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> |
tracetool: handle DTrace keywords 'in', 'next', 'self'
Language keywords cannot be used as argument names. The DTrace backend appends an underscore to the argument name in order to make the argumen
tracetool: handle DTrace keywords 'in', 'next', 'self'
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>
show more ...
|