systemtap/bz1448099.1.patch

56 lines
2.1 KiB
Diff

commit 62640f2ed0deef9355970d216136ad4c49afa3d0
Author: David Smith <dsmith@redhat.com>
Date: Fri Mar 17 09:36:42 2017 -0500
PR21255: Fix missing get_task_mm() declaration.
* buildrun.cxx (compile_pass): Add <linux/sched/mm.h> autoconf test. This
was caused by the following kernel commit:
commit 6e84f31522f931027bf695752087ece278c10d3f
Author: Ingo Molnar <mingo@kernel.org>
Date: Wed Feb 8 18:51:29 2017 +0100
sched/headers: Prepare for new header dependencies before moving
code to <linux/sched/mm.h>
* runtime/linux/access_process_vm.h: Include <linux/sched.h> and, if it
exists, <linux/sched/mm.h>.
* runtime/linux/autoconf-sched-mm.c: New file.
diff --git a/buildrun.cxx b/buildrun.cxx
index aaea64c..644eea9 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -402,6 +402,7 @@ compile_pass (systemtap_session& s)
output_autoconf(s, o, "autoconf-netfilter-4_4.c", "STAPCONF_NETFILTER_V44", NULL);
output_autoconf(s, o, "autoconf-smpcall-5args.c", "STAPCONF_SMPCALL_5ARGS", NULL);
output_autoconf(s, o, "autoconf-smpcall-4args.c", "STAPCONF_SMPCALL_4ARGS", NULL);
+ output_autoconf(s, o, "autoconf-sched-mm.c", "STAPCONF_SCHED_MM_H", NULL);
// used by tapset/timestamp_monotonic.stp
output_exportconf(s, o, "cpu_clock", "STAPCONF_CPU_CLOCK");
diff --git a/runtime/linux/access_process_vm.h b/runtime/linux/access_process_vm.h
index 22a1220..a46b86f 100644
--- a/runtime/linux/access_process_vm.h
+++ b/runtime/linux/access_process_vm.h
@@ -3,6 +3,10 @@
* some distros export it on some architectures. To workaround this inconsistency,
* we copied and pasted it here. Fortunately, everything it calls is exported.
*/
+#include <linux/sched.h>
+#ifdef STAPCONF_SCHED_MM_H
+#include <linux/sched/mm.h>
+#endif
#include <linux/pagemap.h>
#include <asm/cacheflush.h>
diff --git a/runtime/linux/autoconf-sched-mm.c b/runtime/linux/autoconf-sched-mm.c
new file mode 100644
index 0000000..6d3f1c2
--- /dev/null
+++ b/runtime/linux/autoconf-sched-mm.c
@@ -0,0 +1,3 @@
+#include <linux/sched.h>
+#include <linux/sched/mm.h>
+