blob: 466e75b4ffee520719a131578c5f912995c77a9a [file] [log] [blame]
Stefan Hajnoczi26f72272010-05-22 19:24:51 +01001/*
2 * Simple trace backend
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2. See
7 * the COPYING file in the top-level directory.
8 *
9 */
10
Lluísedb47ec2011-08-31 20:30:57 +020011#ifndef TRACE_SIMPLE_H
12#define TRACE_SIMPLE_H
Stefan Hajnoczi26f72272010-05-22 19:24:51 +010013
14#include <stdint.h>
Prerna Saxena22890ab2010-06-24 17:04:53 +053015#include <stdbool.h>
16#include <stdio.h>
Stefan Hajnoczi26f72272010-05-22 19:24:51 +010017
18typedef uint64_t TraceEventID;
19
Prerna Saxena22890ab2010-06-24 17:04:53 +053020typedef struct {
21 const char *tp_name;
22 bool state;
23} TraceEvent;
24
Stefan Hajnoczi26f72272010-05-22 19:24:51 +010025void trace0(TraceEventID event);
26void trace1(TraceEventID event, uint64_t x1);
27void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
28void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3);
29void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
30void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5);
31void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6);
Stefan Weil0b2c5082010-11-15 21:17:06 +010032void st_print_trace(FILE *stream, fprintf_function stream_printf);
Stefan Weil0b2c5082010-11-15 21:17:06 +010033void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
Stefan Hajnoczic5ceb522010-07-13 09:26:33 +010034void st_set_trace_file_enabled(bool enable);
35bool st_set_trace_file(const char *file);
36void st_flush_trace_buffer(void);
Stefan Hajnoczi26f72272010-05-22 19:24:51 +010037
Lluísedb47ec2011-08-31 20:30:57 +020038#endif /* TRACE_SIMPLE_H */