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]

Re: Systemtap is broken on latest ElRepo LT kernels (4.4.x)


Hi,

On 2019/2/1 17:38, Kirill Borodin wrote:
> Hi, All!
> 
> I've tried all systemtap versions 3.x and 4.x for ELRepo LT-kernels, latest
> kernels are not supported, for example 4.4.169, 4.4.172 (last one) but it
> is working on 4.4.145 !
> 
> If it's known bug, please, point me to the thread
That's because commit 768ae309a961 ("mm: replace get_user_pages() write/force parameters with gup_flags")
is back-ported to linux-stable-4.4 (the corresponding commit is 8e50b8b07f46), and it changes the function
signature of get_user_pages() as showed in the following diff-stat:

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5c18cd9c72d2..d1cfd3657cce 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1199,7 +1199,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                      struct vm_area_struct **vmas, int *nonblocking);
 long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                    unsigned long start, unsigned long nr_pages,
-                   int write, int force, struct page **pages,
+                   unsigned int gup_flags, struct page **pages,
                    struct vm_area_struct **vmas);
 long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm,
                    unsigned long start, unsigned long nr_pages,

Could you please try the attached patch for Systemtap ?

Regards,
Tao
> 
> I've builded systemtap on the same machines where I trying to use it and
> got following errors:
> 
> # stap -ve 'probe begin { log("hello world") exit () }' 2>&1 | less
> 
> 
> Pass 1: parsed user script and 483 library scripts using
> 275600virt/76472res/6872shr/69832data kb, in 650usr/30sys/688real ms.
> 
> Pass 2: analyzed script: 1 probe, 2 functions, 0 embeds, 0 globals using
> 277184virt/78116res/6944shr/71416data kb, in 10usr/0sys/9real ms.
> 
> Pass 3: translated to C into
> "/tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c" using
> 277316virt/79084res/7828shr/71548data kb, in 0usr/0sys/0real ms.
> 
> In file included from /usr/share/systemtap/runtime/linux/runtime.h:214:0,
> 
>                  from /usr/share/systemtap/runtime/runtime.h:26,
> 
>                  from
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c:25:
> 
> /usr/share/systemtap/runtime/linux/access_process_vm.h: In function
> ‘__access_process_vm_’:
> 
> /usr/share/systemtap/runtime/linux/access_process_vm.h:54:7: error: passing
> argument 6 of ‘get_user_pages’ makes pointer from integer without a cast
> [-Werror]
> 
>        ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
> 
>        ^
>> In file included from include/linux/pid_namespace.h:6:0,
> 
>                  from include/linux/ptrace.h:8,
> 
>                  from include/linux/ftrace.h:13,
> 
>                  from include/linux/kprobes.h:42,
> 
>                  from /usr/share/systemtap/runtime/linux/runtime.h:21,
> 
>                  from /usr/share/systemtap/runtime/runtime.h:26,
> 
>                  from
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c:25:
> 
> include/linux/mm.h:1200:6: note: expected ‘struct page **’ but argument is
> of type ‘int’
> 
>  long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> 
>       ^
> 
> In file included from /usr/share/systemtap/runtime/linux/runtime.h:214:0,
> 
>                  from /usr/share/systemtap/runtime/runtime.h:26,
> 
>                  from
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c:25:
> 
> /usr/share/systemtap/runtime/linux/access_process_vm.h:54:7: error: passing
> argument 7 of ‘get_user_pages’ from incompatible pointer type [-Werror]
> 
>        ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
> 
>        ^
> 
> In file included from include/linux/pid_namespace.h:6:0,
> 
>                  from include/linux/ptrace.h:8,
> 
>                  from include/linux/ftrace.h:13,
> 
>                  from include/linux/kprobes.h:42,
> 
>                  from /usr/share/systemtap/runtime/linux/runtime.h:21,
> 
>                  from /usr/share/systemtap/runtime/runtime.h:26,
> 
>                  from
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c:25:
> 
> include/linux/mm.h:1200:6: note: expected ‘struct vm_area_struct **’ but
> argument is of type ‘struct page **’
> 
>  long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> 
>       ^
> 
> In file included from /usr/share/systemtap/runtime/linux/runtime.h:214:0,
> 
>                  from /usr/share/systemtap/runtime/runtime.h:26,
> 
>                  from
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c:25:
> 
> /usr/share/systemtap/runtime/linux/access_process_vm.h:54:7: error: too
> many arguments to function ‘get_user_pages’
> 
>        ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
> 
>        ^
> 
> In file included from include/linux/pid_namespace.h:6:0,
> 
>                  from include/linux/ptrace.h:8,
> 
>                  from include/linux/ftrace.h:13,
> 
>                  from include/linux/kprobes.h:42,
> 
>                  from /usr/share/systemtap/runtime/linux/runtime.h:21,
> 
>                  from /usr/share/systemtap/runtime/runtime.h:26,
> 
>                  from
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c:25:
> 
> include/linux/mm.h:1200:6: note: declared here
> 
>  long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> 
>       ^
> 
> /tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.c: At top
> level:
> 
> cc1: error: unrecognized command line option "-Wno-tautological-compare"
> [-Werror]
> 
> cc1: all warnings being treated as errors
> 
> make[1]: ***
> [/tmp/stap38hdTg/stap_4937637228108ffaaea1709160cfed96_1147_src.o] Error 1
> 
> make: *** [_module_/tmp/stap38hdTg] Error 2
> 
> WARNING: kbuild exited with status: 2
> 
> Pass 4: compiled C into "stap_4937637228108ffaaea1709160cfed96_1147.ko" in
> 8030usr/1810sys/9721real ms.
> 
> Pass 4: compilation failed.  [man error::pass4]
> 
> Thanks!
> 
> .
> 

Attachment: 0001-Fix-get_user_pages-autoconf-test-for-4.4.y-kernel.patch
Description: Text document


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