All of lore.kernel.org
 help / color / mirror / Atom feed
* chrt: inconsistency in --help
@ 2015-06-09  8:37 Martin Steigerwald
  2015-06-09  9:24 ` Karel Zak
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Steigerwald @ 2015-06-09  8:37 UTC (permalink / raw)
  To: util-linux

Hi!

In wheezy I have (util-linux 2.20.1-5.3):

somehost:~$ chrt --help

chrt - manipulate real-time attributes of a process

Set policy:
  chrt [options] <policy> <priority> {<pid> | <command> [<arg> ...]}

Get policy:
  chrt [options] {<pid> | <command> [<arg> ...]}


And this works for a PID if I place "-p" with the options. Like this:

chrt -p -i 0 $$
chrt -pi 0 $$
chrt -i -p 0 $$
chrt -ip 0 $$


In Jessie I have(util-linux 2.25.2-6):

somehost:~$ chrt --help

chrt - manipulate real-time attributes of a process

Set policy:
  chrt [options] [<policy>] <priority> [-p <pid> | <command> [<arg>...]]

Get policy:
  chrt [options] -p <pid>


And this doesn´t work:

chrt -i 0 -p $$
chrt: failed to execute -p: No such file or directory


Suggestion:

1) Either make chrt command parsing more flexible (preffered)

2) or or even and change set policy to

Set policy:
  chrt [options] [-p] [<policy>] <priority> [<pid> | <command> [<arg>...]]


But well second option separates -p from pid. So maybe option 1 is the way 
to go.

What do you think?

Ciao,

-- 
Martin Steigerwald  | Consultant / Trainer

teamix GmbH
Südwestpark 43
90449 Nürnberg

Tel.:  +49 911 30999 55 | Fax: +49 911 30999 99
mail: martin.steigerwald@teamix.de | web:  http://www.teamix.de | blog: http://blog.teamix.de

Amtsgericht Nürnberg, HRB 18320 | Geschäftsführer: Oliver Kügow, Richard Müller

***Nicht verpassen: NSX Roadshow "Optimierte Sicherheit für das moderne Rechenzentrum - Sicherheit im Wandel" mit teamix, TrendMicro und VMware***
Nürnberg 18.06. | München 02.07. | Frankfurt 16.07. | Stuttgart 23.07.

Jetzt anmelden: www.teamix.de/nsx-roadshow


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: chrt: inconsistency in --help
  2015-06-09  8:37 chrt: inconsistency in --help Martin Steigerwald
@ 2015-06-09  9:24 ` Karel Zak
  2015-06-11  9:03   ` Benno Schulenberg
  0 siblings, 1 reply; 4+ messages in thread
From: Karel Zak @ 2015-06-09  9:24 UTC (permalink / raw)
  To: Martin Steigerwald; +Cc: util-linux

On Tue, Jun 09, 2015 at 10:37:46AM +0200, Martin Steigerwald wrote:
> Suggestion:
> 
> 1) Either make chrt command parsing more flexible (preffered)

 Unfortunately we have to care about backward compatibility...

> 2) or or even and change set policy to
> 
> Set policy:
>   chrt [options] [-p] [<policy>] <priority> [<pid> | <command> [<arg>...]]

 Yes, I have modified --help output to this

> But well second option separates -p from pid. So maybe option 1 is the way 
> to go.

 It's not elegant, but unfortunately used for years and I don't think
 we want to make it more complex by any improvement.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: chrt: inconsistency in --help
  2015-06-09  9:24 ` Karel Zak
@ 2015-06-11  9:03   ` Benno Schulenberg
  2015-06-15 13:09     ` Karel Zak
  0 siblings, 1 reply; 4+ messages in thread
From: Benno Schulenberg @ 2015-06-11  9:03 UTC (permalink / raw)
  To: Karel Zak; +Cc: Martin Steigerwald, Util-Linux


On Tue, Jun 9, 2015, at 11:24, Karel Zak wrote:
> On Tue, Jun 09, 2015 at 10:37:46AM +0200, Martin Steigerwald wrote:
> > Set policy:
> >   chrt [options] [-p] [<policy>] <priority> [<pid> | <command> [<arg>...]]
> 
>  Yes, I have modified --help output to this

Well, -p is just one of the possible options, so it could be simply
subsumed under [options].  Also, the brackets around "<pid> | <command>
[<arg>..." seem to say that both <pid> and <command> are optional,
but they are not when the <priority> is given.  Furthermore, <policy>
seems to suggest it is something like "WORD" or "name" or "12345",
but in fact it is a certain type of option, starting with a dash.
So I think the current synopsis is rather confusing.

The man page summarizes the command as follows:
    chrt [options] priority command [argument...]
    chrt [options] -p [priority] pid

The first line shows how to run a command with certain attributes,
the second how to query or modify the attributes of an existing process.
Quite clear.

So, to make usage synopsis clearer and correct I would suggest
rewriting it as:

Set policy:
    chrt [options] <priority> <command> [<arg>...]
    chrt [options] -p <priority> <pid>

The first of the upcoming two patches makes this change.

Benno

-- 
http://www.fastmail.com - Accessible with your email software
                          or over the web


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: chrt: inconsistency in --help
  2015-06-11  9:03   ` Benno Schulenberg
@ 2015-06-15 13:09     ` Karel Zak
  0 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2015-06-15 13:09 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Martin Steigerwald, Util-Linux

On Thu, Jun 11, 2015 at 11:03:48AM +0200, Benno Schulenberg wrote:
> So, to make usage synopsis clearer and correct I would suggest
> rewriting it as:
> 
> Set policy:
>     chrt [options] <priority> <command> [<arg>...]
>     chrt [options] -p <priority> <pid>

 OK, it looks better.
 
> The first of the upcoming two patches makes this change.

 Applied, thanks!

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-15 13:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-09  8:37 chrt: inconsistency in --help Martin Steigerwald
2015-06-09  9:24 ` Karel Zak
2015-06-11  9:03   ` Benno Schulenberg
2015-06-15 13:09     ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.