Skip to contentSkip to conversation

lttng-module: block.h : Fix build for 3.9 kernel

PATCH Mathieu Desnoyers 1 participant 1 message Mar 25, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines · * [email protected] ([email protected]) wrote:

From: "Maxin B. John" <[email protected]>

commit :3a366e614d0837d9fc23f78cdb1a1186ebc3387f
block: add missing block_bio_complete() tracepoint
added block_bio_complete to 3.9 kernel

commit : 8c1cf6bb02fda79b0a4b9bd121f6be6d4ce7a15a
block: add @req to bio_{front|back}_merge tracepoints
added block_bio_backmerge and block_bio_frontmerge to 3.9 kernel

Update block.h based on these commits in mainline kernel

Disabling the event prior to 3.9.0 does not seem to be the proper solution. We should rather #ifdef the old/new TRACE_EVENT definitions to accept the proper number of arguments for each kernel.

Thanks,

Mathieu

Quoted 67 lines

Fixes this build failure:
....
include/trace/events/block.h:353:1: note: previous definition of 'trace_block_bio_frontmerge' was here
make[3]: *** [/home/majo/kernel/lttng/lttng-modules/probes/ lttng-probe-block.o] Error 1
make[2]: *** [/home/majo/kernel/lttng/lttng-modules/probes] Error 2 make[1]: *** [_module_/home/majo/kernel/lttng/lttng-modules] Error 2
make: *** [default] Error 2

---
 instrumentation/events/lttng-module/block.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
instrumentation/events/lttng-module/block.h +16 -0
index d42ebd4..59bd2c0 100644
@@ -311,6 +311,13 @@ TRACE_EVENT(block_bio_bounce,
  * This tracepoint indicates there is no further work to do on this
  * block IO operation @bio.
  */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+/**
+ * commit :3a366e614d0837d9fc23f78cdb1a1186ebc3387f
+ * block: add missing block_bio_complete() tracepoint
+ * added block_bio_complete to 3.9.0 kernel
+ */
+#else
 TRACE_EVENT(block_bio_complete,
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
@@ -349,6 +356,7 @@ TRACE_EVENT(block_bio_complete,
 		  (unsigned long long)__entry->sector,
 		  __entry->nr_sector, __entry->error)
 )
+#endif
 
 DECLARE_EVENT_CLASS(block_bio,
 
@@ -387,6 +395,13 @@ DECLARE_EVENT_CLASS(block_bio,
  * Merging block request @bio to the end of an existing block request
  * in queue @q.
  */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+/**
+ * commit : 8c1cf6bb02fda79b0a4b9bd121f6be6d4ce7a15a
+ * block: add @req to bio_{front|back}_merge tracepoints
+ * added block_bio_backmerge and block_bio_frontmerge to 3.9.0 kernel
+ */
+#else
 DEFINE_EVENT(block_bio, block_bio_backmerge,
 
 	TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -408,6 +423,7 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge,
 
 	TP_ARGS(q, bio)
 )
+#endif
 
 /**
  * block_bio_queue - putting new block IO operation in queue
Signature · 1 line
1.7.5.4
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com