diff options
author | Alex Elder <elder@linaro.org> | 2016-05-23 23:05:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-05-26 22:37:19 -0700 |
commit | cb4c8441e5dac4994ab63c1426babda3102beda9 (patch) | |
tree | 91ec3a21247a992ea2abddc17eaca940f0b94c68 /drivers/staging/greybus/greybus_trace.h | |
parent | 5451ea0e99cb7d58cbf90c7785cb50cc322a4434 (diff) | |
download | op-kernel-dev-cb4c8441e5dac4994ab63c1426babda3102beda9.zip op-kernel-dev-cb4c8441e5dac4994ab63c1426babda3102beda9.tar.gz |
greybus: tracing: define interface traces
Define a new gb_module trace point event class, used to trace events
associated with the interface abstraction. Define four basic trace
points for this--creation time, drop of last reference, before
registring interfaces and after de-registering them. In addition,
define traces for activating and deactivating, and enabling and
disabling an interface.
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/greybus_trace.h')
-rw-r--r-- | drivers/staging/greybus/greybus_trace.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus_trace.h b/drivers/staging/greybus/greybus_trace.h index ecf2253..93e04a8 100644 --- a/drivers/staging/greybus/greybus_trace.h +++ b/drivers/staging/greybus/greybus_trace.h @@ -209,6 +209,86 @@ DEFINE_MODULE_EVENT(gb_module_del); #undef DEFINE_MODULE_EVENT +DECLARE_EVENT_CLASS(gb_interface, + + TP_PROTO(struct gb_interface *intf), + + TP_ARGS(intf), + + TP_STRUCT__entry( + __field(u8, id) /* Interface id */ + __field(u8, module_id) + __field(u8, device_id) + __field(bool, disconnected) + __field(bool, ejected) + __field(bool, active) + __field(bool, enabled) + ), + + TP_fast_assign( + __entry->id = intf->interface_id; + __entry->module_id = intf->module->module_id; + __entry->device_id = intf->device_id; + __entry->disconnected = intf->disconnected; + __entry->ejected = intf->ejected; + __entry->active = intf->active; + __entry->enabled = intf->enabled; + ), + + TP_printk("greybus: intf_id=%hhu device_id=%hhu module_id=%hhu D=%u J=%u A=%u E=%u", + __entry->id, __entry->device_id, __entry->module_id, + __entry->disconnected, __entry->ejected, __entry->active, + __entry->enabled) +); + +#define DEFINE_INTERFACE_EVENT(name) \ + DEFINE_EVENT(gb_interface, name, \ + TP_PROTO(struct gb_interface *intf), \ + TP_ARGS(intf)) + +/* + * Occurs after a new interface is successfully created. + */ +DEFINE_INTERFACE_EVENT(gb_interface_create); + +/* + * Occurs after the last reference to an interface has been dropped. + */ +DEFINE_INTERFACE_EVENT(gb_interface_release); + +/* + * Occurs after an interface been registerd. + */ +DEFINE_INTERFACE_EVENT(gb_interface_add); + +/* + * Occurs when a registered interface gets deregisterd. + */ +DEFINE_INTERFACE_EVENT(gb_interface_del); + +/* + * Occurs when a registered interface has been successfully + * activated. + */ +DEFINE_INTERFACE_EVENT(gb_interface_activate); + +/* + * Occurs when an activated interface is being deactivated. + */ +DEFINE_INTERFACE_EVENT(gb_interface_deactivate); + +/* + * Occurs when an interface has been successfully enabled. + */ +DEFINE_INTERFACE_EVENT(gb_interface_enable); + +/* + * Occurs when an enabled interface is being disabled. + */ +DEFINE_INTERFACE_EVENT(gb_interface_disable); + +#undef DEFINE_INTERFACE_EVENT + DECLARE_EVENT_CLASS(gb_host_device, TP_PROTO(struct gb_host_device *hd), |