Skip to content

Commit 7103201

Browse files
stsquadstefanhaRH
authored andcommitted
trace: remove vcpu_id from the TraceEvent structure
This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Message-id: [email protected] Message-Id: <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]>
1 parent 78f314c commit 7103201

File tree

5 files changed

+3
-30
lines changed

5 files changed

+3
-30
lines changed

scripts/tracetool/format/c.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@ def generate(events, backend, group):
3232
out('uint16_t %s;' % e.api(e.QEMU_DSTATE))
3333

3434
for e in events:
35-
if "vcpu" in e.properties:
36-
vcpu_id = 0
37-
else:
38-
vcpu_id = "TRACE_VCPU_EVENT_NONE"
3935
out('TraceEvent %(event)s = {',
4036
' .id = 0,',
41-
' .vcpu_id = %(vcpu_id)s,',
4237
' .name = \"%(name)s\",',
4338
' .sstate = %(sstate)s,',
4439
' .dstate = &%(dstate)s ',
4540
'};',
4641
event = e.api(e.QEMU_EVENT),
47-
vcpu_id = vcpu_id,
4842
name = e.name,
4943
sstate = "TRACE_%s_ENABLED" % e.name.upper(),
5044
dstate = e.api(e.QEMU_DSTATE))

scripts/tracetool/format/h.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,7 @@ def generate(events, backend, group):
7474

7575
out('}')
7676

77-
# tracer wrapper with checks (per-vCPU tracing)
78-
if "vcpu" in e.properties:
79-
trace_cpu = next(iter(e.args))[1]
80-
cond = "trace_event_get_vcpu_state(%(cpu)s,"\
81-
" TRACE_%(id)s)"\
82-
% dict(
83-
cpu=trace_cpu,
84-
id=e.name.upper())
85-
else:
86-
cond = "true"
77+
cond = "true"
8778

8879
out('',
8980
'static inline void %(api)s(%(args)s)',

trace/control-internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev)
2727

2828
static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev)
2929
{
30-
return ev->vcpu_id;
30+
return 0;
3131
}
3232

3333
static inline bool trace_event_is_vcpu(TraceEvent *ev)
3434
{
35-
return ev->vcpu_id != TRACE_VCPU_EVENT_NONE;
35+
return false;
3636
}
3737

3838
static inline const char * trace_event_get_name(TraceEvent *ev)

trace/control.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ void trace_event_register_group(TraceEvent **events)
6868
size_t i;
6969
for (i = 0; events[i] != NULL; i++) {
7070
events[i]->id = next_id++;
71-
if (events[i]->vcpu_id == TRACE_VCPU_EVENT_NONE) {
72-
continue;
73-
}
74-
75-
if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) {
76-
events[i]->vcpu_id = next_vcpu_id++;
77-
} else {
78-
warn_report("too many vcpu trace events; dropping '%s'",
79-
events[i]->name);
80-
}
8171
}
8272
event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1);
8373
event_groups[nevent_groups].events = events;

trace/event-internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
/**
2020
* TraceEvent:
2121
* @id: Unique event identifier.
22-
* @vcpu_id: Unique per-vCPU event identifier.
2322
* @name: Event name.
2423
* @sstate: Static tracing state.
2524
* @dstate: Dynamic tracing state
@@ -33,7 +32,6 @@
3332
*/
3433
typedef struct TraceEvent {
3534
uint32_t id;
36-
uint32_t vcpu_id;
3735
const char * name;
3836
const bool sstate;
3937
uint16_t *dstate;

0 commit comments

Comments
 (0)