This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix taskfinder2.c for kernels missing the dentry macro


The dentry macro has been removed from recent (3.18) kernels (http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=78d28e651f97866d608d9b41f8ad291e65d47dd5).  This was causing the following failure for systemtap:


**** failed systemtap kernel-devel smoke test:

In file included from /run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_finder.c:17:0,
                 from /run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/linux/runtime.h:214,
                 from /run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/runtime.h:24,
                 from /tmp/stapfmPxz9/stap_7a9281a1c17aed50a52460964c1c5e20_1765_src.c:31:
/run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_finder2.c: In function '__stp_call_mmap_callbacks_with_addr':
/run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_finder2.c:695:24: error: 'struct file' has no member named 'f_dentry'
   dentry = vma->vm_file->f_dentry;
                        ^
/run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_finder2.c: In function '__stp_call_mmap_callbacks_for_task':
/run/media/wcohen/wasteland/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_finder2.c:1198:42: error: 'struct file' has no member named 'f_dentry'
        vma_cache_p->dentry = vma->vm_file->f_dentry;
                                          ^
make[4]: *** [/tmp/stapfmPxz9/stap_7a9281a1c17aed50a52460964c1c5e20_1765_src.o] Error 1
make[3]: *** [_module_/tmp/stapfmPxz9] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]

**** aborting testing.


The attached patch does allow things to compile and the tests to run, but I am not entirely sure that the patch does the right thing by omitting the setting of dentry.  Does the patch look right?

-Will
diff --git a/runtime/linux/task_finder2.c b/runtime/linux/task_finder2.c
index 6195c7c..f4b80b3 100644
--- a/runtime/linux/task_finder2.c
+++ b/runtime/linux/task_finder2.c
@@ -692,7 +692,9 @@ __stp_call_mmap_callbacks_with_addr(struct stap_task_finder_target *tgt,
 		length = vma->vm_end - vma->vm_start;
 		offset = (vma->vm_pgoff << PAGE_SHIFT);
 		vm_flags = vma->vm_flags;
+#ifndef STAPCONF_DPATH_PATH
 		dentry = vma->vm_file->f_dentry;
+#endif
 
 		// Allocate space for a path
 		mmpath_buf = _stp_kmalloc(PATH_MAX);
@@ -1195,7 +1197,6 @@ __stp_call_mmap_callbacks_for_task(struct stap_task_finder_target *tgt,
 			    vma_cache_p->f_vfsmnt = vma->vm_file->f_vfsmnt;
 			    mntget(vma_cache_p->f_vfsmnt);
 #endif
-			    vma_cache_p->dentry = vma->vm_file->f_dentry;
 			    vma_cache_p->addr = vma->vm_start;
 			    vma_cache_p->length = vma->vm_end - vma->vm_start;
 			    vma_cache_p->offset = (vma->vm_pgoff << PAGE_SHIFT);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]