iperf tool for Android

5,284 views
Skip to first unread message

sky_walker

unread,
Apr 18, 2009, 3:57:52 AM4/18/09
to android-platform
iperf is a good tool to test network bandwidth, and I do not know any
one has ported for Android, this is my try with static way.

Steps to generate iperf running on Android
1 download iperf source from sourceforge.net, http://sourceforge.net/projects/iperf/
2 download toolchain from codesourcery, http://www.codesourcery.com/sgpp/lite/arm/portal/release644
3 enter iperf source folder, run configure command
./configure –host=arm-linux CXX=$(PATH_OF_arm-none-linux-
gnueabi-g++) CXXFLAGS=-static CC=$(PATH_OF_arm-none-linux-gnueabi-gcc)
CFLAGS=-static
4 make
If error liking “Reporter.o:Reporter.c:(.text+0xedc): more
undefined references to `rpl_malloc'”, modify config.h, and comment
the line “#define malloc rpl_malloc”, then make again
5 generated iperf can run on Android platform.

I test it on emulator and reports are:
# ./iperf -s
./iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 5] local 127.0.0.1 port 5001 connected with 127.0.0.1 port 56946
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.0 sec 32.9 MBytes 27.6 Mbits/sec

# ./iperf -c 127.0.0.1 -i 2 -t 10
./iperf -c 127.0.0.1 -i 2 -t 10
------------------------------------------------------------
Client connecting to 127.0.0.1, TCP port 5001
TCP window size: 131 KByte (default)
------------------------------------------------------------
[ 3] local 127.0.0.1 port 56946 connected with 127.0.0.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 2.0 sec 6.86 MBytes 28.8 Mbits/sec
[ ID] Interval Transfer Bandwidth
[ 3] 2.0- 4.0 sec 6.53 MBytes 27.4 Mbits/sec
[ ID] Interval Transfer Bandwidth
[ 3] 4.0- 6.0 sec 6.51 MBytes 27.3 Mbits/sec
[ ID] Interval Transfer Bandwidth
[ 3] 6.0- 8.0 sec 6.43 MBytes 27.0 Mbits/sec
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 32.9 MBytes 27.5 Mbits/sec

Magnus

unread,
Apr 20, 2009, 4:56:25 AM4/20/09
to android-platform
I tried to build the tool but got stuck in "configure". It complains
that I don't have appropriate directory (se listing below) when trying
to build a cpp-file. Any suggestions?

configure:2414: checking for C++ compiler default output file name
configure:2441: /opt/dev2/codesourcery/arm-2008q3/arm-none-linux-
gnueabi/bin/g++ -static conftest.cpp >&5
g++: error trying to exec 'cc1plus': execvp: No such file or directory
configure:2444: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "Iperf"
| #define PACKAGE_TARNAME "iperf"
| #define PACKAGE_VERSION "2.0.4"
| #define PACKAGE_STRING "Iperf 2.0.4"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "iperf"
| #define VERSION "2.0.4"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2483: error: C++ compiler cannot create executables






On Apr 18, 9:57 am, sky_walker <e13...@gmail.com> wrote:
> iperf is a good tool to test network bandwidth, and I do not know any
> one has ported for Android, this is my try with static way.
>
> Steps to generate iperf running on Android
> 1 download iperf source from sourceforge.net,http://sourceforge.net/projects/iperf/
> 2 download toolchain from codesourcery,http://www.codesourcery.com/sgpp/lite/arm/portal/release644

BaoZhong Zheng

unread,
Apr 20, 2009, 8:18:18 AM4/20/09
to android-...@googlegroups.com
I download arm-2008q3 bin files, then install into my ubuntu system. When configure command, there is no error liking you. If you download tgz, you can try bin way.
 
Walker

2009/4/20 Magnus <manem...@gmail.com>

Magnus

unread,
Apr 20, 2009, 10:29:07 AM4/20/09
to android-platform
I tried with the installer (bin) just to test your theory but to no
avail. I still have the same problem.

I can't figure out where it tries to create the dummy directory. I
tried to change the credentials on the build directory but that didn't
help either.

/Magnus

On Apr 20, 2:18 pm, BaoZhong Zheng <e13...@gmail.com> wrote:
> I download arm-2008q3 bin files, then install into my ubuntu system. When
> configure command, there is no error liking you. If you download tgz, you
> can try bin way.
>
> Walker
>
> 2009/4/20 Magnus <maneman...@gmail.com>

Magnus

unread,
Apr 23, 2009, 3:47:32 AM4/23/09
to android-platform
Ok, my problem previously was just a typo to the g++ binary I got a
little further but got this error when running ./configure.

...
checking whether byte ordering is bigendian... unknown
configure: error: unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help
...

Where do I set this variable and which endian is it? It seems that ARM
achitecture supports both little and big endians.

/M

Rich

unread,
May 30, 2009, 3:29:31 PM5/30/09
to android-platform
Could I use the prebuilt toolchain included with the source to do this
same thing?

R
Reply all
Reply to author
Forward
0 new messages