aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro/recipes-extra/trinity/files/0003-scripts-arch-dependent-to-get-the-syscall_list.patch
blob: 52be5824e3f949fb668a0043e026026e45edad5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
From b28f02ef2bf5098a43167a8c48dbcb853cd7d03a Mon Sep 17 00:00:00 2001
From: Anders Roxell <anders.roxell@linaro.org>
Date: Tue, 8 Oct 2013 22:26:51 +0200
Subject: [PATCH 3/3] scripts: arch dependent to get the syscall_list

ARCH may be changed in the enviroment

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 scripts/find.sh                           | 11 ++++++++++-
 scripts/test-all-syscalls-parallel.sh     | 11 ++++++++++-
 scripts/test-all-syscalls-sequentially.sh | 11 ++++++++++-
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/scripts/find.sh b/scripts/find.sh
index 3f10c58..2687918 100755
--- a/scripts/find.sh
+++ b/scripts/find.sh
@@ -7,6 +7,15 @@
 
 TRINITY_PATH=${TRINITY_PATH:-.}
 TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+ARCH=${ARCH:-x86}
+
+$TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | \
+    awk '{ print $4 }' | sort -u> $TRINITY_TMP/syscall_list
+
+if [ $ARCH = "arm" ]; then
+    $TRINITY_PATH/trinity -L | grep -v AVOID | \
+        awk '{ print $2 }' | sort -u> $TRINITY_TMP/syscall_list
+fi
 
 check_tainted()
 {
@@ -27,7 +36,7 @@ while [ 1 ];
 do
 
 
-for sc in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+for sc in $(cat $TRINITY_TMP/syscall_list)
 do
   mkdir -p tmp.$i
   pushd tmp.$i
diff --git a/scripts/test-all-syscalls-parallel.sh b/scripts/test-all-syscalls-parallel.sh
index 312fd2a..9c19f64 100755
--- a/scripts/test-all-syscalls-parallel.sh
+++ b/scripts/test-all-syscalls-parallel.sh
@@ -2,13 +2,22 @@
 
 TRINITY_PATH=${TRINITY_PATH:-.}
 TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+ARCH=${ARCH:-x86}
+
+$TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | \
+    awk '{ print $4 }' | sort -u> $TRINITY_TMP/syscall_list
+
+if [ $ARCH = "arm" ]; then
+    $TRINITY_PATH/trinity -L | grep -v AVOID | \
+        awk '{ print $2 }' | sort -u> $TRINITY_TMP/syscall_list
+fi
 
 chmod 755 $TRINITY_TMP
 cd $TRINITY_TMP
 
 while [ 1 ];
 do
-  for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+  for syscall in $(cat $TRINITY_TMP/syscall_list)
   do
 	MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -D &
   done
diff --git a/scripts/test-all-syscalls-sequentially.sh b/scripts/test-all-syscalls-sequentially.sh
index 2b726fc..3eea70a 100755
--- a/scripts/test-all-syscalls-sequentially.sh
+++ b/scripts/test-all-syscalls-sequentially.sh
@@ -5,6 +5,15 @@
 
 TRINITY_PATH=${TRINITY_PATH:-.}
 TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX)
+ARCH=${ARCH:-x86}
+
+$TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | \
+    awk '{ print $4 }' | sort -u> $TRINITY_TMP/syscall_list
+
+if [ $ARCH = "arm" ]; then
+    $TRINITY_PATH/trinity -L | grep -v AVOID | \
+        awk '{ print $2 }' | sort -u> $TRINITY_TMP/syscall_list
+fi
 
 check_tainted()
 {
@@ -18,7 +27,7 @@ TAINT=$(cat /proc/sys/kernel/tainted)
 
 while [ 1 ]
 do
-for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u)
+for syscall in $(cat $TRINITY_TMP/syscall_list)
 do
 	chmod 755 $TRINITY_TMP
 	pushd $TRINITY_TMP
-- 
1.8.1.2