[PATCH 2/3] kobject: add kobject trace prototypes
From: Shuah Khan
Date: Tue Sep 06 2016 - 13:49:38 EST
Add kobject trace prototypes source file.
Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
---
lib/Makefile | 2 +-
lib/kobject_traces.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
create mode 100644 lib/kobject_traces.c
diff --git a/lib/Makefile b/lib/Makefile
index cfa68eb..0d9819c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -29,7 +29,7 @@ lib-$(CONFIG_MMU) += ioremap.o
lib-$(CONFIG_SMP) += cpumask.o
lib-$(CONFIG_HAS_DMA) += dma-noop.o
-lib-y += kobject.o klist.o
+lib-y += kobject_traces.o kobject.o klist.o
obj-y += lockref.o
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
diff --git a/lib/kobject_traces.c b/lib/kobject_traces.c
new file mode 100644
index 0000000..71b0195
--- /dev/null
+++ b/lib/kobject_traces.c
@@ -0,0 +1,32 @@
+/*
+ * kobject trace points
+ *
+ * Copyright (C) 2016 Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
+ *
+ */
+#include <linux/string.h>
+#include <linux/types.h>
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/kobject.h>
+
+/* kobject_init event */
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_init);
+
+/* kobject_class events */
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_add);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_init_and_add);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_create_and_add);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_set_name);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_get);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_del);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_cleanup);
+
+/* kobject_put() event */
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_put);
+
+/* kobject_move event */
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_move);
+
+/* kobject_rename event */
+EXPORT_TRACEPOINT_SYMBOL_GPL(kobject_rename);
--
2.7.4