summaryrefslogtreecommitdiff
path: root/drivers/video/adf/adf_trace.h
blob: 3cb2a84d728c09f79cb7bb907c45ace4f838530e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * Copyright (C) 2013 Google, Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM adf

#if !defined(__VIDEO_ADF_ADF_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define __VIDEO_ADF_ADF_TRACE_H

#include <linux/tracepoint.h>
#include <video/adf.h>

TRACE_EVENT(adf_event,
	TP_PROTO(struct adf_obj *obj, enum adf_event_type type),
	TP_ARGS(obj, type),

	TP_STRUCT__entry(
		__string(name, obj->name)
		__field(enum adf_event_type, type)
		__array(char, type_str, 32)
	),
	TP_fast_assign(
		__assign_str(name, obj->name);
		__entry->type = type;
		strlcpy(__entry->type_str, adf_event_type_str(obj, type),
				sizeof(__entry->type_str));
	),
	TP_printk("obj=%s type=%u (%s)",
			__get_str(name),
			__entry->type,
			__entry->type_str)
);

TRACE_EVENT(adf_event_enable,
	TP_PROTO(struct adf_obj *obj, enum adf_event_type type),
	TP_ARGS(obj, type),

	TP_STRUCT__entry(
		__string(name, obj->name)
		__field(enum adf_event_type, type)
		__array(char, type_str, 32)
	),
	TP_fast_assign(
		__assign_str(name, obj->name);
		__entry->type = type;
		strlcpy(__entry->type_str, adf_event_type_str(obj, type),
				sizeof(__entry->type_str));
	),
	TP_printk("obj=%s type=%u (%s)",
			__get_str(name),
			__entry->type,
			__entry->type_str)
);

TRACE_EVENT(adf_event_disable,
	TP_PROTO(struct adf_obj *obj, enum adf_event_type type),
	TP_ARGS(obj, type),

	TP_STRUCT__entry(
		__string(name, obj->name)
		__field(enum adf_event_type, type)
		__array(char, type_str, 32)
	),
	TP_fast_assign(
		__assign_str(name, obj->name);
		__entry->type = type;
		strlcpy(__entry->type_str, adf_event_type_str(obj, type),
				sizeof(__entry->type_str));
	),
	TP_printk("obj=%s type=%u (%s)",
			__get_str(name),
			__entry->type,
			__entry->type_str)
);

#endif /* __VIDEO_ADF_ADF_TRACE_H */

#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE adf_trace
#include <trace/define_trace.h>