* [Qemu-devel] [PATCH] trace: Allow events without arguments
@ 2016-08-26 9:12 Lluís Vilanova
2016-09-05 17:49 ` Stefan Hajnoczi
0 siblings, 1 reply; 4+ messages in thread
From: Lluís Vilanova @ 2016-08-26 9:12 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
scripts/tracetool/__init__.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index be24039..96657e6 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -72,6 +72,11 @@ class Arguments:
arg_str : str
String describing the event arguments.
"""
+ # check for empty argument list
+ arg_str = arg_str.strip()
+ if arg_str == "":
+ return Arguments([])
+
res = []
for arg in arg_str.split(","):
arg = arg.strip()
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Allow events without arguments
2016-08-26 9:12 [Qemu-devel] [PATCH] trace: Allow events without arguments Lluís Vilanova
@ 2016-09-05 17:49 ` Stefan Hajnoczi
2016-09-06 8:47 ` Lluís Vilanova
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-09-05 17:49 UTC (permalink / raw)
To: Lluís Vilanova; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 848 bytes --]
On Fri, Aug 26, 2016 at 11:12:47AM +0200, Lluís Vilanova wrote:
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
> scripts/tracetool/__init__.py | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
> index be24039..96657e6 100644
> --- a/scripts/tracetool/__init__.py
> +++ b/scripts/tracetool/__init__.py
> @@ -72,6 +72,11 @@ class Arguments:
> arg_str : str
> String describing the event arguments.
> """
> + # check for empty argument list
> + arg_str = arg_str.strip()
> + if arg_str == "":
> + return Arguments([])
> +
Why is this necessary? C syntax uses f(void) and not f().
We already have trace events with no argument. They use the correct C
syntax.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Allow events without arguments
2016-09-05 17:49 ` Stefan Hajnoczi
@ 2016-09-06 8:47 ` Lluís Vilanova
2016-09-13 15:40 ` Stefan Hajnoczi
0 siblings, 1 reply; 4+ messages in thread
From: Lluís Vilanova @ 2016-09-06 8:47 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel
Stefan Hajnoczi writes:
> On Fri, Aug 26, 2016 at 11:12:47AM +0200, Lluís Vilanova wrote:
>> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>> ---
>> scripts/tracetool/__init__.py | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
>> index be24039..96657e6 100644
>> --- a/scripts/tracetool/__init__.py
>> +++ b/scripts/tracetool/__init__.py
>> @@ -72,6 +72,11 @@ class Arguments:
>> arg_str : str
>> String describing the event arguments.
>> """
>> + # check for empty argument list
>> + arg_str = arg_str.strip()
>> + if arg_str == "":
>> + return Arguments([])
>> +
> Why is this necessary? C syntax uses f(void) and not f().
> We already have trace events with no argument. They use the correct C
> syntax.
Sorry, I wasn't aware of that. My bad.
Thanks,
Lluis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Allow events without arguments
2016-09-06 8:47 ` Lluís Vilanova
@ 2016-09-13 15:40 ` Stefan Hajnoczi
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-09-13 15:40 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
On Tue, Sep 06, 2016 at 10:47:33AM +0200, Lluís Vilanova wrote:
> Stefan Hajnoczi writes:
>
> > On Fri, Aug 26, 2016 at 11:12:47AM +0200, Lluís Vilanova wrote:
> >> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> >> ---
> >> scripts/tracetool/__init__.py | 5 +++++
> >> 1 file changed, 5 insertions(+)
> >>
> >> diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
> >> index be24039..96657e6 100644
> >> --- a/scripts/tracetool/__init__.py
> >> +++ b/scripts/tracetool/__init__.py
> >> @@ -72,6 +72,11 @@ class Arguments:
> >> arg_str : str
> >> String describing the event arguments.
> >> """
> >> + # check for empty argument list
> >> + arg_str = arg_str.strip()
> >> + if arg_str == "":
> >> + return Arguments([])
> >> +
>
> > Why is this necessary? C syntax uses f(void) and not f().
>
> > We already have trace events with no argument. They use the correct C
> > syntax.
>
> Sorry, I wasn't aware of that. My bad.
BTW the details of this syntax difference exists between C and C++:
In C++ foo() means foo(void).
In C you can say foo() but it means something different. It means the
parameters are unspecified. You can pass any arguments and the compiler
will do no type-checking!
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-13 15:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26 9:12 [Qemu-devel] [PATCH] trace: Allow events without arguments Lluís Vilanova
2016-09-05 17:49 ` Stefan Hajnoczi
2016-09-06 8:47 ` Lluís Vilanova
2016-09-13 15:40 ` Stefan Hajnoczi
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.