Remove emu prefix from player
This commit is contained in:
parent
8ed9063488
commit
123178c340
@ -18,7 +18,7 @@ add_library(emu STATIC
|
|||||||
emu_args.c
|
emu_args.c
|
||||||
emu_ev.c
|
emu_ev.c
|
||||||
emu_model.c
|
emu_model.c
|
||||||
emu_player.c
|
player.c
|
||||||
stream.c
|
stream.c
|
||||||
trace.c
|
trace.c
|
||||||
loom.c
|
loom.c
|
||||||
|
@ -45,7 +45,7 @@ emu_init(struct emu *emu, int argc, char *argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emu_player_init(&emu->player, &emu->trace) != 0) {
|
if (player_init(&emu->player, &emu->trace) != 0) {
|
||||||
err("emu_init: cannot init player for trace '%s'\n",
|
err("emu_init: cannot init player for trace '%s'\n",
|
||||||
emu->args.tracedir);
|
emu->args.tracedir);
|
||||||
return -1;
|
return -1;
|
||||||
@ -84,8 +84,8 @@ emu_connect(struct emu *emu)
|
|||||||
static void
|
static void
|
||||||
set_current(struct emu *emu)
|
set_current(struct emu *emu)
|
||||||
{
|
{
|
||||||
emu->ev = emu_player_ev(&emu->player);
|
emu->ev = player_ev(&emu->player);
|
||||||
emu->stream = emu_player_stream(&emu->player);
|
emu->stream = player_stream(&emu->player);
|
||||||
struct lpt *lpt = system_get_lpt(emu->stream);
|
struct lpt *lpt = system_get_lpt(emu->stream);
|
||||||
emu->loom = lpt->loom;
|
emu->loom = lpt->loom;
|
||||||
emu->proc = lpt->proc;
|
emu->proc = lpt->proc;
|
||||||
@ -120,7 +120,7 @@ panic(struct emu *emu)
|
|||||||
int
|
int
|
||||||
emu_step(struct emu *emu)
|
emu_step(struct emu *emu)
|
||||||
{
|
{
|
||||||
int ret = emu_player_step(&emu->player);
|
int ret = player_step(&emu->player);
|
||||||
|
|
||||||
/* No more events */
|
/* No more events */
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
@ -128,7 +128,7 @@ emu_step(struct emu *emu)
|
|||||||
|
|
||||||
/* Error happened */
|
/* Error happened */
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
err("emu_player_step failed");
|
err("player_step failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
#include "emu_args.h"
|
#include "emu_args.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "emu_player.h"
|
#include "player.h"
|
||||||
#include "emu_model.h"
|
#include "emu_model.h"
|
||||||
#include "emu_ev.h"
|
#include "emu_ev.h"
|
||||||
#include "recorder.h"
|
#include "recorder.h"
|
||||||
@ -24,7 +24,7 @@ struct emu {
|
|||||||
struct emu_args args;
|
struct emu_args args;
|
||||||
struct trace trace;
|
struct trace trace;
|
||||||
struct system system;
|
struct system system;
|
||||||
struct emu_player player;
|
struct player player;
|
||||||
struct emu_model model;
|
struct emu_model model;
|
||||||
struct recorder recorder;
|
struct recorder recorder;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "emu_player.h"
|
#include "player.h"
|
||||||
|
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "utlist.h"
|
#include "utlist.h"
|
||||||
@ -33,7 +33,7 @@ stream_cmp(heap_node_t *a, heap_node_t *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
step_stream(struct emu_player *player, struct stream *stream)
|
step_stream(struct player *player, struct stream *stream)
|
||||||
{
|
{
|
||||||
if (!stream->active)
|
if (!stream->active)
|
||||||
return +1;
|
return +1;
|
||||||
@ -54,9 +54,9 @@ step_stream(struct emu_player *player, struct stream *stream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
emu_player_init(struct emu_player *player, struct trace *trace)
|
player_init(struct player *player, struct trace *trace)
|
||||||
{
|
{
|
||||||
memset(player, 0, sizeof(struct emu_player));
|
memset(player, 0, sizeof(struct player));
|
||||||
|
|
||||||
heap_init(&player->heap);
|
heap_init(&player->heap);
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ emu_player_init(struct emu_player *player, struct trace *trace)
|
|||||||
/* No more events */
|
/* No more events */
|
||||||
continue;
|
continue;
|
||||||
} else if (ret < 0) {
|
} else if (ret < 0) {
|
||||||
err("emu_player_init: step_stream failed\n");
|
err("player_init: step_stream failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ emu_player_init(struct emu_player *player, struct trace *trace)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
update_clocks(struct emu_player *player, struct stream *stream)
|
update_clocks(struct player *player, struct stream *stream)
|
||||||
{
|
{
|
||||||
/* This can happen if two events are not ordered in the stream, but the
|
/* This can happen if two events are not ordered in the stream, but the
|
||||||
* emulator picks other events in the middle. Example:
|
* emulator picks other events in the middle. Example:
|
||||||
@ -118,7 +118,7 @@ update_clocks(struct emu_player *player, struct stream *stream)
|
|||||||
/* Returns -1 on error, +1 if there are no more events and 0 if next event
|
/* Returns -1 on error, +1 if there are no more events and 0 if next event
|
||||||
* loaded properly */
|
* loaded properly */
|
||||||
int
|
int
|
||||||
emu_player_step(struct emu_player *player)
|
player_step(struct player *player)
|
||||||
{
|
{
|
||||||
/* Add the stream back if still active */
|
/* Add the stream back if still active */
|
||||||
if (player->stream != NULL && step_stream(player, player->stream) < 0) {
|
if (player->stream != NULL && step_stream(player, player->stream) < 0) {
|
||||||
@ -136,12 +136,12 @@ emu_player_step(struct emu_player *player)
|
|||||||
struct stream *stream = heap_elem(node, struct stream, hh);
|
struct stream *stream = heap_elem(node, struct stream, hh);
|
||||||
|
|
||||||
if (stream == NULL) {
|
if (stream == NULL) {
|
||||||
err("emu_player_step: heap_elem() returned NULL\n");
|
err("player_step: heap_elem() returned NULL\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update_clocks(player, stream) != 0) {
|
if (update_clocks(player, stream) != 0) {
|
||||||
err("emu_player_step: update_clocks() failed\n");
|
err("player_step: update_clocks() failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,13 +155,13 @@ emu_player_step(struct emu_player *player)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct emu_ev *
|
struct emu_ev *
|
||||||
emu_player_ev(struct emu_player *player)
|
player_ev(struct player *player)
|
||||||
{
|
{
|
||||||
return &player->ev;
|
return &player->ev;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct stream *
|
struct stream *
|
||||||
emu_player_stream(struct emu_player *player)
|
player_stream(struct player *player)
|
||||||
{
|
{
|
||||||
return player->stream;
|
return player->stream;
|
||||||
}
|
}
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
|
|
||||||
struct emu_player {
|
struct player {
|
||||||
heap_head_t heap;
|
heap_head_t heap;
|
||||||
int64_t firstclock;
|
int64_t firstclock;
|
||||||
int64_t lastclock;
|
int64_t lastclock;
|
||||||
@ -19,9 +19,9 @@ struct emu_player {
|
|||||||
struct emu_ev ev;
|
struct emu_ev ev;
|
||||||
};
|
};
|
||||||
|
|
||||||
int emu_player_init(struct emu_player *player, struct trace *trace);
|
int player_init(struct player *player, struct trace *trace);
|
||||||
int emu_player_step(struct emu_player *player);
|
int player_step(struct player *player);
|
||||||
struct emu_ev *emu_player_ev(struct emu_player *player);
|
struct emu_ev *player_ev(struct player *player);
|
||||||
struct stream *emu_player_stream(struct emu_player *player);
|
struct stream *player_stream(struct player *player);
|
||||||
|
|
||||||
#endif /* EMU_PLAYER_H */
|
#endif /* EMU_PLAYER_H */
|
Loading…
Reference in New Issue
Block a user