linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@kernel.org>
To: John Kacur <jkacur@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-trace-devel@vger.kernel.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rtla: Fix -t/--trace[=file]
Date: Fri, 10 May 2024 10:10:48 +0200	[thread overview]
Message-ID: <bb4232d6-2387-425f-9b10-811163e74329@kernel.org> (raw)
In-Reply-To: <20240508212155.71946-1-jkacur@redhat.com>

On 5/8/24 23:21, John Kacur wrote:
> Normally with a short option we don't provide an equals sign like this
> -tfile.txt
> -t file.txt
> 
> But we do provide an equals sign with the long option like this
> --trace=file.txt
> 
> Also, a good parser should work with a space instead of an equals sign
> --trace file.txt
> 
> Most of these are broken!

So, it is set to work _only_ with =file. It would be better to have
it more robust... yes.

> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -tfile.txt
> Saving trace to ile.txt
> File name truncated
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -t file.txt
> Saving trace to timerlat_trace.txt
> Default file name used instead of the requested one.
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -t=file.txt
> Saving trace to file.txt
> This works, but people normally don't use '=' with a short option
> 
> /rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 --trace=file.txt
> Saving trace to ile.txt
> File name truncated
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 --trace file.txt
> timerlat_trace.txt
> Default file name used instead of the requested one.
> 
> After the fix
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -tfile.txt
> Saving trace to file.txt
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -t file.txt
> Saving trace to file.txt
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -t=file.txt
> Saving trace to file.txt
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 --trace=file.txt
> Saving trace to file.txt
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 --trace file.txt
> Saving trace to file.txt
> 
> I also tested -t and --trace without providing a file name both as the
> last requested option and with a following long and short option
> 
> For example
> 
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -t -u
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 --trace -u
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 -t
> ./rtla timerlat hist -P f:95 -u -c0-11 -E3500 -T50 --trace
> 
> And all correctly do Saving trace to timerlat_trace.txt as expected
> 
> This fix is applied to both timerlat top and hist
> and to osnoise top and hist.

Ok, code wise it is fine. But it is still missing the changes for the --help
messages and man pages. Would you mind addressing them?

For instance, removing the need for the =...

s/
-t/--trace[=file]: save the stopped trace to [file|timerlat_trace.txt]
/
-t/--trace [file]: save the stopped trace to [file|timerlat_trace.txt]
/

Also, for the man page we will have to move the -t option from common_options.rst
to common_timerlat_options.rst and common_osnoise_options.rst to fix this in
man rtla-timerlat-top:

       -t, --trace[=file]
          Save the stopped trace to [file|osnoise_trace.txt].

(it is pointing to the wrong file)

Thanks!
-- Daniel


      reply	other threads:[~2024-05-10  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 21:21 [PATCH] rtla: Fix -t/--trace[=file] John Kacur
2024-05-10  8:10 ` Daniel Bristot de Oliveira [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=bb4232d6-2387-425f-9b10-811163e74329@kernel.org \
    --to=bristot@kernel.org \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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).