Whenever the value T_BUFFER_MAX changes, the tracers had to be recompiled. The only reason why it was needed is because we used some fixed size buffers to read events. This commit removes this restriction. Also, with the basic simulator, this value T_BUFFER_MAX now comes with an #ifdef which would have required some special hackish-level tricks in the tracers, which is not good. Let's just allocate memory when needed.
51 lines
822 B
C
51 lines
822 B
C
#ifndef _EVENT_H_
|
|
#define _EVENT_H_
|
|
|
|
#include "utils.h"
|
|
#include "../T_defs.h"
|
|
#ifdef T_SEND_TIME
|
|
#include <time.h>
|
|
#endif
|
|
|
|
enum event_arg_type {
|
|
EVENT_INT,
|
|
EVENT_ULONG,
|
|
EVENT_STRING,
|
|
EVENT_BUFFER
|
|
};
|
|
|
|
typedef struct {
|
|
enum event_arg_type type;
|
|
//int offset;
|
|
union {
|
|
int i;
|
|
unsigned long ul;
|
|
char *s;
|
|
struct {
|
|
int bsize;
|
|
void *b;
|
|
};
|
|
};
|
|
} event_arg;
|
|
|
|
typedef struct {
|
|
#ifdef T_SEND_TIME
|
|
struct timespec sending_time;
|
|
#endif
|
|
int type;
|
|
char *buffer;
|
|
event_arg e[T_MAX_ARGS];
|
|
int ecount;
|
|
} event;
|
|
|
|
event get_event(int s, OBUF *v, void *d);
|
|
|
|
#ifdef T_SEND_TIME
|
|
event new_event(struct timespec sending_time, int type,
|
|
int length, char *buffer, void *database);
|
|
#else
|
|
event new_event(int type, int length, char *buffer, void *database);
|
|
#endif
|
|
|
|
#endif /* _EVENT_H_ */
|