Discussion:
Regarding toybox 'top' command options support
(too old to reply)
Rob Landley
2017-09-25 12:24:09 UTC
Permalink
Raw Message
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...
enh
2017-09-25 15:14:16 UTC
Permalink
Raw Message
On Mon, Sep 25, 2017 at 5:24 AM, Rob Landley <***@landley.net> wrote:
> 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...

yeah, we had one internal bug raised way back when we switched, told
them "use head", and haven't heard anything since.

>> 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...)

it's easy, but i haven't yet been convinced of the need. i'd rather
teach people to use head(1) because that's a generally useful skill.

> 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...
> _______________________________________________
> Toybox mailing list
> ***@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.
Nelakurthi Koteswara Rao
2017-09-26 03:02:17 UTC
Permalink
Raw Message
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 <***@landley.net>
Sent: 25 September 2017 20:24:09
To: ***@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...
Loading...