[bitbake-devel] [PATCH 0/2] V4 replace os.system and os.popen with subbprocess module

Chris Larson clarson at kergoth.com
Sun May 20 18:16:30 UTC 2012


On Sun, May 20, 2012 at 5:36 AM, Robert Yang <liezhi.yang at windriver.com> wrote:
> * Changes of V4:
>  Fix use readline() for the return value of bb.process.run(), the
>  return value is already a string, we can't (or don't have to) use
>  readline() for it, the string is what we need.
>
> * Changes of V3:
>  Use bb.process.run() rather than bb.process.Popen() to replace os.popen()
>
> * Changes of V2:
>
>  - Remove the 2>/dev/null since we dont' need it.
>  - Use the wrapped Popen from bb.process, which is simpler than
>    subprocess.Popen(....).
>
> * Original message of V1:
> Replace os.popen and os.system with subprocess.Popen and
> subprocess.call, since the older functions would fail (more or less) if
> the executed program cannot be found, this would cause potential errors
> since we don't know whether the problem executed well or not.
>
> For the performance issue, I've done the testing before the patches and
> after with the oe-core layer (also the oe-core have applied the similar
> patches):
>
> # The sources are on local disk
>
> 1) Before applied these pacthes to bitbake and similar patches to oe-core:
> $ time bitbake core-image-sato
> real    177m50.723s
> user    436m1.551s
> sys     71m29.588s
>
> 2) After applied the pathes:
> $ time bitbake core-image-sato
> real    176m26.194s
> user    436m7.931s
> sys     71m1.994s
>
> After applied these patches, the time has reduced 84 seconds, this is
> very slight, I think that we can assume this is just a deviation, it
> doesn't cause performance problems.

This version looks good to me.
-- 
Christopher Larson




More information about the bitbake-devel mailing list