mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Arcari <darcari@redhat.com>
To: linux-pm@vger.kernel.org
Cc: Len Brown <lenb@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/power turbostat: make the '-n' command line argument work in all cases
Date: Tue, 4 Jun 2024 11:28:12 -0400	[thread overview]
Message-ID: <2830be33-eea3-4bee-9f4d-8d96544e4d80@redhat.com> (raw)
In-Reply-To: <20240520185749.1404283-1-darcari@redhat.com>


Hi,

On 5/20/24 14:57, David Arcari wrote:
> In some cases specifying the '-n' command line argument will cause
> turbostat to fail.  For instance 'turbostat -n 1' works fine; however,
> 'turbostat -n 1 -d' will fail.  This is the result of the first call
> to getopt_long_only() where "MP" is specified as the optstring.  This can
> be easily fixed by changing the optstring from "MP" to "MPn:" to remove
> ambiguity between the arguments.
> 
> Signed-off-by: David Arcari <darcari@redhat.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-kernel@vger.kernel.org

Is there a problem with this commit?  I don't believe it has been merged 
or otherwise replied to.

Thanks,
-DA

> ---
>   tools/power/x86/turbostat/turbostat.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index 98256468e248..8071a3ef2a2e 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -7851,7 +7851,7 @@ void cmdline(int argc, char **argv)
>   	 * Parse some options early, because they may make other options invalid,
>   	 * like adding the MSR counter with --add and at the same time using --no-msr.
>   	 */
> -	while ((opt = getopt_long_only(argc, argv, "MP", long_options, &option_index)) != -1) {
> +	while ((opt = getopt_long_only(argc, argv, "MPn:", long_options, &option_index)) != -1) {
>   		switch (opt) {
>   		case 'M':
>   			no_msr = 1;


      reply	other threads:[~2024-06-04 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 18:57 David Arcari
2024-06-04 15:28 ` David Arcari [this message]

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=2830be33-eea3-4bee-9f4d-8d96544e4d80@redhat.com \
    --to=darcari@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@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

all inboxes | Powered by JetHome®