porting iperf 到android到步骤: 使用 native build 到方式,直接贴上自己的BKM
how to porting iperf2.0.5 to board
1.Get source code from:
Then put the source code under folder sourcDIR/externel/
2.Add a Android.mk under folder iperf2.0.5
**********************************//begin Android.mk
#Android.mk
LOCAL_PATH := $(call my-dir)
OBJS += compat/error.c
OBJS += compat/snprintf.c
OBJS += compat/inet_ntop.c
OBJS += compat/inet_pton.c
OBJS += compat/signal.c
OBJS += compat/Thread.c
OBJS += compat/string.c
OBJS += compat/gettimeofday.c
OBJS += src/gnu_getopt.c
OBJS += src/gnu_getopt_long.c
OBJS += src/tcp_window_size.c
OBJS += src/service.c
OBJS += src/sockets.c
OBJS += src/stdio.c
OBJS += src/ReportCSV.c
OBJS += src/Locale.c
OBJS += src/ReportDefault.c
OBJS += src/Reporter.c
OBJS += src/Extractor.c
OBJS += src/SocketAddr.c
OBJS += compat/delay.cpp
OBJS += src/Server.cpp
OBJS += src/Client.cpp
OBJS += src/List.cpp
OBJS += src/Launch.cpp
OBJS += src/PerfSocket.cpp
OBJS += src/Settings.cpp
OBJS += src/Listener.cpp
OBJS += src/main.cpp
INCLUDES = $(LOCAL_PATH)/include
L_CFLAGS = -DHAVE_CONFIG_H
########################
include $(CLEAR_VARS)
LOCAL_MODULE := iperf
#LOCAL_SHARED_LIBRARIES := libc libcutils libutils libnetutils libstdc++
LOCAL_CFLAGS := $(L_CFLAGS)
LOCAL_SRC_FILES := $(OBJS)
LOCAL_C_INCLUDES := $(INCLUDES)
LOCAL_MODULE_TAGS := eng
include $(BUILD_EXECUTABLE)
########################
************************************//end Android.mk
3.Get a native build
sourceDIR$source build/envsetup.sh
sourceDIR$lunch 9
sourceDIR$mmm externel/iperf2.0.5
查资料说iperf 主要用来做wifi速率测试的,其实这个用来测试usb 端口到传输速率也很方便
打开usb的rndis选项让pc 同MID设备网络桥接,为了测试方便自己写了两个非常简单到测试脚本:
pc端:
#!/bin/bash
ifconfig usb0 192.168.1.2
iperf -c 192.168.1.1 -f m -t 100
MID端:
#!sbin/ash
echo 1 > /sys/class/usb_composite/rndis/enable
busybox ifconfig usb0 192.168.1.1 up
busybox ifconfig
iperf -s -f m
测试性能的同时可以使用perf工具进行分析,可以帮助找到造成瓶颈到思路,关于perf使用,再结合vmstat一起记录
阅读(3749) | 评论(0) | 转发(0) |