Remove virtual events
This commit is contained in:
parent
6f8b46e753
commit
98db4a2fe0
47
emu.c
47
emu.c
@ -917,51 +917,6 @@ write_row_thread(struct ovni_emu *emu)
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
emu_virtual_init(struct ovni_emu *emu)
|
|
||||||
{
|
|
||||||
struct ovni_trace *trace;
|
|
||||||
|
|
||||||
trace = &emu->trace;
|
|
||||||
|
|
||||||
trace->ivirtual = 0;
|
|
||||||
trace->nvirtual = 0;
|
|
||||||
|
|
||||||
trace->virtual_events = calloc(MAX_VIRTUAL_EVENTS,
|
|
||||||
sizeof(struct ovni_ev));
|
|
||||||
|
|
||||||
if(trace->virtual_events == NULL)
|
|
||||||
{
|
|
||||||
perror("calloc");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
emu_virtual_ev(struct ovni_emu *emu, char *mcv)
|
|
||||||
{
|
|
||||||
struct ovni_trace *trace;
|
|
||||||
struct ovni_ev *ev;
|
|
||||||
|
|
||||||
trace = &emu->trace;
|
|
||||||
|
|
||||||
if(trace->nvirtual >= MAX_VIRTUAL_EVENTS)
|
|
||||||
{
|
|
||||||
err("too many virtual events\n");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
ev = &trace->virtual_events[trace->nvirtual];
|
|
||||||
|
|
||||||
ev->header.flags = 0;
|
|
||||||
ev->header.model = mcv[0];
|
|
||||||
ev->header.category = mcv[1];
|
|
||||||
ev->header.value = mcv[2];
|
|
||||||
ev->header.clock = emu->cur_ev->header.clock;
|
|
||||||
|
|
||||||
trace->nvirtual++;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_threads(struct ovni_emu *emu)
|
init_threads(struct ovni_emu *emu)
|
||||||
{
|
{
|
||||||
@ -1073,8 +1028,6 @@ emu_init(struct ovni_emu *emu, int argc, char *argv[])
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
emu_virtual_init(emu);
|
|
||||||
|
|
||||||
if(ovni_load_streams(&emu->trace))
|
if(ovni_load_streams(&emu->trace))
|
||||||
{
|
{
|
||||||
err("error loading streams\n");
|
err("error loading streams\n");
|
||||||
|
12
emu.h
12
emu.h
@ -353,15 +353,6 @@ struct ovni_trace {
|
|||||||
size_t nlooms;
|
size_t nlooms;
|
||||||
struct ovni_loom loom[OVNI_MAX_LOOM];
|
struct ovni_loom loom[OVNI_MAX_LOOM];
|
||||||
|
|
||||||
/* Index of next virtual event */
|
|
||||||
size_t ivirtual;
|
|
||||||
|
|
||||||
/* Number of virtual events stored */
|
|
||||||
size_t nvirtual;
|
|
||||||
|
|
||||||
/* The virtual events are generated by the emulator */
|
|
||||||
struct ovni_ev *virtual_events;
|
|
||||||
|
|
||||||
size_t nstreams;
|
size_t nstreams;
|
||||||
struct ovni_stream *stream;
|
struct ovni_stream *stream;
|
||||||
};
|
};
|
||||||
@ -455,7 +446,4 @@ struct ovni_ethread *emu_get_thread(struct ovni_eproc *proc, int tid);
|
|||||||
|
|
||||||
void emu_cpu_update_chan(struct ovni_cpu *cpu, struct ovni_chan *cpu_chan);
|
void emu_cpu_update_chan(struct ovni_cpu *cpu, struct ovni_chan *cpu_chan);
|
||||||
|
|
||||||
void
|
|
||||||
emu_virtual_ev(struct ovni_emu *emu, char *mcv);
|
|
||||||
|
|
||||||
#endif /* OVNI_EMU_H */
|
#endif /* OVNI_EMU_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user