All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
@ 2018-06-13  3:15 Yaowei Bai
  2018-06-13  3:50 ` Emilio G. Cota
  0 siblings, 1 reply; 7+ messages in thread
From: Yaowei Bai @ 2018-06-13  3:15 UTC (permalink / raw)
  To: mjt, laurent; +Cc: qemu-trivial, stefanha, qemu-devel, Yaowei Bai

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
 docs/devel/tracing.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
index 07abbb3..6ab32cc 100644
--- a/docs/devel/tracing.txt
+++ b/docs/devel/tracing.txt
@@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
 
 3. Run the virtual machine to produce a trace file:
 
-    qemu -trace events=/tmp/events ... # your normal QEMU invocation
+    qemu --trace events=/tmp/events ... # your normal QEMU invocation
 
 4. Pretty-print the binary trace file:
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
  2018-06-13  3:15 [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option Yaowei Bai
@ 2018-06-13  3:50 ` Emilio G. Cota
  2018-06-13  8:44   ` Yaowei Bai
  2018-06-13 11:27   ` Eric Blake
  0 siblings, 2 replies; 7+ messages in thread
From: Emilio G. Cota @ 2018-06-13  3:50 UTC (permalink / raw)
  To: Yaowei Bai; +Cc: mjt, laurent, qemu-trivial, qemu-devel, stefanha

On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote:
> Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> ---
>  docs/devel/tracing.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
> index 07abbb3..6ab32cc 100644
> --- a/docs/devel/tracing.txt
> +++ b/docs/devel/tracing.txt
> @@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
>  
>  3. Run the virtual machine to produce a trace file:
>  
> -    qemu -trace events=/tmp/events ... # your normal QEMU invocation
> +    qemu --trace events=/tmp/events ... # your normal QEMU invocation

The second dash is not missing; both '-args' and '--args' work.

'-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-)

		Emilio

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

* Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
  2018-06-13  3:50 ` Emilio G. Cota
@ 2018-06-13  8:44   ` Yaowei Bai
  2018-06-13 11:27   ` Eric Blake
  1 sibling, 0 replies; 7+ messages in thread
From: Yaowei Bai @ 2018-06-13  8:44 UTC (permalink / raw)
  To: Emilio G. Cota; +Cc: mjt, laurent, qemu-trivial, qemu-devel, stefanha

On Tue, Jun 12, 2018 at 11:50:30PM -0400, Emilio G. Cota wrote:
> On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote:
> > Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> > ---
> >  docs/devel/tracing.txt | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
> > index 07abbb3..6ab32cc 100644
> > --- a/docs/devel/tracing.txt
> > +++ b/docs/devel/tracing.txt
> > @@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
> >  
> >  3. Run the virtual machine to produce a trace file:
> >  
> > -    qemu -trace events=/tmp/events ... # your normal QEMU invocation
> > +    qemu --trace events=/tmp/events ... # your normal QEMU invocation
> 
> The second dash is not missing; both '-args' and '--args' work.
> 
> '-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-)

Oh, you're right. I just checked qemu-nbd/io utilities. Forget about
this change. Thanks. :-)

> 
> 		Emilio

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

* Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
  2018-06-13  3:50 ` Emilio G. Cota
  2018-06-13  8:44   ` Yaowei Bai
@ 2018-06-13 11:27   ` Eric Blake
  2018-06-13 14:15     ` Yaowei Bai
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Blake @ 2018-06-13 11:27 UTC (permalink / raw)
  To: Emilio G. Cota, Yaowei Bai
  Cc: qemu-trivial, mjt, laurent, stefanha, qemu-devel, Markus Armbruster

On 06/12/2018 10:50 PM, Emilio G. Cota wrote:
> On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote:
>> Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
>> ---
>>   docs/devel/tracing.txt | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
>> index 07abbb3..6ab32cc 100644
>> --- a/docs/devel/tracing.txt
>> +++ b/docs/devel/tracing.txt
>> @@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
>>   
>>   3. Run the virtual machine to produce a trace file:
>>   
>> -    qemu -trace events=/tmp/events ... # your normal QEMU invocation
>> +    qemu --trace events=/tmp/events ... # your normal QEMU invocation
> 
> The second dash is not missing; both '-args' and '--args' work.
> 
> '-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-)

Actually, we're trying to fix that:
https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation

The one-vs-two dash usage is only supported in qemu, not in qemu-nbd or 
qemu-img (that is, qemu acts as if it uses getopt_long_only(), while the 
others use getopt_long() - except that we hand-rolled the parser in 
qemu, meaning you might find quirks where it sometimes doesn't even 
match getopt_long_only()).

At any rate, since --trace is an option that is supported across 
multiple binaries, we SHOULD favor the double-dash spelling in our 
documentation, so that you can consistently reuse the same --trace 
invocation without worrying whether the binary parses its arguments with 
getopt_long() (where double is required) or like getopt_long_only() 
(where the double is optional but supported).

So I'm in favor of this patch, although it may need more of a commit 
message summarizing the justification I've just pointed you to.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

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

* Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
  2018-06-13 11:27   ` Eric Blake
@ 2018-06-13 14:15     ` Yaowei Bai
  2018-06-15 17:30       ` Stefan Hajnoczi
  0 siblings, 1 reply; 7+ messages in thread
From: Yaowei Bai @ 2018-06-13 14:15 UTC (permalink / raw)
  To: Eric Blake
  Cc: Emilio G. Cota, qemu-trivial, mjt, laurent, stefanha, qemu-devel,
	Markus Armbruster

On Wed, Jun 13, 2018 at 06:27:49AM -0500, Eric Blake wrote:
> On 06/12/2018 10:50 PM, Emilio G. Cota wrote:
> >On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote:
> >>Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> >>---
> >>  docs/devel/tracing.txt | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >>diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
> >>index 07abbb3..6ab32cc 100644
> >>--- a/docs/devel/tracing.txt
> >>+++ b/docs/devel/tracing.txt
> >>@@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
> >>  3. Run the virtual machine to produce a trace file:
> >>-    qemu -trace events=/tmp/events ... # your normal QEMU invocation
> >>+    qemu --trace events=/tmp/events ... # your normal QEMU invocation
> >
> >The second dash is not missing; both '-args' and '--args' work.
> >
> >'-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-)
> 
> Actually, we're trying to fix that:
> https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation
> 
> The one-vs-two dash usage is only supported in qemu, not in qemu-nbd
> or qemu-img (that is, qemu acts as if it uses getopt_long_only(),
> while the others use getopt_long() - except that we hand-rolled the
> parser in qemu, meaning you might find quirks where it sometimes
> doesn't even match getopt_long_only()).
> 
> At any rate, since --trace is an option that is supported across
> multiple binaries, we SHOULD favor the double-dash spelling in our
> documentation, so that you can consistently reuse the same --trace
> invocation without worrying whether the binary parses its arguments

Yes, this patch is inspired by this situation when translating DPRINT into
trace for a new qemu utility (much like qemu-nbd) following docs/devel/tracing.txt.
The utility complains it don't support -trace option. So i sent this
patch after confirming this with qemu-nbd,qemu-io utilities.

> with getopt_long() (where double is required) or like
> getopt_long_only() (where the double is optional but supported).
> 
> So I'm in favor of this patch, although it may need more of a commit
> message summarizing the justification I've just pointed you to.

Thanks for your nice explaination. If this patch could be merged i will
send V2 with a commit message.

> 
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks.

> 
> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org

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

* Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
  2018-06-13 14:15     ` Yaowei Bai
@ 2018-06-15 17:30       ` Stefan Hajnoczi
  2018-06-18 22:11         ` Eric Blake
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2018-06-15 17:30 UTC (permalink / raw)
  To: Yaowei Bai
  Cc: Eric Blake, Emilio G. Cota, qemu-trivial, mjt, laurent,
	qemu-devel, Markus Armbruster

[-- Attachment #1: Type: text/plain, Size: 2646 bytes --]

On Wed, Jun 13, 2018 at 10:15:10AM -0400, Yaowei Bai wrote:
> On Wed, Jun 13, 2018 at 06:27:49AM -0500, Eric Blake wrote:
> > On 06/12/2018 10:50 PM, Emilio G. Cota wrote:
> > >On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote:
> > >>Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> > >>---
> > >>  docs/devel/tracing.txt | 2 +-
> > >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >>diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt
> > >>index 07abbb3..6ab32cc 100644
> > >>--- a/docs/devel/tracing.txt
> > >>+++ b/docs/devel/tracing.txt
> > >>@@ -18,7 +18,7 @@ for debugging, profiling, and observing execution.
> > >>  3. Run the virtual machine to produce a trace file:
> > >>-    qemu -trace events=/tmp/events ... # your normal QEMU invocation
> > >>+    qemu --trace events=/tmp/events ... # your normal QEMU invocation
> > >
> > >The second dash is not missing; both '-args' and '--args' work.
> > >
> > >'-args' seems to be favoured though; see `qemu -h' or `qemu --h' :-)
> > 
> > Actually, we're trying to fix that:
> > https://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation
> > 
> > The one-vs-two dash usage is only supported in qemu, not in qemu-nbd
> > or qemu-img (that is, qemu acts as if it uses getopt_long_only(),
> > while the others use getopt_long() - except that we hand-rolled the
> > parser in qemu, meaning you might find quirks where it sometimes
> > doesn't even match getopt_long_only()).
> > 
> > At any rate, since --trace is an option that is supported across
> > multiple binaries, we SHOULD favor the double-dash spelling in our
> > documentation, so that you can consistently reuse the same --trace
> > invocation without worrying whether the binary parses its arguments
> 
> Yes, this patch is inspired by this situation when translating DPRINT into
> trace for a new qemu utility (much like qemu-nbd) following docs/devel/tracing.txt.
> The utility complains it don't support -trace option. So i sent this
> patch after confirming this with qemu-nbd,qemu-io utilities.
> 
> > with getopt_long() (where double is required) or like
> > getopt_long_only() (where the double is optional but supported).
> > 
> > So I'm in favor of this patch, although it may need more of a commit
> > message summarizing the justification I've just pointed you to.
> 
> Thanks for your nice explaination. If this patch could be merged i will
> send V2 with a commit message.

Please update the remaining occurrences of the -trace option syntax in
v2:

  $ git grep -- -trace docs/devel/tracing.txt

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

* Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option
  2018-06-15 17:30       ` Stefan Hajnoczi
@ 2018-06-18 22:11         ` Eric Blake
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Blake @ 2018-06-18 22:11 UTC (permalink / raw)
  To: Stefan Hajnoczi, Yaowei Bai
  Cc: Emilio G. Cota, qemu-trivial, mjt, laurent, qemu-devel,
	Markus Armbruster

On 06/15/2018 12:30 PM, Stefan Hajnoczi wrote:

>>>
>>> So I'm in favor of this patch, although it may need more of a commit
>>> message summarizing the justification I've just pointed you to.
>>
>> Thanks for your nice explaination. If this patch could be merged i will
>> send V2 with a commit message.
> 
> Please update the remaining occurrences of the -trace option syntax in
> v2:
> 
>    $ git grep -- -trace docs/devel/tracing.txt

Also fixing strings in trace/control.[ch] would be appropriate.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

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

end of thread, other threads:[~2018-06-18 22:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13  3:15 [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option Yaowei Bai
2018-06-13  3:50 ` Emilio G. Cota
2018-06-13  8:44   ` Yaowei Bai
2018-06-13 11:27   ` Eric Blake
2018-06-13 14:15     ` Yaowei Bai
2018-06-15 17:30       ` Stefan Hajnoczi
2018-06-18 22:11         ` Eric Blake

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.