[Toybox] ps: only stat() /proc/<pid>

enh enh at google.com
Fri Dec 9 14:46:03 PST 2016


almost works. the attached patch finishes the job...

On Thu, Dec 8, 2016 at 7:34 PM, Rob Landley <rob at landley.net> wrote:
> On 10/26/2016 03:14 PM, Mark Salyzyn wrote:
>>>From the AOSP gerrit fixing internal bug 32399196
>> ( https://android-review.googlesource.com/#/c/295732 )
>>
>> Change subject: dirtree: add DIRTREE_NOSTAT flag
>>
>> Callback from top /proc/ node tells dirtree to hold off performing
>> a fstatat() call until after we hare satisfied with the name being
>> numerical.  Affects ps and pgrep superfluous calls.
>
> Sorry it took so long to get to this one, crazy couple months. Trying to
> dig through the backlog.
>
> I just pushed a commit adding DIRTREE_PROC (skips non-numeric entries in
> dirtree_recurse) and making ps.c use it. Does this address the issue for
> you, or do you still need bits of these two changes?
>
> (I tried doing a dirtree_proc() function you call instead of
> dirtree_read() that automatically opens /proc, but wound up reproducing
> too much infrastructure. Might try again as a wrapper though.)
>
> Thanks,
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Pass-DIRTREE_PROC-through-the-ps-callbacks.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20161209/39632ed2/attachment-0004.bin>


More information about the Toybox mailing list