]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/trace: Fix build with !CONFIG_TRACEBUFFER
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Jul 2019 13:29:35 +0000 (14:29 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Jul 2019 15:51:16 +0000 (16:51 +0100)
GCC reports:

In file included from hvm.c:24:0:
/local/xen.git/xen/include/xen/trace.h: In function ‘tb_control’:
/local/xen.git/xen/include/xen/trace.h:60:13: error: ‘ENOSYS’
undeclared (first use in this function)
     return -ENOSYS;
             ^~~~~~

Include xen/errno.h to resolve the issue.  While tweaking this, add comments
to the #else and #endif, as they are a fair distance apart.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/trace.h

index fad92c784a11555604679f7f463a0d8ade4b114d..e6a4ef93ccf8601174ca09578b42e11b87d2516e 100644 (file)
@@ -53,7 +53,10 @@ static inline void trace_var(u32 event, int cycles, int extra,
 void __trace_hypercall(uint32_t event, unsigned long op,
                        const xen_ulong_t *args);
 
-#else
+#else /* CONFIG_TRACEBUFFER */
+
+#include <xen/errno.h>
+
 static inline void init_trace_bufs(void) {}
 static inline int tb_control(struct xen_sysctl_tbuf_op *tbc)
 {
@@ -71,7 +74,7 @@ static inline void __trace_var(uint32_t event, bool cycles, unsigned int extra,
                                const void *extra_data) {}
 static inline void __trace_hypercall(uint32_t event, unsigned long op,
                                      const xen_ulong_t *args) {}
-#endif
+#endif /* CONFIG_TRACEBUFFER */
 
 /* Convenience macros for calling the trace function. */
 #define TRACE_0D(_e)                            \