Linux Audio

Check our new training course

Loading...
v4.6
 1/* For debugging general purposes */
 2#ifndef __PERF_DEBUG_H
 3#define __PERF_DEBUG_H
 4
 5#include <stdbool.h>
 6#include <string.h>
 7#include "event.h"
 8#include "../ui/helpline.h"
 9#include "../ui/progress.h"
10#include "../ui/util.h"
11
12extern int verbose;
13extern bool quiet, dump_trace;
14extern int debug_ordered_events;
15extern int debug_data_convert;
16
17#ifndef pr_fmt
18#define pr_fmt(fmt) fmt
19#endif
20
21#define pr_err(fmt, ...) \
22	eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
23#define pr_warning(fmt, ...) \
24	eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
25#define pr_info(fmt, ...) \
26	eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
27#define pr_debug(fmt, ...) \
28	eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)
29#define pr_debugN(n, fmt, ...) \
30	eprintf(n, verbose, pr_fmt(fmt), ##__VA_ARGS__)
31#define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
32#define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
33#define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
34
35#define pr_time_N(n, var, t, fmt, ...) \
36	eprintf_time(n, var, t, fmt, ##__VA_ARGS__)
37
38#define pr_oe_time(t, fmt, ...)  pr_time_N(1, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
39#define pr_oe_time2(t, fmt, ...) pr_time_N(2, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
40
41#define STRERR_BUFSIZE	128	/* For the buffer size of strerror_r */
42
43int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
44void trace_event(union perf_event *event);
45
46int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
47int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
48
49void pr_stat(const char *fmt, ...);
50
51int eprintf(int level, int var, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
52int eprintf_time(int level, int var, u64 t, const char *fmt, ...) __attribute__((format(printf, 4, 5)));
53int veprintf(int level, int var, const char *fmt, va_list args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55int perf_debug_option(const char *str);
56void perf_debug_setup(void);
57
58#endif	/* __PERF_DEBUG_H */
v3.1
 1/* For debugging general purposes */
 2#ifndef __PERF_DEBUG_H
 3#define __PERF_DEBUG_H
 4
 5#include <stdbool.h>
 
 6#include "event.h"
 
 
 
 7
 8extern int verbose;
 9extern bool quiet, dump_trace;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
11int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
12void trace_event(union perf_event *event);
13
14struct ui_progress;
 
15
16#ifdef NO_NEWT_SUPPORT
17static inline int ui_helpline__show_help(const char *format __used, va_list ap __used)
18{
19	return 0;
20}
21
22static inline struct ui_progress *ui_progress__new(const char *title __used,
23						   u64 total __used)
24{
25	return (struct ui_progress *)1;
26}
27
28static inline void ui_progress__update(struct ui_progress *self __used,
29				       u64 curr __used) {}
30
31static inline void ui_progress__delete(struct ui_progress *self __used) {}
32#else
33extern char ui_helpline__last_msg[];
34int ui_helpline__show_help(const char *format, va_list ap);
35#include "ui/progress.h"
36#endif
37
38void ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
39void ui__warning_paranoid(void);
40
41#endif	/* __PERF_DEBUG_H */