#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),
#include "greybus.h"
+#include "greybus_trace.h"
#define GB_INTERFACE_DEVICE_ID_BAD 0xff
{
struct gb_interface *intf = to_gb_interface(dev);
+ trace_gb_interface_release(intf);
+
kfree(intf);
}
dev_set_name(&intf->dev, "%s.%u", dev_name(&module->dev),
interface_id);
+ trace_gb_interface_create(intf);
+
return intf;
}
intf->active = true;
+ trace_gb_interface_activate(intf);
+
return 0;
err_hibernate_link:
if (!intf->active)
return;
+ trace_gb_interface_deactivate(intf);
+
gb_interface_route_destroy(intf);
gb_interface_hibernate_link(intf);
gb_interface_unipro_set(intf, false);
intf->enabled = true;
+ trace_gb_interface_enable(intf);
+
return 0;
err_destroy_bundles:
if (!intf->enabled)
return;
+ trace_gb_interface_disable(intf);
+
/*
* Disable the control-connection early to avoid operation timeouts
* when the interface is already gone.
return ret;
}
+ trace_gb_interface_add(intf);
+
dev_info(&intf->dev, "Interface added: VID=0x%08x, PID=0x%08x\n",
intf->vendor_id, intf->product_id);
dev_info(&intf->dev, "DDBL1 Manufacturer=0x%08x, Product=0x%08x\n",
void gb_interface_del(struct gb_interface *intf)
{
if (device_is_registered(&intf->dev)) {
+ trace_gb_interface_del(intf);
+
device_del(&intf->dev);
dev_info(&intf->dev, "Interface removed\n");
}