
#ifndef _INCLUDE_EVENT_LOG_H_
#define _INCLUDE_EVENT_LOG_H_

#ifdef __cplusplus
extern "C" {
#endif

/* イベントログ */
#define CORE_NUM      (1)
#define EVENT_LOG_NUM (0x8000)

typedef struct {
    unsigned int timestamp;
    unsigned int event_code;
} EVT_INFO;

typedef union {
    EVT_INFO info;
    unsigned long long u8_dat;
} EVENT_LOG_INFO;

void event_log_init(void);
void event_log_enable(void);
void event_log_disable(void);
void event_log_lap_on(void);
void event_log_lap_off(void);
void event_log_put(unsigned short event_code, unsigned short option_val);
void event_log_fout(const char *filename);

#define EVENT_LOG_PUT(evcode,optval)     event_log_put(evcode,optval)


/* 処理時間計測 */
typedef enum {
	PROC_PHASE_RAW = 0,
	PROC_PHASE_FFT,
	PROC_PHASE_SBICA,
	PROC_PHASE_LM,
	PROC_PHASE_GHDSS,
	PROC_PHASE_OUTE,
	PROC_PHASE_MAX
} PROC_PHASE;

typedef struct {
	unsigned long cnt;
	double min;
	double max;
	double avg;
	double sta;
} PROC_TIME;

void proc_time_init(void);
void proc_time_sta(PROC_PHASE phase);
void proc_time_end(PROC_PHASE phase);
void proc_time_show(void);

#define PROC_TIME_STA(phase)	proc_time_sta(phase)
#define PROC_TIME_END(phase)	proc_time_end(phase)

#ifdef __cplusplus
}
#endif

#endif /* _INCLUDE_EVENT_LOG_H_ */

