Making stresstestapp to work on Android

1,425 views
Skip to first unread message

amit rane

unread,
Jan 19, 2015, 8:17:33 PM1/19/15
to stressappt...@googlegroups.com
This may be already possible. I do see the Android.mk file in the repository.

However, I was wanting to check how do I make stresstestapp work on Android ? Could you please provide an example/tutorial of the same ?
Also would the sample usage mentioned in the user-guide would also work for Android ?

Nick Sanders

unread,
Jan 20, 2015, 12:21:38 PM1/20/15
to stressappt...@googlegroups.com
It should be pretty much the same. Just use the Android.mk and you get a binary you can run in adb shell.

--

---
You received this message because you are subscribed to the Google Groups "stressapptest-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stressapptest-di...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

amit rane

unread,
Jan 30, 2015, 2:24:39 PM1/30/15
to stressappt...@googlegroups.com
Thanks for your reply. Yes, it does work. The precise instructions are at: https://github.com/royzhao/stressapptest

I should have been more precise. What I was checking on trying to compile it from source using the stand-alone tool-chain.
Here's what I did: 

$NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/tmp/my-android-toolchain

then,
export PATH=/tmp/my-android-toolchain/bin:$PATH
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++

cd stressapptest
./configure --host=arm-linux-androideabi (the config.log is attached).
make
Here's the output:

Making all in src
make[1]: Entering directory `/home/amitrane/stresstestapp/stressapptest/src'
make[2]: Entering directory `/home/amitrane/stresstestapp/stressapptest'
make[2]: Leaving directory `/home/amitrane/stresstestapp/stressapptest'
make  all-am
make[2]: Entering directory `/home/amitrane/stresstestapp/stressapptest/src'
make[3]: Entering directory `/home/amitrane/stresstestapp/stressapptest'
make[3]: Leaving directory `/home/amitrane/stresstestapp/stressapptest'
arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc
In file included from finelock_queue.h:29:0,
                 from sat.h:28,
                 from main.cc:18:
os.h:270:6: warning: #warning "Unsupported CPU type ARMV7A: your timer may not function correctly" [-Wcpp]
In file included from main.cc:17:0:
sattypes.h: In function 'bool cpuset_isequal(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'bool cpuset_issubset(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:114:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'int cpuset_count(const cpu_set_t*)':
sattypes.h:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'std::string cpuset_format(const cpu_set_t*)':
sattypes.h:137:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
mv -f .deps/main.Tpo .deps/main.Po
arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT os.o -MD -MP -MF .deps/os.Tpo -c -o os.o os.cc
In file included from os.cc:21:0:
os.h:270:6: warning: #warning "Unsupported CPU type ARMV7A: your timer may not function correctly" [-Wcpp]
os.cc:198:2: warning: #warning "Unsupported CPU type ARMV7A: unable to determine feature set." [-Wcpp]
In file included from adler32memcpy.h:19:0,
                 from os.h:30,
                 from os.cc:21:
sattypes.h: In function 'bool cpuset_isequal(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'bool cpuset_issubset(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:114:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'int cpuset_count(const cpu_set_t*)':
sattypes.h:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'std::string cpuset_format(const cpu_set_t*)':
sattypes.h:137:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
os.cc: In member function 'virtual bool OsLayer::Initialize()':
os.cc:113:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
os.cc: In member function 'virtual bool OsLayer::AllocateTestMem(int64, uint64)':
os.cc:501:8: warning: variable 'prefer_hugepages' set but not used [-Wunused-but-set-variable]
os.cc:502:8: warning: variable 'prefer_posix_shm' set but not used [-Wunused-but-set-variable]
os.cc:503:8: warning: variable 'prefer_dynamic_mapping' set but not used [-Wunused-but-set-variable]
mv -f .deps/os.Tpo .deps/os.Po
arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT os_factory.o -MD -MP -MF .deps/os_factory.Tpo -c -o os_factory.o os_factory.cc
In file included from os_factory.cc:26:0:
os.h:270:6: warning: #warning "Unsupported CPU type ARMV7A: your timer may not function correctly" [-Wcpp]
In file included from adler32memcpy.h:19:0,
                 from os.h:30,
                 from os_factory.cc:26:
sattypes.h: In function 'bool cpuset_isequal(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'bool cpuset_issubset(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:114:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'int cpuset_count(const cpu_set_t*)':
sattypes.h:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'std::string cpuset_format(const cpu_set_t*)':
sattypes.h:137:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
mv -f .deps/os_factory.Tpo .deps/os_factory.Po
arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT pattern.o -MD -MP -MF .deps/pattern.Tpo -c -o pattern.o pattern.cc
In file included from adler32memcpy.h:19:0,
                 from pattern.h:28,
                 from pattern.cc:21:
sattypes.h: In function 'bool cpuset_isequal(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'bool cpuset_issubset(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:114:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'int cpuset_count(const cpu_set_t*)':
sattypes.h:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'std::string cpuset_format(const cpu_set_t*)':
sattypes.h:137:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
mv -f .deps/pattern.Tpo .deps/pattern.Po
arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT queue.o -MD -MP -MF .deps/queue.Tpo -c -o queue.o queue.cc
In file included from queue.h:29:0,
                 from queue.cc:21:
sattypes.h: In function 'bool cpuset_isequal(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'bool cpuset_issubset(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:114:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'int cpuset_count(const cpu_set_t*)':
sattypes.h:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'std::string cpuset_format(const cpu_set_t*)':
sattypes.h:137:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
mv -f .deps/queue.Tpo .deps/queue.Po
arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I.     -DCHECKOPTS -Wreturn-type -Wunused -Wuninitialized -Wall -O3 -funroll-all-loops  -funroll-loops -DNDEBUG -MT sat.o -MD -MP -MF .deps/sat.Tpo -c -o sat.o sat.cc
In file included from sat.cc:46:0:
os.h:270:6: warning: #warning "Unsupported CPU type ARMV7A: your timer may not function correctly" [-Wcpp]
In file included from disk_blocks.h:29:0,
                 from sat.cc:44:
sattypes.h: In function 'bool cpuset_isequal(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'bool cpuset_issubset(const cpu_set_t*, const cpu_set_t*)':
sattypes.h:114:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'int cpuset_count(const cpu_set_t*)':
sattypes.h:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sattypes.h: In function 'std::string cpuset_format(const cpu_set_t*)':
sattypes.h:137:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
sat.cc: In member function 'virtual void Sat::InitializeThreads()':
sat.cc:1434:67: error: cannot convert 'int*' to 'char*' in assignment
sat.cc: In member function 'int Sat::CacheLineSize()':
sat.cc:1488:30: error: '_SC_LEVEL1_DCACHE_LINESIZE' was not declared in this scope
sat.cc:1489:26: error: '_SC_LEVEL2_CACHE_LINESIZE' was not declared in this scope
sat.cc:1491:22: error: '_SC_LEVEL3_CACHE_LINESIZE' was not declared in this scope
sat.cc:1493:22: error: '_SC_LEVEL4_CACHE_LINESIZE' was not declared in this scope
make[2]: *** [sat.o] Error 1
make[2]: Leaving directory `/home/amitrane/stresstestapp/stressapptest/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/amitrane/stresstestapp/stressapptest/src'
make: *** [all-recursive] Error 1

Any comments/suggestions ? Thanks.
config.log

Nick Sanders

unread,
Feb 3, 2015, 12:26:25 AM2/3/15
to stressappt...@googlegroups.com
I think the kernel version you are using might be too old. You can stub out those assignments

--

Archit Sureja

unread,
Apr 18, 2015, 1:02:03 PM4/18/15
to stressappt...@googlegroups.com
You can use stressapptest in android, but you have to do some changes files.
you can download stressapptest for android from 


and follow the step as shown in below link


still you will get error in compile you have to do some extra changes in files like 

void OsLayer::GetFeatures() in os.cc
 int eax, ebx, ecx, edx;
  __asm__ __volatile__
("cpuid": "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (1));

 replace it

unsigned int eax = 1, ebx, ecx, edx;
  cpuid
(&eax, &ebx, &ecx, &edx);


inline int apicid(void) in worker.cc

 int cpu;
#if defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686)
    __asm __volatile
("cpuid" : "=b" (cpu) : "a" (1) : "cx", "dx");

replace it with

 unsigned int cpu;
 
#if defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686)
 
unsigned int eax = 1, ecx, edx;
 cpuid
(&eax, &cpu, &ecx, &edx);

comment the #define HAVE_SCHED_GETAFFINITY 1 in stressapptest_config_android.h file

after compilation you can use push stressapptest in android mobile.
and use it with adb shell command 

example

adb shell /data/local/tmp/stressapptest -s 10 -m 8 -i 8 -C 8 -n 127.0.0.1 --listen  -f data/local/tmp/file1 -f data/local/tmp/file2



To unsubscribe from this group and stop receiving emails from it, send an email to stressapptest-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages