summary refs log tree commit diff stats
path: root/scripts/tracetool/backend/dtrace.py
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2014-01-15 11:10:30 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-01-27 15:49:39 +0100
commit736ec1677f1ae7e64f2f3436ca3775c48f79678c (patch)
tree48db2dfcfc0a028a2a427b5b9c537c4a389aa705 /scripts/tracetool/backend/dtrace.py
parent05735a2a9cf37f5dc11ece998906431dda707258 (diff)
downloadfocaccia-qemu-736ec1677f1ae7e64f2f3436ca3775c48f79678c.tar.gz
focaccia-qemu-736ec1677f1ae7e64f2f3436ca3775c48f79678c.zip
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>
Diffstat (limited to 'scripts/tracetool/backend/dtrace.py')
0 files changed, 0 insertions, 0 deletions