iperf: Upgrade to version 2.0.5
PATCH 1/1 iperf: Upgrade to version 2.0.5
* Upgrade to version 2.0.5.
* Below patches used in version 2.0.4 are no longer needed:
004-svn-r43-ro.patch (already applied) 006-iperf-die-on-connect-fail.patch (already applied) 009-delayloop.patch (equivalent solution already exists)
* Patch 000-Iperf_Fix-CPU-Usage.diff has been updated to apply to version 2.0.5
---
.../iperf/iperf-2.0.4/000-Iperf_Fix-CPU-Usage.diff | 164 --------------------
.../iperf/iperf-2.0.4/004-svn-r43-ro.patch | 117 --------------
.../006-iperf-die-on-connect-fail.patch | 15 --
.../iperf/iperf-2.0.4/009-delayloop.patch | 22 ---
.../iperf/iperf-2.0.5/000-Iperf_Fix-CPU-Usage.diff | 45 ++++++
.../001-cast-to-max_size_t-instead-of-int.patch | 0
.../003-fix-hyphen-used-as-minus-sign.patch | 0
.../005-iperf-die-on-bind-fail.patch | 0
.../007-iperf-reporter-deadlock.patch | 0
.../008-numofreport.patch | 0
.../iperf/{iperf_2.0.4.bb => iperf_2.0.5.bb} | 10 +-
11 files changed, 49 insertions(+), 324 deletions(-)
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/000-Iperf_Fix-CPU-Usage.diff
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/004-svn-r43-ro.patch
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/006-iperf-die-on-connect-fail.patch
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/009-delayloop.patch
create mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.5/000-Iperf_Fix-CPU-Usage.diff
rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/001-cast-to-max_size_t-instead-of-int.patch (100%)
rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/003-fix-hyphen-used-as-minus-sign.patch (100%)
rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/005-iperf-die-on-bind-fail.patch (100%)
rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/007-iperf-reporter-deadlock.patch (100%)
rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/008-numofreport.patch (100%)
rename meta-oe/recipes-benchmark/iperf/{iperf_2.0.4.bb => iperf_2.0.5.bb} (79%)meta-oe/recipes-benchmark/iperf/iperf-2.0.4/000-Iperf_Fix-CPU-Usage.diff deleted +0 -164
@@ -1,164 +0,0 @@ -[Thread]: Replace thread_rest() with condition variables - -This applies the patch by Ingo Molnar from - - http://marc.info/?l=linux-kernel&m=119088670113210&w=2 - -by reverting previous changes that coincided with changes made by this -patch. Other than that, the patch is the original from the above URL. - -Gerrit ---- - compat/Thread.c | 6 ------ - src/Reporter.c | 37 +++++++++---------------------------- - src/main.cpp | 2 ++ - 3 files changed, 11 insertions(+), 34 deletions(-) - -rover: changed two remaining thread_rest. - ---- a/compat/Thread.c -+++ b/compat/Thread.c -@@ -405,12 +405,6 @@ int thread_numuserthreads( void ) { - void thread_rest ( void ) { - #if defined( HAVE_THREAD ) - #if defined( HAVE_POSIX_THREAD ) --#if defined( _POSIX_PRIORITY_SCHEDULING ) -- sched_yield(); --#else -- usleep( 0 ); --#endif -- - #else // Win32 - SwitchToThread( ); - #endif ---- a/src/Reporter.c -+++ b/src/Reporter.c -@@ -110,9 +110,8 @@ - - char buffer[64]; // Buffer for printing - ReportHeader *ReportRoot = NULL; --int threadWait = 0; --int threadSleeping = 0; - extern Condition ReportCond; -+extern Condition ReportDoneCond; - int reporter_process_report ( ReportHeader *report ); - void process_report ( ReportHeader *report ); - int reporter_handle_packet( ReportHeader *report ); -@@ -340,7 +339,7 @@ - // item - while ( index == 0 ) { - Condition_Signal( &ReportCond ); -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } - agent->agentindex = 0; -@@ -348,11 +347,9 @@ - // Need to make sure that reporter is not about to be "lapped" - while ( index - 1 == agent->agentindex ) { - Condition_Signal( &ReportCond ); -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } -- if (threadSleeping) -- Condition_Signal( &ReportCond ); - - // Put the information there - memcpy( agent->data + agent->agentindex, packet, sizeof(ReportStruct) ); -@@ -382,9 +379,6 @@ - packet->packetLen = 0; - ReportPacket( agent, packet ); - packet->packetID = agent->report.cntDatagrams; -- if (threadSleeping) -- Condition_Signal( &ReportCond ); -- - } - } - -@@ -396,11 +390,8 @@ - void EndReport( ReportHeader *agent ) { - if ( agent != NULL ) { - int index = agent->reporterindex; -- if (threadSleeping) -- Condition_Signal( &ReportCond ); -- - while ( index != -1 ) { -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } - agent->agentindex = -1; -@@ -421,7 +412,7 @@ - Transfer_Info *GetReport( ReportHeader *agent ) { - int index = agent->reporterindex; - while ( index != -1 ) { -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } - return &agent->report.info; -@@ -467,10 +458,6 @@ - * Update the ReportRoot to include this report. - */ - Condition_Lock( ReportCond ); -- if ( isUDP(agent) ) -- threadWait = 0; -- else -- threadWait = 1; - reporthdr->next = ReportRoot; - ReportRoot = reporthdr; - Condition_Signal( &ReportCond ); -@@ -567,6 +554,7 @@ - } - Condition_Unlock ( ReportCond ); - -+again: - if ( ReportRoot != NULL ) { - ReportHeader *temp = ReportRoot; - //Condition_Unlock ( ReportCond ); -@@ -589,19 +577,12 @@ - // finished with report so free it - free( temp ); - Condition_Unlock ( ReportCond ); -+ Condition_Signal( &ReportDoneCond ); -+ if (ReportRoot) -+ goto again; - } -- // yield control of CPU is another thread is waiting -- // sleep on a condition variable, as it is much cheaper -- // on most platforms than issuing schedyield or usleep -- // syscalls -- Condition_Lock ( ReportCond ); -- if ( threadWait && ReportRoot != NULL) { -- threadSleeping = 1; -- Condition_TimedWait (& ReportCond, 1 ); -- threadSleeping = 0; -- } -- Condition_Unlock ( ReportCond ); -- -+ Condition_Signal( &ReportDoneCond ); -+ usleep(10000); - } else { - //Condition_Unlock ( ReportCond ); - } ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -96,6 +96,7 @@ extern "C" { - // records being accessed in a report and also to - // serialize modification of the report list - Condition ReportCond; -+ Condition ReportDoneCond; - } - - // global variables only accessed within this file -@@ -142,6 +143,7 @@ int main( int argc, char **argv ) { - - // Initialize global mutexes and conditions - Condition_Initialize ( &ReportCond ); -+ Condition_Initialize ( &ReportDoneCond ); - Mutex_Initialize( &groupCond ); - Mutex_Initialize( &clients_mutex ); - - -
meta-oe/recipes-benchmark/iperf/iperf-2.0.4/004-svn-r43-ro.patch deleted +0 -117
117 lines not on this page · raw message
meta-oe/recipes-benchmark/iperf/iperf-2.0.4/006-iperf-die-on-connect-fail.patch deleted +0 -15
@@ -1,15 +0,0 @@ -Import Debian patches and fix a lot of real bugs. - -Upstream-Status: Inappropriate [not author. Above message was get from oe.dev c10c33f86903c93611023197a7f812459c2dfe2d] - ---- iperf-2.0.4/src/Client.cpp 2008-04-07 22:37:54.000000000 -0400 -+++ iperf-2.0.4-fixed/src/Client.cpp 2009-03-03 12:30:02.000000000 -0500 -@@ -403,7 +403,7 @@ - // connect socket - rc = connect( mSettings->mSock, (sockaddr*) &mSettings->peer, - SockAddr_get_sizeof_sockaddr( &mSettings->peer )); -- WARN_errno( rc == SOCKET_ERROR, "connect" ); -+ FAIL_errno( rc == SOCKET_ERROR, "connect", mSettings ); - - getsockname( mSettings->mSock, (sockaddr*) &mSettings->local, - &mSettings->size_local );
meta-oe/recipes-benchmark/iperf/iperf-2.0.4/009-delayloop.patch deleted +0 -22
@@ -1,22 +0,0 @@ -by Kirby Zhou < kirbyzhou \x40 sohu-rd.com > -using sched_yield to schedule other threads, so multiple iperf can run simultaneously -using usleep with delay-loop between 2 package is long than 1.25ms. - -Upstream-Status: Inappropriate [not author] - ---- iperf-2.0.4-4/compat/delay.cpp 2009-07-06 12:02:24.166276642 +0200 -+++ iperf-2.0.4/compat/delay.cpp 2009-07-06 12:01:33.858384005 +0200 -@@ -69,6 +69,13 @@ void delay_loop( unsigned long usec ) { - - Timestamp now; - while ( now.before( end ) ) { -+ long diff = end.subUsec(now); -+ if (diff >= 1250) { -+ usleep(0); -+ } -+ if (diff >= 2) { -+ sched_yield(); -+ } - now.setnow(); - } - }
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/000-Iperf_Fix-CPU-Usage.diff new file +45 -0
45 lines not on this page · raw message
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/001-cast-to-max_size_t-instead-of-int.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/003-fix-hyphen-used-as-minus-sign.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/005-iperf-die-on-bind-fail.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/007-iperf-reporter-deadlock.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/007-iperf-reporter-deadlock.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/008-numofreport.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/008-numofreport.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf_2.0.5.bb renamed from meta-oe/recipes-benchmark/iperf/iperf_2.0.4.bb +4 -6
@@ -4,22 +4,20 @@ SECTION = "console/network" LICENSE = "NewBSD" LIC_FILES_CHKSUM = "file://COPYING;md5=e8478eae9f479e39bc34975193360298" +PR = "r0" + SRC_URI = " \ ${SOURCEFORGE_MIRROR}/iperf/iperf-${PV}.tar.gz \ file://000-Iperf_Fix-CPU-Usage.diff \ file://001-cast-to-max_size_t-instead-of-int.patch \ file://003-fix-hyphen-used-as-minus-sign.patch \ - file://004-svn-r43-ro.patch \ file://005-iperf-die-on-bind-fail.patch \ - file://006-iperf-die-on-connect-fail.patch \ file://007-iperf-reporter-deadlock.patch \ file://008-numofreport.patch \ - file://009-delayloop.patch \ " - -SRC_URI[md5sum] = "8c5bc14cc2ea55f18f22afe3c23e3dcb" -SRC_URI[sha256sum] = "3b52f1c178d6a99c27114929d5469c009197d15379c967b329bafb956f397944" +SRC_URI[md5sum] = "44b5536b67719f4250faed632a3cd016" +SRC_URI[sha256sum] = "636b4eff0431cea80667ea85a67ce4c68698760a9837e1e9d13096d20362265b" inherit autotools
Signature · 1 line
1.7.0.4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Op 06-10-12 21:07, Franklin S. Cooper Jr schreef:
Quoted 7 lines
* Upgrade to version 2.0.5. * Below patches used in version 2.0.4 are no longer needed: 004-svn-r43-ro.patch (already applied) 006-iperf-die-on-connect-fail.patch (already applied) 009-delayloop.patch (equivalent solution already exists) * Patch 000-Iperf_Fix-CPU-Usage.diff has been updated to apply to version 2.0.5 Signed-off-by: Franklin S. Cooper Jr <[email protected]>
Quoted 6 lines
--- a/meta-oe/recipes-benchmark/iperf/iperf_2.0.4.bb +++ b/meta-oe/recipes-benchmark/iperf/iperf_2.0.5.bb @@ -4,22 +4,20 @@ SECTION = "console/network" LICENSE = "NewBSD"
LIC_FILES_CHKSUM= "file://COPYING;md5=e8478eae9f479e39bc34975193360298"+PR = "r0" +
*deep sigh*
Remove that.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org
iD8DBQFQc+lEMkyGM64RGpERAlVzAKCSUhWw5mn54/cnKPRMUPjgFCPlvACeP1TK 0HBNGUfRIEwnXFC9zuqZgEE=
=rxrK
-----END PGP SIGNATURE-----
Please ignore this recipe for right now. I need to send a new version of this patch that includes my massaged version of the 003-fix-hyphen-used-as-minus-sign patch.
-----Original Message-----
From: Franklin S. Cooper Jr [mailto:[email protected]]
Sent: Saturday, October 06, 2012 2:07 PM
To: [email protected]
Cc: Cooper Jr., Franklin
Subject: [meta-oe][PATCH] iperf: Upgrade to version 2.0.5
* Upgrade to version 2.0.5.
* Below patches used in version 2.0.4 are no longer needed:
004-svn-r43-ro.patch (already applied) 006-iperf-die-on-connect-fail.patch (already applied) 009-delayloop.patch (equivalent solution already exists)
* Patch 000-Iperf_Fix-CPU-Usage.diff has been updated to apply to version 2.0.5
---
.../iperf/iperf-2.0.4/000-Iperf_Fix-CPU-Usage.diff | 164 --------------------
.../iperf/iperf-2.0.4/004-svn-r43-ro.patch | 117 --------------
.../006-iperf-die-on-connect-fail.patch | 15 --
.../iperf/iperf-2.0.4/009-delayloop.patch | 22 ---
.../iperf/iperf-2.0.5/000-Iperf_Fix-CPU-Usage.diff | 45 ++++++
.../001-cast-to-max_size_t-instead-of-int.patch | 0
.../003-fix-hyphen-used-as-minus-sign.patch | 0
.../005-iperf-die-on-bind-fail.patch | 0
.../007-iperf-reporter-deadlock.patch | 0
.../008-numofreport.patch | 0
.../iperf/{iperf_2.0.4.bb => iperf_2.0.5.bb} | 10 +-
11 files changed, 49 insertions(+), 324 deletions(-) delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/000-Iperf_Fix-CPU-Usage.diff
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/004-svn-r43-ro.patch
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/006-iperf-die-on-connect-fail.patch
delete mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.4/009-delayloop.patch
create mode 100644 meta-oe/recipes-benchmark/iperf/iperf-2.0.5/000-Iperf_Fix-CPU-Usage.diff
rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/001-cast-to-max_size_t-instead-of-int.patch (100%) rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/003-fix-hyphen-used-as-minus-sign.patch (100%) rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/005-iperf-die-on-bind-fail.patch (100%) rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/007-iperf-reporter-deadlock.patch (100%) rename meta-oe/recipes-benchmark/iperf/{iperf-2.0.4 => iperf-2.0.5}/008-numofreport.patch (100%) rename meta-oe/recipes-benchmark/iperf/{iperf_2.0.4.bb => iperf_2.0.5.bb} (79%)meta-oe/recipes-benchmark/iperf/iperf-2.0.4/000-Iperf_Fix-CPU-Usage.diff deleted +0 -161
@@ -1,164 +0,0 @@ -[Thread]: Replace thread_rest() with condition variables - -This applies the patch by Ingo Molnar from - - http://marc.info/?l=linux-kernel&m=119088670113210&w=2 - -by reverting previous changes that coincided with changes made by this -patch. Other than that, the patch is the original from the above URL. - -Gerrit ---- - compat/Thread.c | 6 ------ - src/Reporter.c | 37 +++++++++---------------------------- - src/main.cpp | 2 ++ - 3 files changed, 11 insertions(+), 34 deletions(-) - -rover: changed two remaining thread_rest. - ---- a/compat/Thread.c -+++ b/compat/Thread.c -@@ -405,12 +405,6 @@ int thread_numuserthreads( void ) { - void thread_rest ( void ) { - #if defined( HAVE_THREAD ) - #if defined( HAVE_POSIX_THREAD ) --#if defined( _POSIX_PRIORITY_SCHEDULING ) -- sched_yield(); --#else -- usleep( 0 ); --#endif -- - #else // Win32 - SwitchToThread( ); - #endif ---- a/src/Reporter.c -+++ b/src/Reporter.c -@@ -110,9 +110,8 @@ - - char buffer[64]; // Buffer for printing - ReportHeader *ReportRoot = NULL; --int threadWait = 0; --int threadSleeping = 0; - extern Condition ReportCond; -+extern Condition ReportDoneCond; - int reporter_process_report ( ReportHeader *report ); - void process_report ( ReportHeader *report ); - int reporter_handle_packet( ReportHeader *report ); -@@ -340,7 +339,7 @@ - // item - while ( index == 0 ) { - Condition_Signal( &ReportCond ); -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } - agent->agentindex = 0; -@@ -348,11 +347,9 @@ - // Need to make sure that reporter is not about to be "lapped" - while ( index - 1 == agent->agentindex ) { - Condition_Signal( &ReportCond ); -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } -- if (threadSleeping) -- Condition_Signal( &ReportCond ); - - // Put the information there - memcpy( agent->data + agent->agentindex, packet, sizeof(ReportStruct) ); -@@ -382,9 +379,6 @@ - packet->packetLen = 0; - ReportPacket( agent, packet ); - packet->packetID = agent->report.cntDatagrams; -- if (threadSleeping) -- Condition_Signal( &ReportCond ); -- - } - } - -@@ -396,11 +390,8 @@ - void EndReport( ReportHeader *agent ) { - if ( agent != NULL ) { - int index = agent->reporterindex; -- if (threadSleeping) -- Condition_Signal( &ReportCond ); -- - while ( index != -1 ) { -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } - agent->agentindex = -1; -@@ -421,7 +412,7 @@ - Transfer_Info *GetReport( ReportHeader *agent ) { - int index = agent->reporterindex; - while ( index != -1 ) { -- thread_rest(); -+ Condition_Wait( &ReportDoneCond ); - index = agent->reporterindex; - } - return &agent->report.info; -@@ -467,10 +458,6 @@ - * Update the ReportRoot to include this report. - */ - Condition_Lock( ReportCond ); -- if ( isUDP(agent) ) -- threadWait = 0; -- else -- threadWait = 1; - reporthdr->next = ReportRoot; - ReportRoot = reporthdr; - Condition_Signal( &ReportCond ); -@@ -567,6 +554,7 @@ - } - Condition_Unlock ( ReportCond ); - -+again: - if ( ReportRoot != NULL ) { - ReportHeader *temp = ReportRoot; - //Condition_Unlock ( ReportCond ); -@@ -589,19 +577,12 @@ - // finished with report so free it - free( temp ); - Condition_Unlock ( ReportCond ); -+ Condition_Signal( &ReportDoneCond ); -+ if (ReportRoot) -+ goto again; - } -- // yield control of CPU is another thread is waiting -- // sleep on a condition variable, as it is much cheaper -- // on most platforms than issuing schedyield or usleep -- // syscalls -- Condition_Lock ( ReportCond ); -- if ( threadWait && ReportRoot != NULL) { -- threadSleeping = 1; -- Condition_TimedWait (& ReportCond, 1 ); -- threadSleeping = 0; -- } -- Condition_Unlock ( ReportCond ); -- -+ Condition_Signal( &ReportDoneCond ); -+ usleep(10000); - } else { - //Condition_Unlock ( ReportCond ); - } ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -96,6 +96,7 @@ extern "C" { - // records being accessed in a report and also to - // serialize modification of the report list - Condition ReportCond; -+ Condition ReportDoneCond; - } - - // global variables only accessed within this file -@@ -142,6 +143,7 @@ int main( int argc, char **argv ) { - - // Initialize global mutexes and conditions - Condition_Initialize ( &ReportCond ); -+ Condition_Initialize ( &ReportDoneCond ); - Mutex_Initialize( &groupCond ); - Mutex_Initialize( &clients_mutex ); - - -
meta-oe/recipes-benchmark/iperf/iperf-2.0.4/004-svn-r43-ro.patch deleted +0 -117
117 lines not on this page · raw message
- printf( report_bw_jitter_loss_format, stats->transferID,
- stats->startTime, stats->endTime,
- buffer, &buffer[sizeof(buffer)/2],
meta-oe/recipes-benchmark/iperf/iperf-2.0.4/006-iperf-die-on-connect-fail.patch deleted +0 -15
@@ -1,15 +0,0 @@ -Import Debian patches and fix a lot of real bugs. - -Upstream-Status: Inappropriate [not author. Above message was get from oe.dev c10c33f86903c93611023197a7f812459c2dfe2d] - ---- iperf-2.0.4/src/Client.cpp 2008-04-07 22:37:54.000000000 -0400 -+++ iperf-2.0.4-fixed/src/Client.cpp 2009-03-03 12:30:02.000000000 -0500 -@@ -403,7 +403,7 @@ - // connect socket - rc = connect( mSettings->mSock, (sockaddr*) &mSettings->peer, - SockAddr_get_sizeof_sockaddr( &mSettings->peer )); -- WARN_errno( rc == SOCKET_ERROR, "connect" ); -+ FAIL_errno( rc == SOCKET_ERROR, "connect", mSettings ); - - getsockname( mSettings->mSock, (sockaddr*) &mSettings->local, - &mSettings->size_local );
meta-oe/recipes-benchmark/iperf/iperf-2.0.4/009-delayloop.patch deleted +0 -20
@@ -1,22 +0,0 @@ -by Kirby Zhou < kirbyzhou \x40 sohu-rd.com > -using sched_yield to schedule other threads, so multiple iperf can run simultaneously -using usleep with delay-loop between 2 package is long than 1.25ms. - -Upstream-Status: Inappropriate [not author] - ---- iperf-2.0.4-4/compat/delay.cpp 2009-07-06 12:02:24.166276642 +0200 -+++ iperf-2.0.4/compat/delay.cpp 2009-07-06 12:01:33.858384005 +0200 -@@ -69,6 +69,13 @@ void delay_loop( unsigned long usec ) { - - Timestamp now; - while ( now.before( end ) ) { -+ long diff = end.subUsec(now); -+ if (diff >= 1250) { -+ usleep(0); -+ } -+ if (diff >= 2) { -+ sched_yield(); -+ } - now.setnow(); - } - }
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/000-Iperf_Fix-CPU-Usag new file +0 -0
+++ e.diff
@@ -0,0 +1,45 @@
+From c7c18bc93441872e7ff2fa47a18a12ef319b7949 Mon Sep 17 00:00:00 2001 +From: Franklin S. Cooper Jr <[email protected]>
+Date: Sat, 6 Oct 2012 12:32:29 -0500
+Subject: [PATCH] iperf: Fix CPU Usage
+
+* Updated the patch 000-Iperf_Fix-CPU-Usage.diff to apply to iperf +v2.0.5
+* That patch was largely based on the patch:
+ http://marc.info/?l=linux-kernel&m=119088670113210&w=2
+* The majority of the changes from 000-Iperf_Fix-CPU-Usage.diff have +been
+ incorporated into iperf v2.0.5.
+* The two remaining thread_rest changes that +000-Iperf_Fix-CPU-Usage.diff
+ made have been added to this version of iperf v2.0.5
+
+Upstream-Status: Inappropriate [not author]
+
+Signed-off-by: Franklin S. Cooper Jr <[email protected]>
+--- + src/Reporter.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Reporter.c b/src/Reporter.c index 7d9263b..4fbb712 +100644
+--- a/src/Reporter.c
++++ b/src/Reporter.c
+@@ -391,7 +391,7 @@ void EndReport( ReportHeader *agent ) {
+ if ( agent != NULL ) {
+ int index = agent->reporterindex;
+ while ( index != -1 ) {
+- thread_rest();
++ Condition_Wait( &ReportDoneCond );
+ index = agent->reporterindex;
+ }
+ agent->agentindex = -1;
+@@ -412,7 +412,7 @@ void EndReport( ReportHeader *agent ) {
+Transfer_Info *GetReport( ReportHeader *agent ) {
+ int index = agent->reporterindex;
+ while ( index != -1 ) {
+- thread_rest();
++ Condition_Wait( &ReportDoneCond );
+ index = agent->reporterindex;
+ }
+ return &agent->report.info;
+--+1.7.0.4
+
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/001-cast-to-max_size_t-instead-of-int.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/001-cast-to-max_size_t-instead-of-int.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/003-fix-hyphen-used-as-minus-sign.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/003-fix-hyphen-used-as-minus-sign.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/005-iperf-die-on-bind-fail.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/005-iperf-die-on-bind-fail.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/007-iperf-reporter-deadlock.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/007-iperf-reporter-deadlock.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf-2.0.5/008-numofreport.patch renamed from meta-oe/recipes-benchmark/iperf/iperf-2.0.4/008-numofreport.patch +0 -0
meta-oe/recipes-benchmark/iperf/iperf_2.0.5.bb renamed from meta-oe/recipes-benchmark/iperf/iperf_2.0.4.bb +4 -6
@@ -4,22 +4,20 @@ SECTION = "console/network" LICENSE = "NewBSD" LIC_FILES_CHKSUM = "file://COPYING;md5=e8478eae9f479e39bc34975193360298" +PR = "r0" + SRC_URI = " \ ${SOURCEFORGE_MIRROR}/iperf/iperf-${PV}.tar.gz \ file://000-Iperf_Fix-CPU-Usage.diff \ file://001-cast-to-max_size_t-instead-of-int.patch \ file://003-fix-hyphen-used-as-minus-sign.patch \ - file://004-svn-r43-ro.patch \ file://005-iperf-die-on-bind-fail.patch \ - file://006-iperf-die-on-connect-fail.patch \ file://007-iperf-reporter-deadlock.patch \ file://008-numofreport.patch \ - file://009-delayloop.patch \ " - -SRC_URI[md5sum] = "8c5bc14cc2ea55f18f22afe3c23e3dcb" -SRC_URI[sha256sum] = "3b52f1c178d6a99c27114929d5469c009197d15379c967b329bafb956f397944" +SRC_URI[md5sum] = "44b5536b67719f4250faed632a3cd016" +SRC_URI[sha256sum] = "636b4eff0431cea80667ea85a67ce4c68698760a9837e1e9d13096d20362265b" inherit autotools
--
1.7.0.4