[lttng-dev] LTTng-modules install failed on a Parallella

Thomas Bertauld thomas.bertauld at gmail.com
Fri Jun 5 11:30:23 EDT 2015


Hi !

While solving my problem (I had to rebuild the kernel since there were some
configurations file for the modules missing and I didn't have access to the
headers of the distribution in the repositories), I encoutered what seemed
to be an incompatibility between the lttng-modules "block.h" code and some
of the libraries of the 3.14.12 kernel, especially with the bio struct (see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748953).

In fact, even after applying the "blktrace-test.patch" (
https://bugs.launchpad.net/ubuntu/+source/lttng-modules/+bug/1328335) there
were still problems with the use of "bio->bi_sector" in the "block.h" code.
So I made a little patch correcting the use of the structure, and now
everything work fine :

--- a/instrumentation/events/lttng-module/block.h
+++ b/instrumentation/events/lttng-module/block.h
@@ -221,6 +221,62 @@
     TP_ARGS(q, rq)
 )

+#ifdef CONFIG_VERSION_SIGNATURE
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5)    \
+    || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0)        \
+    || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0)        \
+    || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0)        \
+    || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0))
+
+/**
+ * block_rq_complete - block IO operation completed by device driver
+ * @q: queue containing the block operation request
+ * @rq: block operations request
+ * @nr_bytes: number of completed bytes
+ *
+ * The block_rq_complete tracepoint event indicates that some portion
+ * of operation request has been completed by the device driver.  If
+ * the @rq->bio is %NULL, then there is absolutely no additional work to
+ * do for the request. If @rq->bio is non-NULL then there is
+ * additional work required to complete the request.
+ */
+TRACE_EVENT(block_rq_complete,
+
+    TP_PROTO(struct request_queue *q, struct request *rq,
+         unsigned int nr_bytes),
+
+    TP_ARGS(q, rq, nr_bytes),
+
+    TP_STRUCT__entry(
+        __field(  dev_t,    dev            )
+        __field(  sector_t,    sector            )
+        __field(  unsigned int,    nr_sector        )
+        __field(  int,        errors            )
+        __field(  unsigned int,    rwbs            )
+        __dynamic_array_hex( unsigned char,    cmd,
+            (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                rq->cmd_len : 0)
+    ),
+
+    TP_fast_assign(
+        tp_assign(dev, rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
+        tp_assign(sector, blk_rq_pos(rq))
+        tp_assign(nr_sector, nr_bytes >> 9)
+        tp_assign(errors, rq->errors)
+        blk_fill_rwbs(rwbs, rq->cmd_flags, nr_bytes)
+        tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                    rq->cmd : NULL)
+    ),
+
+    TP_printk("%d,%d %s (%s) %llu + %u [%d]",
+          MAJOR(__entry->dev), MINOR(__entry->dev),
+          __entry->rwbs, __get_str(cmd),
+          (unsigned long long)__entry->sector,
+          __entry->nr_sector, __entry->errors)
+)
+
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
+
 /**
  * block_rq_complete - block IO operation completed by device driver
  * @q: queue containing the block operation request
@@ -239,6 +295,8 @@
     TP_ARGS(q, rq)
 )

+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
+
 DECLARE_EVENT_CLASS(block_rq,

     TP_PROTO(struct request_queue *q, struct request *rq),
@@ -341,9 +399,9 @@
     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev ?
                       bio->bi_bdev->bd_dev : 0)
-        tp_assign(sector, bio->bi_sector)
-        tp_assign(nr_sector, bio->bi_size >> 9)
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        tp_assign(sector, bio->bi_iter.bi_sector)
+        tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
         tp_memcpy(comm, current->comm, TASK_COMM_LEN)
     ),

@@ -385,14 +443,14 @@

     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev->bd_dev)
-        tp_assign(sector, bio->bi_sector)
-        tp_assign(nr_sector, bio->bi_size >> 9)
+        tp_assign(sector, bio->bi_iter.bi_sector)
+        tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
         tp_assign(error, error)
 #else
         tp_assign(error, 0)
 #endif
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
     ),

     TP_printk("%d,%d %s %llu + %u [%d]",
@@ -419,9 +477,9 @@

     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev->bd_dev)
-        tp_assign(sector, bio->bi_sector)
-        tp_assign(nr_sector, bio->bi_size >> 9)
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        tp_assign(sector, bio->bi_iter.bi_sector)
+        tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
         tp_memcpy(comm, current->comm, TASK_COMM_LEN)
     ),

@@ -485,9 +543,9 @@

     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev->bd_dev)
-        tp_assign(sector, bio->bi_sector)
-        tp_assign(nr_sector, bio->bi_size >> 9)
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        tp_assign(sector, bio->bi_iter.bi_sector)
+        tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
         tp_memcpy(comm, current->comm, TASK_COMM_LEN)
     ),

@@ -513,9 +571,9 @@

     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
-        tp_assign(sector, bio->bi_sector)
-        tp_assign(nr_sector, bio->bi_size >> 9)
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        tp_assign(sector, bio->bi_iter.bi_sector)
+        tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
         tp_memcpy(comm, current->comm, TASK_COMM_LEN)
     ),

@@ -587,10 +645,10 @@

     TP_fast_assign(
         tp_assign(dev, bio ? bio->bi_bdev->bd_dev : 0)
-        tp_assign(sector, bio ? bio->bi_sector : 0)
-        tp_assign(nr_sector, bio ? bio->bi_size >> 9 : 0)
+        tp_assign(sector, bio ? bio->bi_iter.bi_sector : 0)
+        tp_assign(nr_sector, bio ? bio->bi_iter.bi_size >> 9 : 0)
         blk_fill_rwbs(rwbs, bio ? bio->bi_rw : 0,
-                  bio ? bio->bi_size >> 9 : 0)
+                  bio ? bio->bi_iter.bi_size >> 9 : 0)
         tp_memcpy(comm, current->comm, TASK_COMM_LEN)
         ),

@@ -759,9 +817,9 @@

     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev->bd_dev)
-        tp_assign(sector, bio->bi_sector)
+        tp_assign(sector, bio->bi_iter.bi_sector)
         tp_assign(new_sector, new_sector)
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
         tp_memcpy(comm, current->comm, TASK_COMM_LEN)
     ),

@@ -805,11 +863,11 @@

     TP_fast_assign(
         tp_assign(dev, bio->bi_bdev->bd_dev)
-        tp_assign(sector, bio->bi_sector)
-        tp_assign(nr_sector, bio->bi_size >> 9)
+        tp_assign(sector, bio->bi_iter.bi_sector)
+        tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)
         tp_assign(old_dev, dev)
         tp_assign(old_sector, from)
-        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)
+        blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)
     ),

     TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",

Maybe it already was a known issue I'm not aware of and in this case i'm
sorry for the long post, otherwise i hope it can be useful for some people !

Regards,

Thomas.

2015-05-20 16:31 GMT-04:00 Thomas Bertauld <thomas.bertauld at gmail.com>:

> Hi !
>
> I recently began to work on a Parallella board and I wanted to try tracing
> the ARM processor with LTTng before doing ant work with the Epiphany chip
> (co-processor).
>
> Nevertheless, i'm stuck with an error anytime i try to install the
> lttng-modules. I've tried installing it from the official repositories and
> from the PPA but none worked.
>
> For now i only tried with the headless version of Ubuntu 14.04 (
> http://www.parallella.org/create-sdcard/) for the Zynq-7010 (the
> processor itself is a ARM Cortex A9).
>
> The kernel version is 3.14.12, as seen in the error message below
>
>
> parallella at parallella:~$ sudo apt-get install lttng-modules-dkms
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following extra packages will be installed:
>   dkms
> The following NEW packages will be installed:
>   dkms lttng-modules-dkms
> 0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
> Need to get 286 kB of archives.
> After this operation, 2816 kB of additional disk space will be used.
> Do you want to continue? [Y/n]
> Get:1 http://ports.ubuntu.com/ trusty-updates/main dkms all
> 2.2.0.3-1.1ubuntu5.14.04 [64.6 kB]
> Get:2 http://ports.ubuntu.com/ trusty-updates/universe lttng-modules-dkms
> all 2.4.0-1ubuntu1.1 [221 kB]
> Fetched 286 kB in 0s (356 kB/s)
> Selecting previously unselected package dkms.
> (Reading database ... 39070 files and directories currently installed.)
> Preparing to unpack .../dkms_2.2.0.3-1.1ubuntu5.14.04_all.deb ...
> Unpacking dkms (2.2.0.3-1.1ubuntu5.14.04) ...
> Selecting previously unselected package lttng-modules-dkms.
> Preparing to unpack .../lttng-modules-dkms_2.4.0-1ubuntu1.1_all.deb ...
> Unpacking lttng-modules-dkms (2.4.0-1ubuntu1.1) ...
> Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
> Setting up dkms (2.2.0.3-1.1ubuntu5.14.04) ...
> Setting up lttng-modules-dkms (2.4.0-1ubuntu1.1) ...
>
>
>
> *Loading new lttng-modules-2.4.0 DKMS files...First Installation: checking
> all kernels...dpkg: warning: version '*-*' has bad syntax: version number
> does not start with digitIt is likely that
> 3.14.12-parallella-xilinx-g40a90c3 belongs to a chroot's host*
>
> And at this point the installation just stop and i'm back with the prompt.
>
> Since i'm quite new in the LTTng universe i don't know what to do. I made
> some researches on the subject but there was nothing for the Parallella. I
> only found an answer for a similar problem suggesting to install the kernel
> causing this trouble in the chroot environment, but i'm not quite sure how
> to do this properly.
>
> Thanks in advance !
>
> Thomas.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150605/9ef15ecd/attachment-0001.html>


More information about the lttng-dev mailing list