[Toybox] Regarding toybox 'top' command options support

Nelakurthi Koteswara Rao kote at oneplus.net
Mon Sep 25 20:02:17 PDT 2017


Hi Rob landley


thank you for posting my 'top -m ' command support

request to toybox mailing list


Regards

Department | Linux BSP

+86 1866690-6337
5 / F, East Block, Tang Tang Building, Tairan Road, Shenzhen
5 / F, East Tower, Sheng Tang Building, No.9 Tai Ran Road, Shenzhen, China

[OnePlus.net]<http://oneplus.net/> [Facebook] <http://facebook.com/oneplusofficial>  [Twitter] <http://twitter.com/oneplus>  [LinkedIn] <https://www.linkedin.com/company/oneplus>  [cid:58961610-cbef-40f3-a2ea-9a85ab22d8e4] <http://weibo.com/oneplusmobile?refer_flag=0000015010_&from=feed&loc=nickname>
This message may be confidential, and its contents should not be reproduced without prior written consent.


________________________________
From: Rob Landley <rob at landley.net>
Sent: 25 September 2017 20:24:09
To: toybox at lists.landley.net
Subject: Re: Regarding toybox 'top' command options support

I've cc'd my reply to the toybox mailing list, but removed the
identifying info from the submitter rather than do the "can I post this"
round trip. (They can reply publicly if they like.)

On 09/22/2017 07:26 AM, XXX wrote:
> Dear Rob Landley
>
> I  have gone through toybox code developed by  you.
> I  need small information regarding code changes
> required to support 'top -m ' command.

I tried "top -m" on ubuntu and it didn't know what that was...

> In toolbox(old version) , support 'top -m  x'command to
> display <x> lines from 'top' command output.

During normal operation you can override the secreen size detection via
the environment variable $LINES, ala:

  LINES=10 top

But that doesn't affect -b mode...

> But this '-m' option is not supported  yet in toybox code.

My assumption was if you're using "top -bn1" you'd pipe it through "head
-n ##", to trim the output, but I suppose I can see it being useful for
multiple -b output iterations...

> So could you please let me know the source code changes
> that are need to be done in top_common() function
> present in toybox/toys/posix/ps.c file.?

I.E. this is a feature request to add -m to top? :)

Hey Elliott, given this was an android addition to begin with, what do
you think? (It's easy enough to add...)

Rob

P.S. Poking at this, top and iotop have a common option block but -H and
-O weren't applied to iotop so either they should be or the options
should be moved to the earlier quoted string in the NEWTOY macro to mark
them as not common... And -O differs because iotop uses it to mean
something else. But maybe -H can be shared...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170926/0e7e8614/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-eddc6f66-cff9-4f97-84ef-aa610a5f115c.png
Type: image/png
Size: 19654 bytes
Desc: OutlookEmoji-eddc6f66-cff9-4f97-84ef-aa610a5f115c.png
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170926/0e7e8614/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-eb6ecb29-ae10-4f53-9ee4-80cb7f4675aa.png
Type: image/png
Size: 19654 bytes
Desc: OutlookEmoji-eb6ecb29-ae10-4f53-9ee4-80cb7f4675aa.png
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170926/0e7e8614/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-55146c0c-ed7b-43fc-b001-e94adeeeaac7.png
Type: image/png
Size: 19654 bytes
Desc: OutlookEmoji-55146c0c-ed7b-43fc-b001-e94adeeeaac7.png
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170926/0e7e8614/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-37ed69a8-ff7c-4fd1-a39d-e26107964792.png
Type: image/png
Size: 19654 bytes
Desc: OutlookEmoji-37ed69a8-ff7c-4fd1-a39d-e26107964792.png
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170926/0e7e8614/attachment-0015.png>


More information about the Toybox mailing list