summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus_trace.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2016-06-03 15:55:36 -0500
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-03 17:03:23 -0700
commit4f9c5c0bbb9fb4715ca01cd28ba04a3117a9be6f (patch)
treef17ad47a4c802f9aa0d56be4f4c5e372b5b561e3 /drivers/staging/greybus/greybus_trace.h
parent6879dbf15e866565cde7591337c2fcca7440ab6f (diff)
downloadlinux-4f9c5c0bbb9fb4715ca01cd28ba04a3117a9be6f.tar.bz2
greybus: tracing: define bundle traces
Define a new gb_bundle trace point event class, used to trace events associated with the bundle abstraction. Define four basic trace points for this--creation time, drop of last reference, before adding it to its interface and when removed when its interface is destroyed. Signed-off-by: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@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.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus_trace.h b/drivers/staging/greybus/greybus_trace.h
index 80c428d9d1b1..a1dc07038f54 100644
--- a/drivers/staging/greybus/greybus_trace.h
+++ b/drivers/staging/greybus/greybus_trace.h
@@ -16,6 +16,7 @@
struct gb_message;
struct gb_operation;
+struct gb_bundle;
struct gb_host_device;
#define gb_bundle_name(message) \
@@ -161,6 +162,61 @@ DEFINE_OPERATION_EVENT(gb_operation_put_active);
#undef DEFINE_OPERATION_EVENT
+DECLARE_EVENT_CLASS(gb_bundle,
+
+ TP_PROTO(struct gb_bundle *bundle),
+
+ TP_ARGS(bundle),
+
+ TP_STRUCT__entry(
+ __field(u8, intf_id)
+ __field(u8, id)
+ __field(u8, class)
+ __field(size_t, num_cports)
+ ),
+
+ TP_fast_assign(
+ __entry->intf_id = bundle->intf->interface_id;
+ __entry->id = bundle->id;
+ __entry->class = bundle->class;
+ __entry->num_cports = bundle->num_cports;
+ ),
+
+ TP_printk("intf_id=0x%02x id=%02x class=0x%02x num_cports=%zu",
+ __entry->intf_id, __entry->id, __entry->class,
+ __entry->num_cports)
+);
+
+#define DEFINE_BUNDLE_EVENT(name) \
+ DEFINE_EVENT(gb_bundle, name, \
+ TP_PROTO(struct gb_bundle *bundle), \
+ TP_ARGS(bundle))
+
+/*
+ * Occurs after a new bundle is successfully created.
+ */
+DEFINE_BUNDLE_EVENT(gb_bundle_create);
+
+/*
+ * Occurs when the last reference to a bundle has been dropped,
+ * before its resources are freed.
+ */
+DEFINE_BUNDLE_EVENT(gb_bundle_release);
+
+/*
+ * Occurs when a bundle is added to an interface when the interface
+ * is enabled.
+ */
+DEFINE_BUNDLE_EVENT(gb_bundle_add);
+
+/*
+ * Occurs when a registered bundle gets destroyed, normally at the
+ * time an interface is disabled.
+ */
+DEFINE_BUNDLE_EVENT(gb_bundle_destroy);
+
+#undef DEFINE_BUNDLE_EVENT
+
DECLARE_EVENT_CLASS(gb_interface,
TP_PROTO(struct gb_interface *intf),