Re: Allow top(1) to search arguments (again)

2016-05-28 Thread Edd Barrett
On Wed, May 11, 2016 at 02:28:51PM +0200, Michal Mazurek wrote: > As discussed off list, "if (!term)" is redundant, as the caller does the > check. > > Also fix whitespace in some unrelated places. Can you split out the "term" change from style changes? You can do a KNF whack in a separate

Re: Allow top(1) to search arguments (again)

2016-05-11 Thread Ted Unangst
this improves the realloc loop. there is no need to constantly call realloc to resize the memory. if we have enough, we have enough. also no need to penny pinch the initial allocation. calling sysctl all the time is still wasteful, but harder to fix. Index: machine.c

Re: Allow top(1) to search arguments (again)

2016-05-11 Thread Michal Mazurek
As discussed off list, "if (!term)" is redundant, as the caller does the check. Also fix whitespace in some unrelated places. Index: usr.bin/top/display.c === RCS file: /cvs/src/usr.bin/top/display.c,v retrieving revision 1.50 diff

Re: Allow top(1) to search arguments (again)

2016-05-10 Thread Ted Unangst
Edd Barrett wrote: > On Thu, Apr 28, 2016 at 03:26:48PM +0100, Edd Barrett wrote: > > Resubmitting this diff, as I've been unable to get an OK. > > Style tweaks fixed, as pointed out by Michal Mazurek. Thanks for this. > > OK? ok

Re: Allow top(1) to search arguments (again)

2016-05-10 Thread Edd Barrett
On Thu, Apr 28, 2016 at 03:26:48PM +0100, Edd Barrett wrote: > Resubmitting this diff, as I've been unable to get an OK. Style tweaks fixed, as pointed out by Michal Mazurek. Thanks for this. OK? Index: machine.c === RCS file:

Allow top(1) to search arguments (again)

2016-04-28 Thread Edd Barrett
Hi, Resubmitting this diff, as I've been unable to get an OK. Original blurb: > I'd like top(1)'s filter feature (-g) to search process arguments. This > would make searching for (e.g.) Python scripts by name much easier. The > current behaviour only searches the program name, which for scripts

Re: Allow top(1) to search arguments

2016-03-09 Thread Edd Barrett
On Fri, Feb 12, 2016 at 06:59:02PM +, Edd Barrett wrote: > Updated diff: I've now tested the updated diff on sparc64 and amd64 with S malloc flags for a while. No issues. Would anyone go as far as "OK"? -- Best Regards Edd Barrett http://www.theunixzoo.co.uk

Re: Allow top(1) to search arguments

2016-02-12 Thread Edd Barrett
Hey, Thanks all for the comments. On Wed, Feb 10, 2016 at 04:27:38PM -0800, patrick keshishian wrote: > NULL pointer dereference is possible here. > > Also, unclear why you need both arg and args variables. ^ Fix these and make cmd_matches() static. Updated diff: Index: machine.c

Re: Allow top(1) to search arguments

2016-02-10 Thread patrick keshishian
On Wed, Feb 10, 2016 at 11:04:18PM +, Edd Barrett wrote: > Hey, > > I'd like top(1)'s filter feature (-g) to search process arguments. This > would make searching for (e.g.) Python scripts by name much easier. The > current behaviour only searches the program name, which for scripts is > the

Allow top(1) to search arguments

2016-02-10 Thread Edd Barrett
Hey, I'd like top(1)'s filter feature (-g) to search process arguments. This would make searching for (e.g.) Python scripts by name much easier. The current behaviour only searches the program name, which for scripts is the interpreter binary name (e.g. python2.7). Currently the best you could do