2010-05-23 02:24:51 +08:00
|
|
|
/*
|
|
|
|
* Simple trace backend
|
|
|
|
*
|
|
|
|
* Copyright IBM, Corp. 2010
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
|
|
|
* the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SIMPLETRACE_H
|
|
|
|
#define SIMPLETRACE_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2010-06-24 19:34:53 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
2010-05-23 02:24:51 +08:00
|
|
|
|
2011-02-27 02:38:39 +08:00
|
|
|
#ifdef CONFIG_SIMPLE_TRACE
|
2010-05-23 02:24:51 +08:00
|
|
|
typedef uint64_t TraceEventID;
|
|
|
|
|
2010-06-24 19:34:53 +08:00
|
|
|
typedef struct {
|
|
|
|
const char *tp_name;
|
|
|
|
bool state;
|
|
|
|
} TraceEvent;
|
|
|
|
|
2010-05-23 02:24:51 +08:00
|
|
|
void trace0(TraceEventID event);
|
|
|
|
void trace1(TraceEventID event, uint64_t x1);
|
|
|
|
void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
|
|
|
|
void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3);
|
|
|
|
void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
|
|
|
|
void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5);
|
|
|
|
void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6);
|
2010-11-16 04:17:06 +08:00
|
|
|
void st_print_trace(FILE *stream, fprintf_function stream_printf);
|
|
|
|
void st_print_trace_events(FILE *stream, fprintf_function stream_printf);
|
2010-10-14 03:14:29 +08:00
|
|
|
bool st_change_trace_event_state(const char *tname, bool tstate);
|
2010-11-16 04:17:06 +08:00
|
|
|
void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
|
2010-07-13 16:26:33 +08:00
|
|
|
void st_set_trace_file_enabled(bool enable);
|
|
|
|
bool st_set_trace_file(const char *file);
|
|
|
|
void st_flush_trace_buffer(void);
|
2011-03-14 04:14:30 +08:00
|
|
|
bool st_init(const char *file);
|
2011-02-27 02:38:39 +08:00
|
|
|
#else
|
2011-03-14 04:14:30 +08:00
|
|
|
static inline bool st_init(const char *file)
|
2011-02-27 02:38:39 +08:00
|
|
|
{
|
2011-03-14 04:14:30 +08:00
|
|
|
return true;
|
2011-02-27 02:38:39 +08:00
|
|
|
}
|
|
|
|
#endif /* !CONFIG_SIMPLE_TRACE */
|
2010-05-23 02:24:51 +08:00
|
|
|
|
|
|
|
#endif /* SIMPLETRACE_H */
|