[Xen-devel] [PATCH] xen/trace: Adjust types in trace_var() declarations

Andrew Cooper posted 1 patch 4 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190718140009.16021-1-andrew.cooper3@citrix.com
xen/include/xen/trace.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Xen-devel] [PATCH] xen/trace: Adjust types in trace_var() declarations
Posted by Andrew Cooper 4 years, 9 months ago
Use bool rather than int/bool_t for 'cycles' to match the !CONFIG_TRACEBUFFER
version, and use unsigned int rather than int for 'extra' to match the
function it is forwarded to.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Ian Jackson <ian.jackson@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Tim Deegan <tim@xen.org>
CC: Wei Liu <wl@xen.org>
CC: Julien Grall <julien.grall@arm.com>
---
 xen/include/xen/trace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
index e6a4ef93cc..90ffcc68c7 100644
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -41,9 +41,9 @@ int tb_control(struct xen_sysctl_tbuf_op *tbc);
 
 int trace_will_trace_event(u32 event);
 
-void __trace_var(u32 event, bool_t cycles, unsigned int extra, const void *);
+void __trace_var(u32 event, bool cycles, unsigned int extra, const void *);
 
-static inline void trace_var(u32 event, int cycles, int extra,
+static inline void trace_var(u32 event, bool cycles, unsigned int extra,
                              const void *extra_data)
 {
     if ( unlikely(tb_init_done) )
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] xen/trace: Adjust types in trace_var() declarations
Posted by Jan Beulich 4 years, 9 months ago
On 18.07.2019 16:00, Andrew Cooper wrote:
> Use bool rather than int/bool_t for 'cycles' to match the !CONFIG_TRACEBUFFER
> version, and use unsigned int rather than int for 'extra' to match the
> function it is forwarded to.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
albeit I'd have expected the file to by part of the XENTRACE
section of ./MAINTAINERS.

> --- a/xen/include/xen/trace.h
> +++ b/xen/include/xen/trace.h
> @@ -41,9 +41,9 @@ int tb_control(struct xen_sysctl_tbuf_op *tbc);
>   
>   int trace_will_trace_event(u32 event);
>   
> -void __trace_var(u32 event, bool_t cycles, unsigned int extra, const void *);
> +void __trace_var(u32 event, bool cycles, unsigned int extra, const void *);
>   
> -static inline void trace_var(u32 event, int cycles, int extra,
> +static inline void trace_var(u32 event, bool cycles, unsigned int extra,
>                                const void *extra_data)

Would be nice if the u32-s here could go away at the same time.
Ideally they'd become unsigned int, but I guess you're once
again rather seeing them be uint32_t.

Also wouldn't you better adjust __trace_var()'s definition as well
at this occasion?

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel