summaryrefslogtreecommitdiffstats
path: root/include/trace/events/fsi_master_i2cr.h
blob: c33eba1300493221aeda087098f68d4453971cfd (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* SPDX-License-Identifier: GPL-2.0-or-later */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM fsi_master_i2cr

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

#include <linux/tracepoint.h>

TRACE_EVENT(i2cr_i2c_error,
	TP_PROTO(const struct i2c_client *client, uint32_t command, int rc),
	TP_ARGS(client, command, rc),
	TP_STRUCT__entry(
		__field(int, bus)
		__field(int, rc)
		__array(unsigned char, command, sizeof(uint32_t))
		__field(unsigned short, addr)
	),
	TP_fast_assign(
		__entry->bus = client->adapter->nr;
		__entry->rc = rc;
		memcpy(__entry->command, &command, sizeof(uint32_t));
		__entry->addr = client->addr;
	),
	TP_printk("%d-%02x command:{ %*ph } rc:%d", __entry->bus, __entry->addr,
		  (int)sizeof(uint32_t), __entry->command, __entry->rc)
);

TRACE_EVENT(i2cr_read,
	TP_PROTO(const struct i2c_client *client, uint32_t command, uint64_t *data),
	TP_ARGS(client, command, data),
	TP_STRUCT__entry(
		__field(int, bus)
		__array(unsigned char, data, sizeof(uint64_t))
		__array(unsigned char, command, sizeof(uint32_t))
		__field(unsigned short, addr)
	),
	TP_fast_assign(
		__entry->bus = client->adapter->nr;
		memcpy(__entry->data, data, sizeof(uint64_t));
		memcpy(__entry->command, &command, sizeof(uint32_t));
		__entry->addr = client->addr;
	),
	TP_printk("%d-%02x command:{ %*ph } { %*ph }", __entry->bus, __entry->addr,
		  (int)sizeof(uint32_t), __entry->command, (int)sizeof(uint64_t), __entry->data)
);

TRACE_EVENT(i2cr_status,
	TP_PROTO(const struct i2c_client *client, uint64_t status),
	TP_ARGS(client, status),
	TP_STRUCT__entry(
		__field(uint64_t, status)
		__field(int, bus)
		__field(unsigned short, addr)
	),
	TP_fast_assign(
		__entry->status = status;
		__entry->bus = client->adapter->nr;
		__entry->addr = client->addr;
	),
	TP_printk("%d-%02x %016llx", __entry->bus, __entry->addr, __entry->status)
);

TRACE_EVENT(i2cr_status_error,
	TP_PROTO(const struct i2c_client *client, uint64_t status, uint64_t error, uint64_t log),
	TP_ARGS(client, status, error, log),
	TP_STRUCT__entry(
		__field(uint64_t, error)
		__field(uint64_t, log)
		__field(uint64_t, status)
		__field(int, bus)
		__field(unsigned short, addr)
	),
	TP_fast_assign(
		__entry->error = error;
		__entry->log = log;
		__entry->status = status;
		__entry->bus = client->adapter->nr;
		__entry->addr = client->addr;
	),
	TP_printk("%d-%02x status:%016llx error:%016llx log:%016llx", __entry->bus, __entry->addr,
		  __entry->status, __entry->error, __entry->log)
);

TRACE_EVENT(i2cr_write,
	TP_PROTO(const struct i2c_client *client, uint32_t command, uint64_t data),
	TP_ARGS(client, command, data),
	TP_STRUCT__entry(
		__field(int, bus)
		__array(unsigned char, data, sizeof(uint64_t))
		__array(unsigned char, command, sizeof(uint32_t))
		__field(unsigned short, addr)
	),
	TP_fast_assign(
		__entry->bus = client->adapter->nr;
		memcpy(__entry->data, &data, sizeof(uint64_t));
		memcpy(__entry->command, &command, sizeof(uint32_t));
		__entry->addr = client->addr;
	),
	TP_printk("%d-%02x command:{ %*ph } { %*ph }", __entry->bus, __entry->addr,
		  (int)sizeof(uint32_t), __entry->command, (int)sizeof(uint64_t), __entry->data)
);

#endif

#include <trace/define_trace.h>