Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1732204 > unrolled thread
| Started by | naresh.kamboju@linaro.org |
|---|---|
| First post | 2017-09-14 13:00 +0200 |
| Last post | 2017-09-14 16:50 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] selftests: intel_pstate: compile programs if executable not found naresh.kamboju@linaro.org - 2017-09-14 13:00 +0200
Re: [PATCH] selftests: intel_pstate: compile programs if executable not found Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-14 16:50 +0200
Re: [PATCH] selftests: intel_pstate: compile programs if executable not found Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-14 16:50 +0200
| From | naresh.kamboju@linaro.org |
|---|---|
| Date | 2017-09-14 13:00 +0200 |
| Subject | [PATCH] selftests: intel_pstate: compile programs if executable not found |
| Message-ID | <upA2f-3WF-31@gated-at.bofh.it> |
From: Naresh Kamboju <naresh.kamboju@linaro.org>
Test exit due to aperf.c: No such file or directory
./run.sh
gcc: error: aperf.c: No such file or directory
Problem compiling aperf.c.
The Makefile installs executable programs "aperf" and "msr"
so skip compile on target.
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
---
tools/testing/selftests/intel_pstate/run.sh | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index 7868c106b8b1..2149b9b5876a 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -31,11 +31,16 @@ EVALUATE_ONLY=0
max_cpus=$(($(nproc)-1))
-# compile programs
-gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm
-[ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
-gcc -o msr msr.c -lm
-[ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
+# Compile programs if executable not found
+if [ ! -x aperf ]; then
+ gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm
+ [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1
+fi
+
+if [ ! -x msr ]; then
+ gcc -o msr msr.c -lm
+ [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1
+fi
function run_test () {
--
2.13.0
[toc] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2017-09-14 16:50 +0200 |
| Subject | Re: [PATCH] selftests: intel_pstate: compile programs if executable not found |
| Message-ID | <upDCO-6hR-3@gated-at.bofh.it> |
| In reply to | #1732204 |
Hi Naresh, On 09/14/2017 04:51 AM, naresh.kamboju@linaro.org wrote: > From: Naresh Kamboju <naresh.kamboju@linaro.org> > > Test exit due to aperf.c: No such file or directory > ./run.sh > gcc: error: aperf.c: No such file or directory > Problem compiling aperf.c. > Please give me more details on where do you see this problem? I don't think the below is the right fix. It adds checks for executables and they doesn't exist, goes and tries to build. > The Makefile installs executable programs "aperf" and "msr" > so skip compile on target. > > Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> > --- > tools/testing/selftests/intel_pstate/run.sh | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh > index 7868c106b8b1..2149b9b5876a 100755 > --- a/tools/testing/selftests/intel_pstate/run.sh > +++ b/tools/testing/selftests/intel_pstate/run.sh > @@ -31,11 +31,16 @@ EVALUATE_ONLY=0 > > max_cpus=$(($(nproc)-1)) > > -# compile programs > -gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm > -[ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1 > -gcc -o msr msr.c -lm > -[ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1 > +# Compile programs if executable not found > +if [ ! -x aperf ]; then > + gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm > + [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1 > +fi > + > +if [ ! -x msr ]; then > + gcc -o msr msr.c -lm > + [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1 > +fi As such run.sh shouldn't have any compile code. These should be strictly for running tests. Instead of adding checks, please remove the compile logic from this file. thanks, -- Shuah
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2017-09-14 16:50 +0200 |
| Subject | Re: [PATCH] selftests: intel_pstate: compile programs if executable not found |
| Message-ID | <upDCO-6hR-5@gated-at.bofh.it> |
| In reply to | #1732320 |
On 09/14/2017 08:42 AM, Shuah Khan wrote: > Hi Naresh, > > On 09/14/2017 04:51 AM, naresh.kamboju@linaro.org wrote: >> From: Naresh Kamboju <naresh.kamboju@linaro.org> >> >> Test exit due to aperf.c: No such file or directory >> ./run.sh >> gcc: error: aperf.c: No such file or directory >> Problem compiling aperf.c. >> > > Please give me more details on where do you see this problem? > I don't think the below is the right fix. It adds checks for > executables and they doesn't exist, goes and tries to build. > >> The Makefile installs executable programs "aperf" and "msr" >> so skip compile on target. >> >> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> >> --- >> tools/testing/selftests/intel_pstate/run.sh | 15 ++++++++++----- >> 1 file changed, 10 insertions(+), 5 deletions(-) >> >> diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh >> index 7868c106b8b1..2149b9b5876a 100755 >> --- a/tools/testing/selftests/intel_pstate/run.sh >> +++ b/tools/testing/selftests/intel_pstate/run.sh >> @@ -31,11 +31,16 @@ EVALUATE_ONLY=0 >> >> max_cpus=$(($(nproc)-1)) >> >> -# compile programs >> -gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm >> -[ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1 >> -gcc -o msr msr.c -lm >> -[ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1 >> +# Compile programs if executable not found >> +if [ ! -x aperf ]; then >> + gcc aperf.c -Wall -D_GNU_SOURCE -o aperf -lm >> + [ $? -ne 0 ] && echo "Problem compiling aperf.c." && exit 1 >> +fi >> + >> +if [ ! -x msr ]; then >> + gcc -o msr msr.c -lm >> + [ $? -ne 0 ] && echo "Problem compiling msr.c." && exit 1 >> +fi > > As such run.sh shouldn't have any compile code. These should > be strictly for running tests. > > Instead of adding checks, please remove the compile logic from this > file. > Hi Naresh, I already have a patch from Thomas Meyer that removes the compile logic. No need to redo the patch. thanks, -- Shuah
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web