mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
trace: [simple] Port to generic event information and new control interface
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>
This commit is contained in:
parent
fd068a953c
commit
60481e210d
3 changed files with 13 additions and 46 deletions
|
@ -28,17 +28,10 @@ def is_string(arg):
|
|||
|
||||
def c(events):
|
||||
out('#include "trace.h"',
|
||||
'#include "trace/control.h"',
|
||||
'#include "trace/simple.h"',
|
||||
'',
|
||||
'TraceEvent trace_list[] = {')
|
||||
|
||||
for e in events:
|
||||
out('{.tp_name = "%(name)s", .state=0},',
|
||||
name = e.name,
|
||||
)
|
||||
|
||||
out('};',
|
||||
'')
|
||||
)
|
||||
|
||||
for num, event in enumerate(events):
|
||||
out('void trace_%(name)s(%(args)s)',
|
||||
|
@ -63,7 +56,9 @@ def c(events):
|
|||
|
||||
|
||||
out('',
|
||||
' if (!trace_list[%(event_id)s].state) {',
|
||||
' TraceEvent *eventp = trace_event_id(%(event_id)s);',
|
||||
' bool _state = trace_event_get_state_dynamic(eventp);',
|
||||
' if (!_state) {',
|
||||
' return;',
|
||||
' }',
|
||||
'',
|
||||
|
@ -106,6 +101,3 @@ def h(events):
|
|||
name = event.name,
|
||||
args = event.args,
|
||||
)
|
||||
out('')
|
||||
out('#define NR_TRACE_EVENTS %d' % len(events))
|
||||
out('extern TraceEvent trace_list[NR_TRACE_EVENTS];')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue