]> sourceware.org Git - systemtap.git/commitdiff
Factor out code to normalize the architecture names and add arm arch
authorWilliam Cohen <wcohen@redhat.com>
Wed, 20 Jul 2011 14:52:43 +0000 (10:52 -0400)
committerWilliam Cohen <wcohen@redhat.com>
Wed, 20 Jul 2011 14:52:43 +0000 (10:52 -0400)
A few tests need to know the generic architecture name rather than
the specific variant. This patch factors out the code into
testsuite/lib/systemtap.exp and add entries for the arm architecture
variants.

testsuite/lib/systemtap.exp
testsuite/systemtap.base/cmd_parse.exp
testsuite/systemtap.base/preprocessor.exp

index 9eeca85ba63168ddb45a183417c21b24f9f4e99a..e546c447d2d91db6c77132254869bc641df8a138 100644 (file)
@@ -235,6 +235,16 @@ proc shutdown_server {} {
     }
 }
 
+proc normalize_arch { arch } {
+    if {$arch == "ppc64"} then {return "powerpc"}
+    if {$arch == "s390x"} then {return "s390"}
+    if {$arch == "i686"} then {return "i386"}
+    if {$arch == "armv5tel"} then {return "arm"}
+    if {$arch == "armv7l"} then {return "arm"}
+    if {$arch == "armv7lh"} then {return "arm"}
+    return $arch
+}
+
 proc get_system_info {} {
     global Host Snapshot Distro GCC_Version env
 
index bfb5aaf89fc9d5558d7f15d82b691f1bbfb87b1f..f0c285e331f4465f50a7d4f227e576f304bbc9bf 100644 (file)
@@ -149,9 +149,7 @@ wait;catch {close}
 
 set uname [exec uname -i]
 # normalize arch
-if {$uname == "ppc64"} then {set uname powerpc}
-if {$uname == "s390x"} then {set uname s390}
-if {$uname == "i686"} then {set uname i386}
+set uname [normalize_arch $uname]
 
 spawn sh -c "stap -m do_not_cache_me -a $uname -p4 -e 'probe begin {exit()}'"
 # the \r below is meant to match the "kernelrelease" output, as distinct from
index a869b43925e6b6bb4f804375980c1b1adc5b34bd..e1152c820611a3a180b74d29b53cd6eb907471a0 100644 (file)
@@ -8,9 +8,7 @@ set krx {?noSuchKernel*}
 
 set arch [exec uname -i]
 # normalize arch; PR4186
-if {$arch == "ppc64"} then {set arch powerpc}
-if {$arch == "s390x"} then {set arch s390}
-if {$arch == "i686"} then {set arch i386}
+set arch [normalize_arch $arch]
 set ar "?[string range $arch 1 end-1]?"
 set arx {?noSuchArch?}
 
This page took 0.027264 seconds and 5 git commands to generate.