+2015-06-11 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-events.c (ETRACE_P): Delete.
+ (ETRACE): Change ETRACE_P to STRACE_EVENTS_P(sd).
+ (update_time_from_event, sim_events_schedule_vtracef): Likewise.
+ * sim-events.h (struct _sim_events): Delete trace member.
+ * sim-trace.c (set_trace_option_mask): Delete trace_nr check and
+ always set STATE_TRACE_FLAGS(sd)[trace_nr] element.
+
2015-06-11 Mike Frysinger <vapier@gentoo.org>
* sim-trace.h (STRACE_ANY_P, STRACE_INSN_P, STRACE_DECODE_P,
#define _ETRACE sd, NULL
-#undef ETRACE_P
-#define ETRACE_P (WITH_TRACE && STATE_EVENTS (sd)->trace)
-
#undef ETRACE
#define ETRACE(ARGS) \
do \
{ \
- if (ETRACE_P) \
+ if (STRACE_EVENTS_P (sd)) \
{ \
if (STRACE_DEBUG_P (sd)) \
{ \
events->time_of_event = current_time - 1;
events->time_from_event = -1;
}
- if (ETRACE_P)
+ if (STRACE_EVENTS_P (sd))
{
sim_event *event;
int i;
new_event->data = data;
new_event->handler = handler;
new_event->watching = watch_timer;
- if (fmt == NULL || !ETRACE_P || vasprintf (&new_event->trace, fmt, ap) < 0)
+ if (fmt == NULL || !STRACE_EVENTS_P (sd) || vasprintf (&new_event->trace, fmt, ap) < 0)
new_event->trace = NULL;
insert_sim_event (sd, new_event, delta_time);
ETRACE ((_ETRACE,
SIM_ELAPSED_TIME resume_wallclock;
signed64 time_of_event;
signed64 time_from_event;
- int trace;
};
}
}
- /* update applicable trace bits */
+ /* Update applicable trace bits. */
for (trace_nr = 0; trace_nr < MAX_TRACE_VALUES; ++trace_nr)
{
if ((mask & (1 << trace_nr)) == 0)
continue;
/* Set non-cpu specific values. */
- switch (trace_nr)
- {
- case TRACE_EVENTS_IDX:
- STATE_EVENTS (sd)->trace = trace_val;
- break;
- case TRACE_DEBUG_IDX:
- STATE_TRACE_FLAGS (sd)[trace_nr] = trace_val;
- break;
- }
+ STATE_TRACE_FLAGS (sd)[trace_nr] = trace_val;
/* Set cpu values. */
for (cpu_nr = 0; cpu_nr < MAX_NR_PROCESSORS; cpu_nr++)