From: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
To: util-linux@vger.kernel.org, Karel Zak <kzak@redhat.com>,
Benno Schulenberg <bensberg@telfort.nl>
Cc: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: [PATCH v4 1/3] chrt: Make minor cleanups in chrt
Date: Sun, 22 Jun 2025 01:20:46 +0530 [thread overview]
Message-ID: <20250621195048.24900-2-vineethr@linux.ibm.com> (raw)
In-Reply-To: <20250621195048.24900-1-vineethr@linux.ibm.com>
Minor changes such as fixing an incorrect comment and aligning
the closing brace of an if condition in main() were made, along
with making the usage of --pid consistent across files instead
of -p, although -p still works, for better readability.
No functional change is intended.
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
---
schedutils/chrt.1.adoc | 10 +++++-----
schedutils/chrt.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/schedutils/chrt.1.adoc b/schedutils/chrt.1.adoc
index 77add535d..36cdcc5fe 100644
--- a/schedutils/chrt.1.adoc
+++ b/schedutils/chrt.1.adoc
@@ -40,7 +40,7 @@ chrt - manipulate the real-time attributes of a process
*chrt* [options] _priority command argument_ ...
-*chrt* [options] *-p* [_priority_] _PID_
+*chrt* [options] *--pid* [_priority_] _PID_
== DESCRIPTION
@@ -117,20 +117,20 @@ ____
//TRANSLATORS: Keep {colon} untranslated
You can also retrieve the real-time attributes of an existing task{colon}::
____
-*chrt -p* _PID_
+*chrt --pid* _PID_
____
//TRANSLATORS: Keep {colon} untranslated
Or set them{colon}::
____
-*chrt -r -p* _priority PID_
+*chrt -r --pid* _priority PID_
____
This, for example, sets real-time scheduling to priority _30_ for the process _PID_ with the *SCHED_RR* (round-robin) class{colon}::
____
-*chrt -r -p 30* _PID_
+*chrt -r --pid 30* _PID_
____
Reset priorities to default for a process{colon}::
____
-*chrt -o -p 0* _PID_
+*chrt -o --pid 0* _PID_
____
See *sched*(7) for a detailed discussion of the different scheduler classes and how they interact.
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index cf99935dc..8fe748f43 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -64,7 +64,7 @@ static void __attribute__((__noreturn__)) usage(void)
" chrt [options] --pid <priority> <pid>\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_("Get policy:\n"
- " chrt [options] -p <pid>\n"), out);
+ " chrt [options] --pid <pid>\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_("Policy options:\n"), out);
@@ -341,7 +341,7 @@ static int set_sched_one(struct chrt_ctl *ctl, pid_t pid)
return set_sched_one_by_setscheduler(ctl, pid);
}
-#else /* !HAVE_SCHED_SETATTR */
+#else /* HAVE_SCHED_SETATTR */
static int set_sched_one(struct chrt_ctl *ctl, pid_t pid)
{
struct sched_attr sa = { .size = sizeof(struct sched_attr) };
@@ -499,7 +499,7 @@ int main(int argc, char **argv)
((ctl->pid == -1) && argc - optind < 2)) {
warnx(_("bad usage"));
errtryhelp(EXIT_FAILURE);
-}
+ }
if ((ctl->pid > -1) && (ctl->verbose || argc - optind == 1)) {
show_sched_info(ctl);
--
2.49.0
next prev parent reply other threads:[~2025-06-21 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-21 19:50 [PATCH v4 0/3] chrt: Improve argument handling and allow optional priority Madadi Vineeth Reddy
2025-06-21 19:50 ` Madadi Vineeth Reddy [this message]
2025-06-21 19:50 ` [PATCH v4 2/3] chrt: Only display current settings when no policy is specified Madadi Vineeth Reddy
2025-06-21 19:50 ` [PATCH v4 3/3] chrt: Make priority optional for policies that don't use it Madadi Vineeth Reddy
2025-06-24 9:21 ` [PATCH v4 0/3] chrt: Improve argument handling and allow optional priority Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250621195048.24900-2-vineethr@linux.ibm.com \
--to=vineethr@linux.ibm.com \
--cc=bensberg@telfort.nl \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).