[Qemu-devel] [PATCH 06/10] thunk.c: clean up commented out definition

Cleber Rosa posted 10 patches 7 years, 4 months ago
[Qemu-devel] [PATCH 06/10] thunk.c: clean up commented out definition
Posted by Cleber Rosa 7 years, 4 months ago
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 thunk.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/thunk.c b/thunk.c
index d5d8645cd4..e351ae53af 100644
--- a/thunk.c
+++ b/thunk.c
@@ -21,8 +21,6 @@
 #include "qemu.h"
 #include "exec/user/thunk.h"
 
-//#define DEBUG
-
 static unsigned int max_struct_entries;
 StructEntry *struct_entries;
 
-- 
2.17.1


Re: [Qemu-devel] [PATCH 06/10] thunk.c: clean up commented out definition
Posted by Laurent Vivier 7 years, 4 months ago
Le 04/10/2018 à 18:18, Cleber Rosa a écrit :
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  thunk.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/thunk.c b/thunk.c
> index d5d8645cd4..e351ae53af 100644
> --- a/thunk.c
> +++ b/thunk.c
> @@ -21,8 +21,6 @@
>  #include "qemu.h"
>  #include "exec/user/thunk.h"
>  
> -//#define DEBUG
> -

Generally we use that to enable easily existing debug traces.

In this case, if you remove the "#define" I think you should also
replace the "#ifdef DEBUG"s by some trace_XXXX() functions.

Thanks,
Laurent


Re: [Qemu-devel] [PATCH 06/10] thunk.c: clean up commented out definition
Posted by Cleber Rosa 7 years, 4 months ago

On 10/4/18 12:24 PM, Laurent Vivier wrote:
> Le 04/10/2018 à 18:18, Cleber Rosa a écrit :
>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
>> ---
>>  thunk.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/thunk.c b/thunk.c
>> index d5d8645cd4..e351ae53af 100644
>> --- a/thunk.c
>> +++ b/thunk.c
>> @@ -21,8 +21,6 @@
>>  #include "qemu.h"
>>  #include "exec/user/thunk.h"
>>  
>> -//#define DEBUG
>> -
> 
> Generally we use that to enable easily existing debug traces.
> 

Oh, I wasn't aware that was intentional (I clearly lack some background
here).

> In this case, if you remove the "#define" I think you should also
> replace the "#ifdef DEBUG"s by some trace_XXXX() functions.
> 

Is that desirable? I don't want to disrupt the status quo just because
it looked odd to me.

Thanks!
- Cleber.

> Thanks,
> Laurent
> 

Re: [Qemu-devel] [PATCH 06/10] thunk.c: clean up commented out definition
Posted by Laurent Vivier 7 years, 4 months ago
Le 04/10/2018 à 18:31, Cleber Rosa a écrit :
> 
> 
> On 10/4/18 12:24 PM, Laurent Vivier wrote:
>> Le 04/10/2018 à 18:18, Cleber Rosa a écrit :
>>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
>>> ---
>>>  thunk.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/thunk.c b/thunk.c
>>> index d5d8645cd4..e351ae53af 100644
>>> --- a/thunk.c
>>> +++ b/thunk.c
>>> @@ -21,8 +21,6 @@
>>>  #include "qemu.h"
>>>  #include "exec/user/thunk.h"
>>>  
>>> -//#define DEBUG
>>> -
>>
>> Generally we use that to enable easily existing debug traces.
>>
> 
> Oh, I wasn't aware that was intentional (I clearly lack some background
> here).
> 
>> In this case, if you remove the "#define" I think you should also
>> replace the "#ifdef DEBUG"s by some trace_XXXX() functions.
>>
> 
> Is that desirable? I don't want to disrupt the status quo just because
> it looked odd to me.

Yes, it's better to have trace_XXX() functions than DEBUG macros. The
change is trivial (add the format strings in ./trace-events and call
them from thunk.c with the existing parameters)

Thanks,
Laurent