diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-08-25 11:54:15 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-08-25 12:31:14 -0400 |
commit | d27e6fd532200873fe8cc23a155360114fe26110 (patch) | |
tree | cb3644c25555116bcf3070251cb89362ffee3d8c | |
parent | f0a68636d44065dfd60e685924b82e95195c0f9f (diff) | |
download | systemtap-steved-d27e6fd532200873fe8cc23a155360114fe26110.tar.gz systemtap-steved-d27e6fd532200873fe8cc23a155360114fe26110.tar.xz systemtap-steved-d27e6fd532200873fe8cc23a155360114fe26110.zip |
PR4186 cont'd: option #2: standardize on kernel ARCH/SUBARCH throughout
* main.cxx (main): Perform equivalent sed by hand on uname()->machine.
* stap.1.in: Clarify -a ARCH slightly.
* tapsets.cxx (validate_module_elf): Accept "arm*"for EM_ARM.
* tapset/**, testsuite/**: Removed/collapsed "i386"/"i686" branches,
renamed "ppc64"->"powerpc" and "s390x"->"s390".
-rw-r--r-- | main.cxx | 27 | ||||
-rw-r--r-- | stap.1.in | 5 | ||||
-rw-r--r-- | tapset/nd_syscalls2.stp | 12 | ||||
-rw-r--r-- | tapset/powerpc/nd_syscalls.stp (renamed from tapset/ppc64/nd_syscalls.stp) | 0 | ||||
-rw-r--r-- | tapset/powerpc/registers.stp (renamed from tapset/ppc64/registers.stp) | 0 | ||||
-rw-r--r-- | tapset/powerpc/syscalls.stp (renamed from tapset/ppc64/syscalls.stp) | 0 | ||||
-rw-r--r-- | tapset/s390/nd_syscalls.stp (renamed from tapset/s390x/nd_syscalls.stp) | 2 | ||||
-rw-r--r-- | tapset/s390/registers.stp (renamed from tapset/s390x/registers.stp) | 0 | ||||
-rw-r--r-- | tapset/s390/syscalls.stp (renamed from tapset/s390x/syscalls.stp) | 2 | ||||
-rw-r--r-- | tapset/scheduler.stp | 2 | ||||
-rw-r--r-- | tapset/syscalls2.stp | 6 | ||||
-rw-r--r-- | tapsets.cxx | 3 | ||||
-rwxr-xr-x | testsuite/parseok/fourteen.stp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/utrace_syscall_args.stp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.context/num_args.stp | 9 | ||||
-rw-r--r-- | testsuite/systemtap.stress/current.stp | 2 |
16 files changed, 43 insertions, 31 deletions
@@ -462,12 +462,25 @@ main (int argc, char * const argv []) s.kernel_release = string (buf.release); s.kernel_build_tree = "/lib/modules/" + s.kernel_release + "/build"; - // Copy logic from coreutils uname (uname -i) to squash i?86 -> i386 - if (strlen(buf.machine)==4 && buf.machine[0] == 'i' && - buf.machine[2] == '8' && buf.machine[3] == '6') - buf.machine[1] = '3'; - - s.architecture = string (buf.machine); + // PR4186: Copy logic from coreutils uname (uname -i) to squash + // i?86->i386. Actually, copy logic from linux top-level Makefile + // to squash uname -m -> $(SUBARCH). + + string machine = buf.machine; + if (machine == "i486") machine = "i386"; + else if (machine == "i586") machine = "i386"; + else if (machine == "i686") machine = "i386"; + else if (machine == "sun4u") machine = "sparc64"; + else if (machine.substr(0,3) == "arm") machine = "arm"; + else if (machine == "sa110") machine = "arm"; + else if (machine == "s390x") machine = "s390"; + else if (machine.substr(0,3) == "ppc") machine = "powerpc"; + else if (machine.substr(0,4) == "mips") machine = "mips"; + else if (machine.substr(0,3) == "sh2") machine = "sh"; + else if (machine.substr(0,3) == "sh3") machine = "sh"; + else if (machine.substr(0,3) == "sh4") machine = "sh"; + + s.architecture = machine; for (unsigned i=0; i<5; i++) s.perpass_verbose[i]=0; s.timing = false; s.guru_mode = false; @@ -875,7 +888,7 @@ main (int argc, char * const argv []) // Warn in case the target kernel release doesn't match the running one. if (s.last_pass > 4 && (string(buf.release) != s.kernel_release || - string(buf.machine) != s.architecture)) + machine != s.architecture)) // NB: squashed ARCH by PR4186 logic { if(! s.suppress_warnings) cerr << "WARNING: kernel release/architecture mismatch with host forces last-pass 4." << endl; @@ -336,8 +336,9 @@ by .PP If, on the other hand, the first part is the identifier .BR arch -to refer to the processor architecture, then the second part -then the second part is one of the two string comparison operators +to refer to the processor architecture (as named by the kernel +build system ARCH/SUBARCH), then the second part then the second +part is one of the two string comparison operators .BR == " or " != , and the third part is a string literal for matching it. This comparison is a wildcard (mis)match. diff --git a/tapset/nd_syscalls2.stp b/tapset/nd_syscalls2.stp index c93bf9f7..6e50d256 100644 --- a/tapset/nd_syscalls2.stp +++ b/tapset/nd_syscalls2.stp @@ -337,7 +337,7 @@ probe nd_syscall.pipe = kprobe.function("SyS_pipe") ?, %: // fildes_uaddr = $fildes // argstr = _fildes_u($fildes) - %( arch != "ppc64" %? asmlinkage() %) + %( arch != "powerpc" %? asmlinkage() %) fildes_uaddr = pointer_arg(1) argstr = _fildes_u(fildes_uaddr) %) @@ -663,7 +663,7 @@ probe nd_syscall.pwrite32 = kprobe.function("sys32_pwrite64") ? // buf_uaddr = $buf // count = $count // offset = ($poshi << 32) + $poslo -// %( arch == "s390x" %? +// %( arch == "s390" %? // buf_uaddr = $ubuf // argstr = sprintf("%d, %s, %d, %d", $fd, // text_strn(user_string($ubuf), syscall_string_trunc, 1), @@ -870,7 +870,7 @@ probe nd_syscall.readv = kprobe.function("compat_sys_readv") ?, // vector_uaddr = $vec // count = $vlen /* FIXME: RHEL4 U3 ppc64 can't resolve $fd */ -// %( arch != "ppc64" %? +// %( arch != "powerpc" %? // fd = $fd // argstr = sprintf("%d, %p, %d", $fd, $vec, $vlen) // %: @@ -2974,7 +2974,7 @@ probe nd_syscall.sigaction = kprobe.function("sys_sigaction") ? // act_uaddr = $act // oact_uaddr = $oact // argstr = sprintf("%s, {%s}, %p", _signal_name($sig), _struct_sigaction_u($act), $oact) - %( arch != "ppc64" %? asmlinkage() %) + %( arch != "powerpc" %? asmlinkage() %) sig = int_arg(1) act_uaddr = pointer_arg(2) oact_uaddr = pointer_arg(3) @@ -3994,7 +3994,7 @@ probe nd_syscall.uname = kprobe.function("sys_uname") ?, _func_name = probefunc() if (_func_name != "sys32_uname") { if (_func_name == "sys_uname" || _func_name == "sys_olduname") { - %( arch != "ppc64" %? asmlinkage() %) + %( arch != "powerpc" %? asmlinkage() %) } else asmlinkage() } @@ -4465,7 +4465,7 @@ probe nd_syscall.writev = kprobe.function("compat_sys_writev") ?, // vector_uaddr = $vec // count = $vlen /* FIXME: RHEL4 U3 ppc64 can't resolve $fd */ -// %( arch != "ppc64" %? +// %( arch != "powerpc" %? // fd = $fd // argstr = sprintf("%d, %p, %d", $fd, $vec, $vlen) // %: diff --git a/tapset/ppc64/nd_syscalls.stp b/tapset/powerpc/nd_syscalls.stp index 46267507..46267507 100644 --- a/tapset/ppc64/nd_syscalls.stp +++ b/tapset/powerpc/nd_syscalls.stp diff --git a/tapset/ppc64/registers.stp b/tapset/powerpc/registers.stp index c8713e5a..c8713e5a 100644 --- a/tapset/ppc64/registers.stp +++ b/tapset/powerpc/registers.stp diff --git a/tapset/ppc64/syscalls.stp b/tapset/powerpc/syscalls.stp index 0518d486..0518d486 100644 --- a/tapset/ppc64/syscalls.stp +++ b/tapset/powerpc/syscalls.stp diff --git a/tapset/s390x/nd_syscalls.stp b/tapset/s390/nd_syscalls.stp index 63435265..bd5f5c32 100644 --- a/tapset/s390x/nd_syscalls.stp +++ b/tapset/s390/nd_syscalls.stp @@ -1,6 +1,6 @@ # S390-specific system calls -%(arch == "s390x" %? +%(arch == "s390" %? # getresgid __________________________________________________ # long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid) diff --git a/tapset/s390x/registers.stp b/tapset/s390/registers.stp index 79482b73..79482b73 100644 --- a/tapset/s390x/registers.stp +++ b/tapset/s390/registers.stp diff --git a/tapset/s390x/syscalls.stp b/tapset/s390/syscalls.stp index 94e07adf..aba7d6bf 100644 --- a/tapset/s390x/syscalls.stp +++ b/tapset/s390/syscalls.stp @@ -1,6 +1,6 @@ # S390-specific system calls -%(arch == "s390x" %? +%(arch == "s390" %? # getresgid __________________________________________________ # long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid) diff --git a/tapset/scheduler.stp b/tapset/scheduler.stp index 55e230c2..45ddbb04 100644 --- a/tapset/scheduler.stp +++ b/tapset/scheduler.stp @@ -131,7 +131,7 @@ probe scheduler.ctxswitch = kernel.function("context_switch") %) { -%( arch == "ppc64" %? +%( arch == "powerpc" %? prev_pid = $prev->pid next_pid = $new->pid prev_task = $prev diff --git a/tapset/syscalls2.stp b/tapset/syscalls2.stp index e97082c7..defc50a0 100644 --- a/tapset/syscalls2.stp +++ b/tapset/syscalls2.stp @@ -567,7 +567,7 @@ probe syscall.pwrite32 = kernel.function("sys32_pwrite64") ? buf_uaddr = $buf count = $count offset = ($poshi << 32) + $poslo -%( arch == "s390x" %? +%( arch == "s390" %? buf_uaddr = $ubuf argstr = sprintf("%d, %s, %d, %d", $fd, text_strn(user_string($ubuf), syscall_string_trunc, 1), @@ -740,7 +740,7 @@ probe syscall.readv = kernel.function("compat_sys_readv") ?, vector_uaddr = $vec count = $vlen /* FIXME: RHEL4 U3 ppc64 can't resolve $fd */ -%( arch != "ppc64" %? +%( arch != "powerpc" %? fd = $fd argstr = sprintf("%d, %p, %d", $fd, $vec, $vlen) %: @@ -3696,7 +3696,7 @@ probe syscall.writev = kernel.function("compat_sys_writev") ?, vector_uaddr = $vec count = $vlen /* FIXME: RHEL4 U3 ppc64 can't resolve $fd */ -%( arch != "ppc64" %? +%( arch != "powerpc" %? fd = $fd argstr = sprintf("%d, %p, %d", $fd, $vec, $vlen) %: diff --git a/tapsets.cxx b/tapsets.cxx index 5952ddcb..04fbf6e0 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1559,6 +1559,7 @@ validate_module_elf (Dwfl_Module *mod, const char *name, base_query *q) string expect_machine; // to match sess.machine (i.e., kernel machine) string expect_machine2; + // NB: See also the 'uname -m' squashing done in main.cxx. switch (elf_machine) { // x86 and ppc are bi-architecture; a 64-bit kernel @@ -1579,7 +1580,7 @@ validate_module_elf (Dwfl_Module *mod, const char *name, base_query *q) break; case EM_S390: expect_machine = "s390x"; break; case EM_IA_64: expect_machine = "ia64"; break; - case EM_ARM: expect_machine = "armv*"; break; + case EM_ARM: expect_machine = "arm*"; break; // XXX: fill in some more of these default: expect_machine = "?"; break; } diff --git a/testsuite/parseok/fourteen.stp b/testsuite/parseok/fourteen.stp index 30ada648..bdd31469 100755 --- a/testsuite/parseok/fourteen.stp +++ b/testsuite/parseok/fourteen.stp @@ -11,7 +11,7 @@ global global %( arch == "i386" %? i386 -%: %( arch == "i686" %? i686 +%: %( arch == "powerpc" %? powerpc %: %( arch != "x86_64" %? other %: x86_64 %) %) %) diff --git a/testsuite/systemtap.base/utrace_syscall_args.stp b/testsuite/systemtap.base/utrace_syscall_args.stp index 5c6ca451..267b7331 100644 --- a/testsuite/systemtap.base/utrace_syscall_args.stp +++ b/testsuite/systemtap.base/utrace_syscall_args.stp @@ -59,7 +59,7 @@ probe process("utrace_syscall_args").syscall { mmap_args[5] = $arg5 mmap_args[6] = $arg6 -%(arch == "s390x" %? +%(arch == "s390" %? # s390 requires this for mmap. Verified by running: # # strace strace utrace_syscall_args addr = mmap_args[1] diff --git a/testsuite/systemtap.context/num_args.stp b/testsuite/systemtap.context/num_args.stp index 5cc01d52..c6638f2a 100644 --- a/testsuite/systemtap.context/num_args.stp +++ b/testsuite/systemtap.context/num_args.stp @@ -1,8 +1,7 @@ %( arch == "i386" %? global ir = "eax", lr = "eax" %) -%( arch == "i686" %? global ir = "eax", lr = "eax" %) %( arch == "x86_64" %? global ir = "eax", lr = "rax" %) -%( arch == "ppc64" %? global ir = "r3", lr = "r3" %) -%( arch == "s390x" %? global ir = "r2", lr = "r2" %) +%( arch == "powerpc" %? global ir = "r3", lr = "r3" %) +%( arch == "s390" %? global ir = "r2", lr = "r2" %) probe module("systemtap_test_module2").function("yyy_int") { printf("yyy_int %d %d %d\n", int_arg(1), int_arg(2), int_arg(3)) @@ -28,9 +27,7 @@ probe module("systemtap_test_module2").function("yyy_int64") { # and the stack, but rather passed entirely on the stack. printf("yyy_int64 %d %d %d\n", %( arch == "i386" %? s64_arg(1), s64_arg(4), s64_arg(6) -%: %( arch == "i686" %? s64_arg(1), s64_arg(4), s64_arg(6) - %: s64_arg(1), s64_arg(2), s64_arg(3) - %) +%: s64_arg(1), s64_arg(2), s64_arg(3) %) ) } diff --git a/testsuite/systemtap.stress/current.stp b/testsuite/systemtap.stress/current.stp index 4c0f824c..0b2a7f94 100644 --- a/testsuite/systemtap.stress/current.stp +++ b/testsuite/systemtap.stress/current.stp @@ -24,7 +24,7 @@ probe %( arch != "x86_64" %? # __switch_to can not be probed on x86_64 - see PR2068 kernel.function("__switch_to").call, - %( arch != "i686" %? + %( arch != "i386" %? # __switch_to.return is broken on i686 - see PR4542 kernel.function("__switch_to").return, %) |