[media] v4l2: move tracepoint generation into separate file
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 6 Aug 2015 12:38:02 +0000 (09:38 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 13:26:33 +0000 (10:26 -0300)
To compile videobuf2-core as a module, the vb2_* tracepoints must be
exported from the videodev module. Instead of exporting vb2 tracepoint
symbols from v4l2-ioctl.c, move the tracepoint generation into a separate
file. This patch fixes the following build error in the modpost stage,
introduced by 2091f5181c66 ("[media] videobuf2: add trace events"):

    ERROR: "__tracepoint_vb2_buf_done" undefined!
    ERROR: "__tracepoint_vb2_dqbuf" undefined!
    ERROR: "__tracepoint_vb2_qbuf" undefined!
    ERROR: "__tracepoint_vb2_buf_queue" undefined!

Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/Makefile
drivers/media/v4l2-core/v4l2-ioctl.c
drivers/media/v4l2-core/v4l2-trace.c [new file with mode: 0644]

index dc3de00d68b5a4d88c140cfa0dfc0f2aa459fb5c..d1dd440d9d9bca321c9ce0ccce3f1678c3f32934 100644 (file)
@@ -13,6 +13,9 @@ endif
 ifeq ($(CONFIG_OF),y)
   videodev-objs += v4l2-of.o
 endif
+ifeq ($(CONFIG_TRACEPOINTS),y)
+  videodev-objs += v4l2-trace.o
+endif
 
 obj-$(CONFIG_VIDEO_V4L2) += videodev.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
index ad7e929179ba4fb1910c44ae0ed6eabf864391a0..4a384fc765b84b5768e5cc06d7c98d4264292905 100644 (file)
@@ -28,7 +28,6 @@
 #include <media/v4l2-device.h>
 #include <media/videobuf2-core.h>
 
-#define CREATE_TRACE_POINTS
 #include <trace/events/v4l2.h>
 
 /* Zero out the end of the struct pointed to by p.  Everything after, but
diff --git a/drivers/media/v4l2-core/v4l2-trace.c b/drivers/media/v4l2-core/v4l2-trace.c
new file mode 100644 (file)
index 0000000..ae10b02
--- /dev/null
@@ -0,0 +1,11 @@
+#include <media/v4l2-common.h>
+#include <media/v4l2-fh.h>
+#include <media/videobuf2-core.h>
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/v4l2.h>
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_buf_done);
+EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_buf_queue);
+EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_dqbuf);
+EXPORT_TRACEPOINT_SYMBOL_GPL(vb2_qbuf);