after install systemtap on ubuntu,test example hello-stap.stp。but there are some errors。
how can I fix this?
thanks
systemtap version
Systemtap translator/driver (version 2.9/0.165, Debian version 2.9-2ubuntu2 (xenial))
Copyright (C) 2005-2015 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBSQLITE3 NLS NSS TR1_UNORDERED_MAP
hello-stap.stp
probe begin
{
print("hello world\n")
exit()
}
this is error info。
Error 1:
In file included from /usr/share/systemtap/runtime/linux/runtime.h:204:0, from /usr/share/systemtap/runtime/runtime.h:24, from /tmp/stapd8LhT7/stap_24feca2d4e5abb002d28b0bc184e6d61_945_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:35:29: error: passing argument 1 of ‘get_user_pages’ makes integer from pointer without a cast [-Werror=int-conversion] ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma); ^
I ran into this issue myself. In short, Ubuntu's systemtap package is currently out of date.
Explanation: Sometime ago, the kernel updated the get_user_pages() function, which meant anything using the previous function prototype now failed to compile. This also happened on VMWare's vmmon and vmnet modules. When you run stap, it generates a kernel module source file that uses get_user_pages(), compiles it and loads it into the kernel. But the C code it generates uses the old function definition and therefore fails to build.
Currently no Solution: You can either build SystemTap from source (which I failed to do, but I also did not try very hard) or tell Ubuntu to upgrade their broken systemtap package - I submitted a bug report, maybe you can confirm it.
My solution was to switch to Fedora 26 and run /usr/bin/stap-prep to install the pre-requisites. Worked without any hiccups!