<div dir="ltr"><div><div><div><div>Hi ! <br><br></div>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 <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748953">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748953</a>).<br><br>In fact, even after applying the "blktrace-test.patch" (<a href="https://bugs.launchpad.net/ubuntu/+source/lttng-modules/+bug/1328335">https://bugs.launchpad.net/ubuntu/+source/lttng-modules/+bug/1328335</a>) 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 :<br><br>--- a/instrumentation/events/lttng-module/block.h<br>+++ b/instrumentation/events/lttng-module/block.h<br>@@ -221,6 +221,62 @@<br> TP_ARGS(q, rq)<br> )<br> <br>+#ifdef CONFIG_VERSION_SIGNATURE<br>+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5) \<br>+ || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \<br>+ || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \<br>+ || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \<br>+ || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0))<br>+<br>+/**<br>+ * block_rq_complete - block IO operation completed by device driver<br>+ * @q: queue containing the block operation request<br>+ * @rq: block operations request<br>+ * @nr_bytes: number of completed bytes<br>+ *<br>+ * The block_rq_complete tracepoint event indicates that some portion<br>+ * of operation request has been completed by the device driver. If<br>+ * the @rq->bio is %NULL, then there is absolutely no additional work to<br>+ * do for the request. If @rq->bio is non-NULL then there is<br>+ * additional work required to complete the request.<br>+ */<br>+TRACE_EVENT(block_rq_complete,<br>+<br>+ TP_PROTO(struct request_queue *q, struct request *rq,<br>+ unsigned int nr_bytes),<br>+<br>+ TP_ARGS(q, rq, nr_bytes),<br>+<br>+ TP_STRUCT__entry(<br>+ __field( dev_t, dev )<br>+ __field( sector_t, sector )<br>+ __field( unsigned int, nr_sector )<br>+ __field( int, errors )<br>+ __field( unsigned int, rwbs )<br>+ __dynamic_array_hex( unsigned char, cmd,<br>+ (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?<br>+ rq->cmd_len : 0)<br>+ ),<br>+<br>+ TP_fast_assign(<br>+ tp_assign(dev, rq->rq_disk ? disk_devt(rq->rq_disk) : 0)<br>+ tp_assign(sector, blk_rq_pos(rq))<br>+ tp_assign(nr_sector, nr_bytes >> 9)<br>+ tp_assign(errors, rq->errors)<br>+ blk_fill_rwbs(rwbs, rq->cmd_flags, nr_bytes)<br>+ tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?<br>+ rq->cmd : NULL)<br>+ ),<br>+<br>+ TP_printk("%d,%d %s (%s) %llu + %u [%d]",<br>+ MAJOR(__entry->dev), MINOR(__entry->dev),<br>+ __entry->rwbs, __get_str(cmd),<br>+ (unsigned long long)__entry->sector,<br>+ __entry->nr_sector, __entry->errors)<br>+)<br>+<br>+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */<br>+<br> /**<br> * block_rq_complete - block IO operation completed by device driver<br> * @q: queue containing the block operation request<br>@@ -239,6 +295,8 @@<br> TP_ARGS(q, rq)<br> )<br> <br>+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */<br>+<br> DECLARE_EVENT_CLASS(block_rq,<br> <br> TP_PROTO(struct request_queue *q, struct request *rq),<br>@@ -341,9 +399,9 @@<br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev ?<br> bio->bi_bdev->bd_dev : 0)<br>- tp_assign(sector, bio->bi_sector)<br>- tp_assign(nr_sector, bio->bi_size >> 9)<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br>+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> tp_memcpy(comm, current->comm, TASK_COMM_LEN)<br> ),<br> <br>@@ -385,14 +443,14 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev->bd_dev)<br>- tp_assign(sector, bio->bi_sector)<br>- tp_assign(nr_sector, bio->bi_size >> 9)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br>+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)<br> #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))<br> tp_assign(error, error)<br> #else<br> tp_assign(error, 0)<br> #endif<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> ),<br> <br> TP_printk("%d,%d %s %llu + %u [%d]",<br>@@ -419,9 +477,9 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev->bd_dev)<br>- tp_assign(sector, bio->bi_sector)<br>- tp_assign(nr_sector, bio->bi_size >> 9)<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br>+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> tp_memcpy(comm, current->comm, TASK_COMM_LEN)<br> ),<br> <br>@@ -485,9 +543,9 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev->bd_dev)<br>- tp_assign(sector, bio->bi_sector)<br>- tp_assign(nr_sector, bio->bi_size >> 9)<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br>+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> tp_memcpy(comm, current->comm, TASK_COMM_LEN)<br> ),<br> <br>@@ -513,9 +571,9 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)<br>- tp_assign(sector, bio->bi_sector)<br>- tp_assign(nr_sector, bio->bi_size >> 9)<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br>+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> tp_memcpy(comm, current->comm, TASK_COMM_LEN)<br> ),<br> <br>@@ -587,10 +645,10 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio ? bio->bi_bdev->bd_dev : 0)<br>- tp_assign(sector, bio ? bio->bi_sector : 0)<br>- tp_assign(nr_sector, bio ? bio->bi_size >> 9 : 0)<br>+ tp_assign(sector, bio ? bio->bi_iter.bi_sector : 0)<br>+ tp_assign(nr_sector, bio ? bio->bi_iter.bi_size >> 9 : 0)<br> blk_fill_rwbs(rwbs, bio ? bio->bi_rw : 0,<br>- bio ? bio->bi_size >> 9 : 0)<br>+ bio ? bio->bi_iter.bi_size >> 9 : 0)<br> tp_memcpy(comm, current->comm, TASK_COMM_LEN)<br> ),<br> <br>@@ -759,9 +817,9 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev->bd_dev)<br>- tp_assign(sector, bio->bi_sector)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br> tp_assign(new_sector, new_sector)<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> tp_memcpy(comm, current->comm, TASK_COMM_LEN)<br> ),<br> <br>@@ -805,11 +863,11 @@<br> <br> TP_fast_assign(<br> tp_assign(dev, bio->bi_bdev->bd_dev)<br>- tp_assign(sector, bio->bi_sector)<br>- tp_assign(nr_sector, bio->bi_size >> 9)<br>+ tp_assign(sector, bio->bi_iter.bi_sector)<br>+ tp_assign(nr_sector, bio->bi_iter.bi_size >> 9)<br> tp_assign(old_dev, dev)<br> tp_assign(old_sector, from)<br>- blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_size)<br>+ blk_fill_rwbs(rwbs, bio->bi_rw, bio->bi_iter.bi_size)<br> ),<br> <br> TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",<br><br></div>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 !<br><br></div>Regards,<br><br></div>Thomas.<br><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-20 16:31 GMT-04:00 Thomas Bertauld <span dir="ltr"><<a href="mailto:thomas.bertauld@gmail.com" target="_blank">thomas.bertauld@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Hi !<br><br></div>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).<br><br></div>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.<br><br></div>For now i only tried with the headless version of Ubuntu 14.04 (<a href="http://www.parallella.org/create-sdcard/" target="_blank">http://www.parallella.org/create-sdcard/</a>) for the Zynq-7010 (the processor itself is a ARM Cortex A9).<br><div><div><br></div><div>The kernel version is 3.14.12, as seen in the error message below<br><br><br></div><div><font size="2"><span style="font-family:times new roman,serif">parallella@parallella:~$ sudo apt-get install lttng-modules-dkms<br>Reading package lists... Done<br>Building dependency tree <br>Reading state information... Done<br>The following extra packages will be installed:<br> dkms<br>The following NEW packages will be installed:<br> dkms lttng-modules-dkms<br>0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.<br>Need to get 286 kB of archives.<br>After this operation, 2816 kB of additional disk space will be used.<br>Do you want to continue? [Y/n] <br>Get:1 <a href="http://ports.ubuntu.com/" target="_blank">http://ports.ubuntu.com/</a> trusty-updates/main dkms all 2.2.0.3-1.1ubuntu5.14.04 [64.6 kB]<br>Get:2 <a href="http://ports.ubuntu.com/" target="_blank">http://ports.ubuntu.com/</a> trusty-updates/universe lttng-modules-dkms all 2.4.0-1ubuntu1.1 [221 kB]<br>Fetched 286 kB in 0s (356 kB/s) <br>Selecting previously unselected package dkms.<br>(Reading database ... 39070 files and directories currently installed.)<br>Preparing to unpack .../dkms_2.2.0.3-1.1ubuntu5.14.04_all.deb ...<br>Unpacking dkms (2.2.0.3-1.1ubuntu5.14.04) ...<br>Selecting previously unselected package lttng-modules-dkms.<br>Preparing to unpack .../lttng-modules-dkms_2.4.0-1ubuntu1.1_all.deb ...<br>Unpacking lttng-modules-dkms (2.4.0-1ubuntu1.1) ...<br>Processing triggers for man-db (2.6.7.1-1ubuntu1) ...<br>Setting up dkms (2.2.0.3-1.1ubuntu5.14.04) ...<br>Setting up lttng-modules-dkms (2.4.0-1ubuntu1.1) ...<br><b>Loading new lttng-modules-2.4.0 DKMS files...<br>First Installation: checking all kernels...<br>dpkg: warning: version '*-*' has bad syntax: version number does not start with digit<br>It is likely that 3.14.12-parallella-xilinx-g40a90c3 belongs to a chroot's host</b></span></font><br><br></div><div>And at this point the installation just stop and i'm back with the prompt.<br></div><div><br></div><div>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.<br><br></div><div>Thanks in advance !<span class=""><font color="#888888"><br><br></font></span></div><span class=""><font color="#888888"><div>Thomas.<br></div></font></span></div></div>
</blockquote></div><br></div></div></div></div></div></div></div></div>