~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/i2c.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /* I2C message transfer tracepoints
  3  *
  4  * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
  5  * Written by David Howells (dhowells@redhat.com)
  6  */
  7 #undef TRACE_SYSTEM
  8 #define TRACE_SYSTEM i2c
  9 
 10 #if !defined(_TRACE_I2C_H) || defined(TRACE_HEADER_MULTI_READ)
 11 #define _TRACE_I2C_H
 12 
 13 #include <linux/i2c.h>
 14 #include <linux/tracepoint.h>
 15 
 16 /*
 17  * drivers/i2c/i2c-core-base.c
 18  */
 19 extern int i2c_transfer_trace_reg(void);
 20 extern void i2c_transfer_trace_unreg(void);
 21 
 22 /*
 23  * __i2c_transfer() write request
 24  */
 25 TRACE_EVENT_FN(i2c_write,
 26                TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg,
 27                         int num),
 28                TP_ARGS(adap, msg, num),
 29                TP_STRUCT__entry(
 30                        __field(int,     adapter_nr              )
 31                        __field(__u16,   msg_nr                  )
 32                        __field(__u16,   addr                    )
 33                        __field(__u16,   flags                   )
 34                        __field(__u16,   len                     )
 35                        __dynamic_array(__u8, buf, msg->len)     ),
 36                TP_fast_assign(
 37                        __entry->adapter_nr = adap->nr;
 38                        __entry->msg_nr = num;
 39                        __entry->addr = msg->addr;
 40                        __entry->flags = msg->flags;
 41                        __entry->len = msg->len;
 42                        memcpy(__get_dynamic_array(buf), msg->buf, msg->len);
 43                               ),
 44                TP_printk("i2c-%d #%u a=%03x f=%04x l=%u [%*phD]",
 45                          __entry->adapter_nr,
 46                          __entry->msg_nr,
 47                          __entry->addr,
 48                          __entry->flags,
 49                          __entry->len,
 50                          __entry->len, __get_dynamic_array(buf)
 51                          ),
 52                i2c_transfer_trace_reg,
 53                i2c_transfer_trace_unreg);
 54 
 55 /*
 56  * __i2c_transfer() read request
 57  */
 58 TRACE_EVENT_FN(i2c_read,
 59                TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg,
 60                         int num),
 61                TP_ARGS(adap, msg, num),
 62                TP_STRUCT__entry(
 63                        __field(int,     adapter_nr              )
 64                        __field(__u16,   msg_nr                  )
 65                        __field(__u16,   addr                    )
 66                        __field(__u16,   flags                   )
 67                        __field(__u16,   len                     )
 68                                 ),
 69                TP_fast_assign(
 70                        __entry->adapter_nr = adap->nr;
 71                        __entry->msg_nr = num;
 72                        __entry->addr = msg->addr;
 73                        __entry->flags = msg->flags;
 74                        __entry->len = msg->len;
 75                               ),
 76                TP_printk("i2c-%d #%u a=%03x f=%04x l=%u",
 77                          __entry->adapter_nr,
 78                          __entry->msg_nr,
 79                          __entry->addr,
 80                          __entry->flags,
 81                          __entry->len
 82                          ),
 83                i2c_transfer_trace_reg,
 84                        i2c_transfer_trace_unreg);
 85 
 86 /*
 87  * __i2c_transfer() read reply
 88  */
 89 TRACE_EVENT_FN(i2c_reply,
 90                TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg,
 91                         int num),
 92                TP_ARGS(adap, msg, num),
 93                TP_STRUCT__entry(
 94                        __field(int,     adapter_nr              )
 95                        __field(__u16,   msg_nr                  )
 96                        __field(__u16,   addr                    )
 97                        __field(__u16,   flags                   )
 98                        __field(__u16,   len                     )
 99                        __dynamic_array(__u8, buf, msg->len)     ),
100                TP_fast_assign(
101                        __entry->adapter_nr = adap->nr;
102                        __entry->msg_nr = num;
103                        __entry->addr = msg->addr;
104                        __entry->flags = msg->flags;
105                        __entry->len = msg->len;
106                        memcpy(__get_dynamic_array(buf), msg->buf, msg->len);
107                               ),
108                TP_printk("i2c-%d #%u a=%03x f=%04x l=%u [%*phD]",
109                          __entry->adapter_nr,
110                          __entry->msg_nr,
111                          __entry->addr,
112                          __entry->flags,
113                          __entry->len,
114                          __entry->len, __get_dynamic_array(buf)
115                          ),
116                i2c_transfer_trace_reg,
117                i2c_transfer_trace_unreg);
118 
119 /*
120  * __i2c_transfer() result
121  */
122 TRACE_EVENT_FN(i2c_result,
123                TP_PROTO(const struct i2c_adapter *adap, int num, int ret),
124                TP_ARGS(adap, num, ret),
125                TP_STRUCT__entry(
126                        __field(int,     adapter_nr              )
127                        __field(__u16,   nr_msgs                 )
128                        __field(__s16,   ret                     )
129                                 ),
130                TP_fast_assign(
131                        __entry->adapter_nr = adap->nr;
132                        __entry->nr_msgs = num;
133                        __entry->ret = ret;
134                               ),
135                TP_printk("i2c-%d n=%u ret=%d",
136                          __entry->adapter_nr,
137                          __entry->nr_msgs,
138                          __entry->ret
139                          ),
140                i2c_transfer_trace_reg,
141                i2c_transfer_trace_unreg);
142 
143 #endif /* _TRACE_I2C_H */
144 
145 /* This part must be outside protection */
146 #include <trace/define_trace.h>
147 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php