From 08c2961231914ed8fb83140e3a63169f1769682c Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 22 Aug 2011 10:03:59 -0500 Subject: [PATCH] Convert 4 autoconf tests to exportconf tests. * buildrun.cxx (output_dual_exportconf): New function. (compile_pass): Converted several autoconf tests to exportconf tests. * runtime/autoconf-probe-kernel.c: Removed unneeded autoconf test. * runtime/autoconf-synchronize-sched.c: Ditto. * runtime/autoconf-unregister-kprobes.c: Ditto. * runtime/autoconf-vm-area.c: Ditto. --- buildrun.cxx | 22 ++++++++++++++++++---- runtime/autoconf-probe-kernel.c | 7 ------- runtime/autoconf-synchronize-sched.c | 6 ------ runtime/autoconf-unregister-kprobes.c | 4 ---- runtime/autoconf-vm-area.c | 9 --------- 5 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 runtime/autoconf-probe-kernel.c delete mode 100644 runtime/autoconf-synchronize-sched.c delete mode 100644 runtime/autoconf-unregister-kprobes.c delete mode 100644 runtime/autoconf-vm-area.c diff --git a/buildrun.cxx b/buildrun.cxx index b0dc07021..44ae4aba2 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -140,6 +140,20 @@ void output_exportconf(systemtap_session& s, ofstream& o, const char *symbol, } +void output_dual_exportconf(systemtap_session& s, ofstream& o, + const char *symbol1, const char *symbol2, + const char *deftrue) +{ + o << "\t"; + if (s.verbose < 4) + o << "@"; + if (s.kernel_exports.find(symbol1) != s.kernel_exports.end() + && s.kernel_exports.find(symbol2) != s.kernel_exports.end()) + o << "echo \"#define " << deftrue << " 1\""; + o << ">> $@" << endl; +} + + int compile_pass (systemtap_session& s) { @@ -206,15 +220,15 @@ compile_pass (systemtap_session& s) output_autoconf(s, o, "autoconf-ktime-get-real.c", "STAPCONF_KTIME_GET_REAL", NULL); output_autoconf(s, o, "autoconf-x86-uniregs.c", "STAPCONF_X86_UNIREGS", NULL); output_autoconf(s, o, "autoconf-nameidata.c", "STAPCONF_NAMEIDATA_CLEANUP", NULL); - output_autoconf(s, o, "autoconf-unregister-kprobes.c", "STAPCONF_UNREGISTER_KPROBES", NULL); + output_dual_exportconf(s, o, "unregister_kprobes", "unregister_kretprobes", "STAPCONF_UNREGISTER_KPROBES"); output_autoconf(s, o, "autoconf-kprobe-symbol-name.c", "STAPCONF_KPROBE_SYMBOL_NAME", NULL); output_autoconf(s, o, "autoconf-real-parent.c", "STAPCONF_REAL_PARENT", NULL); output_autoconf(s, o, "autoconf-uaccess.c", "STAPCONF_LINUX_UACCESS_H", NULL); output_autoconf(s, o, "autoconf-oneachcpu-retry.c", "STAPCONF_ONEACHCPU_RETRY", NULL); output_autoconf(s, o, "autoconf-dpath-path.c", "STAPCONF_DPATH_PATH", NULL); - output_autoconf(s, o, "autoconf-synchronize-sched.c", "STAPCONF_SYNCHRONIZE_SCHED", NULL); + output_exportconf(s, o, "synchronize_sched", "STAPCONF_SYNCHRONIZE_SCHED"); output_autoconf(s, o, "autoconf-task-uid.c", "STAPCONF_TASK_UID", NULL); - output_autoconf(s, o, "autoconf-vm-area.c", "STAPCONF_VM_AREA", NULL); + output_dual_exportconf(s, o, "alloc_vm_area", "free_vm_area", "STAPCONF_VM_AREA"); output_autoconf(s, o, "autoconf-procfs-owner.c", "STAPCONF_PROCFS_OWNER", NULL); output_autoconf(s, o, "autoconf-alloc-percpu-align.c", "STAPCONF_ALLOC_PERCPU_ALIGN", NULL); output_autoconf(s, o, "autoconf-x86-gs.c", "STAPCONF_X86_GS", NULL); @@ -228,7 +242,7 @@ compile_pass (systemtap_session& s) output_exportconf(s, o, "__module_text_address", "STAPCONF_MODULE_TEXT_ADDRESS"); output_exportconf(s, o, "add_timer_on", "STAPCONF_ADD_TIMER_ON"); - output_autoconf(s, o, "autoconf-probe-kernel.c", "STAPCONF_PROBE_KERNEL", NULL); + output_dual_exportconf(s, o, "probe_kernel_read", "probe_kernel_write", "STAPCONF_PROBE_KERNEL"); output_autoconf(s, o, "autoconf-hw_breakpoint_context.c", "STAPCONF_HW_BREAKPOINT_CONTEXT", NULL); output_autoconf(s, o, "autoconf-save-stack-trace.c", diff --git a/runtime/autoconf-probe-kernel.c b/runtime/autoconf-probe-kernel.c deleted file mode 100644 index 93fbaae6e..000000000 --- a/runtime/autoconf-probe-kernel.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -void probe_kernel(void *dst, void *src, size_t size) -{ - (void)probe_kernel_read(dst, src, size); - (void)probe_kernel_write(dst, src, size); -} diff --git a/runtime/autoconf-synchronize-sched.c b/runtime/autoconf-synchronize-sched.c deleted file mode 100644 index 0291092e2..000000000 --- a/runtime/autoconf-synchronize-sched.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -void foo (void) -{ - synchronize_sched (); -} diff --git a/runtime/autoconf-unregister-kprobes.c b/runtime/autoconf-unregister-kprobes.c deleted file mode 100644 index 793891daa..000000000 --- a/runtime/autoconf-unregister-kprobes.c +++ /dev/null @@ -1,4 +0,0 @@ -#include - -void * x = (void *)unregister_kprobes; -void * y = (void *)unregister_kretprobes; diff --git a/runtime/autoconf-vm-area.c b/runtime/autoconf-vm-area.c deleted file mode 100644 index 920d103d0..000000000 --- a/runtime/autoconf-vm-area.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -void foo (void) -{ - void *dummy; - dummy = alloc_vm_area (PAGE_SIZE); - free_vm_area (dummy); -} -- 2.43.5