chrt: Only display current settings when no policy is specified
Previously, running "chrt --pid <pid>" with no policy options
would display the process’s current scheduling attributes, but
specifying a policy without a priority (e.g. chrt --rr --pid <pid>)
would silently fallback to displaying the same info. This was
confusing, since a policy option normally implies an intent to
change something.
This patch changes the behavior so that
chrt --pid <pid> continues to show the current settings:
chrt --pid 10862
pid 10862's current scheduling policy: SCHED_OTHER
pid 10862's current scheduling priority: 0
pid 10862's current runtime parameter:
2800000
If a policy is specified but no priority follows, chrt now
errors out:
chrt --rr --pid 10862
chrt: policy SCHED_RR requires a priority argument
Verbose output (-v) still prints the current settings when a
valid policy+priority is provided.
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>