|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] xen/trace: Drop old trace API
commit 9c5444b01ad51369bc09197a442a93d87b4b76f2
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Sep 20 13:40:21 2021 +0100
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon May 20 18:29:44 2024 +0100
xen/trace: Drop old trace API
With all users updated to the new API, drop the old API. This includes all
of
asm/hvm/trace.h, which allows us to drop some includes.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxx>
---
xen/arch/x86/hvm/emulate.c | 1 -
xen/arch/x86/hvm/hpet.c | 1 -
xen/arch/x86/hvm/hvm.c | 1 -
xen/arch/x86/hvm/io.c | 1 -
xen/arch/x86/hvm/svm/intr.c | 1 -
xen/arch/x86/hvm/svm/svm.c | 1 -
xen/arch/x86/hvm/vlapic.c | 1 -
xen/arch/x86/hvm/vmx/intr.c | 1 -
xen/arch/x86/hvm/vmx/vmx.c | 1 -
xen/arch/x86/include/asm/hvm/trace.h | 114 ---------------------------------
xen/arch/x86/include/asm/hvm/vmx/vmx.h | 1 -
xen/common/trace.c | 12 +---
xen/include/xen/trace.h | 47 --------------
13 files changed, 3 insertions(+), 180 deletions(-)
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index a37525316c..02e378365b 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -22,7 +22,6 @@
#include <asm/hvm/emulate.h>
#include <asm/hvm/hvm.h>
#include <asm/hvm/monitor.h>
-#include <asm/hvm/trace.h>
#include <asm/hvm/support.h>
#include <asm/iocap.h>
#include <asm/vm_event.h>
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 4c5b171922..12b00b7702 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -8,7 +8,6 @@
#include <asm/hvm/vpt.h>
#include <asm/hvm/io.h>
#include <asm/hvm/save.h>
-#include <asm/hvm/trace.h>
#include <asm/current.h>
#include <asm/hpet.h>
#include <asm/mc146818rtc.h>
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 30fb9d095a..2c66fe0f7a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -51,7 +51,6 @@
#include <asm/hvm/vpt.h>
#include <asm/hvm/support.h>
#include <asm/hvm/cacheattr.h>
-#include <asm/hvm/trace.h>
#include <asm/hvm/nestedhvm.h>
#include <asm/hvm/monitor.h>
#include <asm/hvm/viridian.h>
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 06283b41c4..db726b3817 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -28,7 +28,6 @@
#include <asm/hvm/vpt.h>
#include <asm/hvm/vpic.h>
#include <asm/hvm/vlapic.h>
-#include <asm/hvm/trace.h>
#include <asm/hvm/emulate.h>
#include <public/sched.h>
#include <xen/iocap.h>
diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index dc684fdc84..780c7e178a 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -24,7 +24,6 @@
#include <xen/kernel.h>
#include <public/hvm/ioreq.h>
#include <xen/domain_page.h>
-#include <asm/hvm/trace.h>
#include "nestedhvm.h"
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 94fa3227b9..db530d55f2 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -28,7 +28,6 @@
#include <asm/hvm/svm/svm.h>
#include <asm/hvm/svm/svmdebug.h>
#include <asm/hvm/svm/vmcb.h>
-#include <asm/hvm/trace.h>
#include <asm/iocap.h>
#include <asm/i387.h>
#include <asm/monitor.h>
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 4f5e714aa4..6a11f4d94d 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -27,7 +27,6 @@
#include <asm/hvm/io.h>
#include <asm/hvm/support.h>
#include <asm/hvm/nestedhvm.h>
-#include <asm/hvm/trace.h>
#include <asm/hvm/viridian.h>
#include <public/hvm/ioreq.h>
#include <public/hvm/params.h>
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index d36498d831..1a4dfb499b 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -24,7 +24,6 @@
#include <asm/hvm/vlapic.h>
#include <asm/hvm/nestedhvm.h>
#include <public/hvm/ioreq.h>
-#include <asm/hvm/trace.h>
#include <asm/vm_event.h>
/*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 457c991d09..8ba996546f 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -37,7 +37,6 @@
#include <asm/x86_emulate.h>
#include <asm/hvm/vpt.h>
#include <public/hvm/save.h>
-#include <asm/hvm/trace.h>
#include <asm/hvm/monitor.h>
#include <asm/xenoprof.h>
#include <asm/gdbsx.h>
diff --git a/xen/arch/x86/include/asm/hvm/trace.h
b/xen/arch/x86/include/asm/hvm/trace.h
deleted file mode 100644
index 22eadbdd47..0000000000
--- a/xen/arch/x86/include/asm/hvm/trace.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef __ASM_X86_HVM_TRACE_H__
-#define __ASM_X86_HVM_TRACE_H__
-
-#include <xen/trace.h>
-
-#define DEFAULT_HVM_TRACE_ON 1
-#define DEFAULT_HVM_TRACE_OFF 0
-
-#define DEFAULT_HVM_VMSWITCH DEFAULT_HVM_TRACE_ON
-#define DEFAULT_HVM_PF DEFAULT_HVM_TRACE_ON
-#define DEFAULT_HVM_INJECT DEFAULT_HVM_TRACE_ON
-#define DEFAULT_HVM_IO DEFAULT_HVM_TRACE_ON
-#define DEFAULT_HVM_REGACCESS DEFAULT_HVM_TRACE_ON
-#define DEFAULT_HVM_MISC DEFAULT_HVM_TRACE_ON
-#define DEFAULT_HVM_INTR DEFAULT_HVM_TRACE_ON
-
-#define DO_TRC_HVM_VMENTRY DEFAULT_HVM_VMSWITCH
-#define DO_TRC_HVM_VMEXIT DEFAULT_HVM_VMSWITCH
-#define DO_TRC_HVM_VMEXIT64 DEFAULT_HVM_VMSWITCH
-#define DO_TRC_HVM_PF_XEN DEFAULT_HVM_PF
-#define DO_TRC_HVM_PF_XEN64 DEFAULT_HVM_PF
-#define DO_TRC_HVM_PF_INJECT DEFAULT_HVM_PF
-#define DO_TRC_HVM_PF_INJECT64 DEFAULT_HVM_PF
-#define DO_TRC_HVM_INJ_EXC DEFAULT_HVM_INJECT
-#define DO_TRC_HVM_INJ_VIRQ DEFAULT_HVM_INJECT
-#define DO_TRC_HVM_REINJ_VIRQ DEFAULT_HVM_INJECT
-#define DO_TRC_HVM_INTR_WINDOW DEFAULT_HVM_INJECT
-#define DO_TRC_HVM_IO_READ DEFAULT_HVM_IO
-#define DO_TRC_HVM_IO_WRITE DEFAULT_HVM_IO
-#define DO_TRC_HVM_CR_READ DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_CR_READ64 DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_CR_WRITE DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_CR_WRITE64 DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_DR_READ DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_DR_WRITE DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_XCR_READ64 DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_XCR_WRITE64 DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_MSR_READ DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_MSR_WRITE DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_RDTSC DEFAULT_HVM_REGACCESS
-#define DO_TRC_HVM_CPUID DEFAULT_HVM_MISC
-#define DO_TRC_HVM_INTR DEFAULT_HVM_INTR
-#define DO_TRC_HVM_NMI DEFAULT_HVM_INTR
-#define DO_TRC_HVM_MCE DEFAULT_HVM_INTR
-#define DO_TRC_HVM_SMI DEFAULT_HVM_INTR
-#define DO_TRC_HVM_VMMCALL DEFAULT_HVM_MISC
-#define DO_TRC_HVM_HLT DEFAULT_HVM_MISC
-#define DO_TRC_HVM_INVLPG DEFAULT_HVM_MISC
-#define DO_TRC_HVM_INVLPG64 DEFAULT_HVM_MISC
-#define DO_TRC_HVM_IO_ASSIST DEFAULT_HVM_MISC
-#define DO_TRC_HVM_MMIO_ASSIST DEFAULT_HVM_MISC
-#define DO_TRC_HVM_CLTS DEFAULT_HVM_MISC
-#define DO_TRC_HVM_LMSW DEFAULT_HVM_MISC
-#define DO_TRC_HVM_LMSW64 DEFAULT_HVM_MISC
-#define DO_TRC_HVM_REALMODE_EMULATE DEFAULT_HVM_MISC
-#define DO_TRC_HVM_TRAP DEFAULT_HVM_MISC
-#define DO_TRC_HVM_TRAP_DEBUG DEFAULT_HVM_MISC
-#define DO_TRC_HVM_VLAPIC DEFAULT_HVM_MISC
-
-
-#define TRC_PAR_LONG(par) ((uint32_t)(par)), ((par) >> 32)
-
-#define TRACE_2_LONG_2D(_e, d1, d2, ...) \
- TRACE_4D(_e, d1, d2)
-#define TRACE_2_LONG_3D(_e, d1, d2, d3, ...) \
- TRACE_5D(_e, d1, d2, d3)
-#define TRACE_2_LONG_4D(_e, d1, d2, d3, d4, ...) \
- TRACE_6D(_e, d1, d2, d3, d4)
-
-#define HVMTRACE_ND(evt, modifier, cycles, ...) \
- do { \
- if ( unlikely(tb_init_done) && DO_TRC_HVM_ ## evt ) \
- { \
- uint32_t _d[] = { __VA_ARGS__ }; \
- __trace_var(TRC_HVM_ ## evt | (modifier), cycles, \
- sizeof(_d), sizeof(_d) ? _d : NULL); \
- } \
- } while(0)
-
-#define HVMTRACE_6D(evt, d1, d2, d3, d4, d5, d6) \
- HVMTRACE_ND(evt, 0, 0, d1, d2, d3, d4, d5, d6)
-#define HVMTRACE_5D(evt, d1, d2, d3, d4, d5) \
- HVMTRACE_ND(evt, 0, 0, d1, d2, d3, d4, d5)
-#define HVMTRACE_4D(evt, d1, d2, d3, d4) \
- HVMTRACE_ND(evt, 0, 0, d1, d2, d3, d4)
-#define HVMTRACE_3D(evt, d1, d2, d3) \
- HVMTRACE_ND(evt, 0, 0, d1, d2, d3)
-#define HVMTRACE_2D(evt, d1, d2) \
- HVMTRACE_ND(evt, 0, 0, d1, d2)
-#define HVMTRACE_1D(evt, d1) \
- HVMTRACE_ND(evt, 0, 0, d1)
-#define HVMTRACE_0D(evt) \
- HVMTRACE_ND(evt, 0, 0)
-
-#define HVMTRACE_LONG_1D(evt, d1) \
- HVMTRACE_2D(evt ## 64, (uint32_t)(d1), (d1) >> 32)
-#define HVMTRACE_LONG_2D(evt, d1, d2, ...) \
- HVMTRACE_3D(evt ## 64, d1, d2)
-#define HVMTRACE_LONG_3D(evt, d1, d2, d3, ...) \
- HVMTRACE_4D(evt ## 64, d1, d2, d3)
-#define HVMTRACE_LONG_4D(evt, d1, d2, d3, d4, ...) \
- HVMTRACE_5D(evt ## 64, d1, d2, d3, d4)
-
-#endif /* __ASM_X86_HVM_TRACE_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index 8ffab7d94c..1489dd05c2 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -15,7 +15,6 @@
#include <asm/processor.h>
#include <asm/p2m.h>
#include <asm/i387.h>
-#include <asm/hvm/trace.h>
#include <asm/hvm/vmx/vmcs.h>
extern int8_t opt_ept_exec_sp;
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 27c8a19f05..c9c555094b 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -666,22 +666,21 @@ static DECLARE_SOFTIRQ_TASKLET(trace_notify_dom0_tasklet,
trace_notify_dom0, NULL);
/**
- * __trace_var - Enters a trace tuple into the trace buffer for the current
CPU.
+ * trace - Enters a trace tuple into the trace buffer for the current CPU.
* @event: the event type being logged
- * @cycles: include tsc timestamp into trace record
* @extra: size of additional trace data in bytes
* @extra_data: pointer to additional trace data
*
* Logs a trace record into the appropriate buffer.
*/
-void __trace_var(u32 event, bool cycles, unsigned int extra,
- const void *extra_data)
+void trace(uint32_t event, unsigned int extra, const void *extra_data)
{
struct t_buf *buf;
unsigned long flags;
u32 bytes_to_tail, bytes_to_wrap;
unsigned int rec_size, total_size;
bool started_below_highwater;
+ bool cycles = event & TRC_HD_CYCLE_FLAG;
if( !tb_init_done )
return;
@@ -808,11 +807,6 @@ unlock:
tasklet_schedule(&trace_notify_dom0_tasklet);
}
-void trace(uint32_t event, unsigned int extra, const void *extra_data)
-{
- __trace_var(event, event & TRC_HD_CYCLE_FLAG, extra, extra_data);
-}
-
void __trace_hypercall(uint32_t event, unsigned long op,
const xen_ulong_t *args)
{
diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
index 9dc7e3d621..914cecbc18 100644
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -40,15 +40,6 @@ int trace_will_trace_event(u32 event);
/* Create a trace record, with pre-constructed additional parameters. */
void trace(uint32_t event, unsigned int extra, const void *extra_data);
-void __trace_var(uint32_t event, bool cycles, unsigned int extra, const void
*);
-
-static inline void trace_var(uint32_t event, bool cycles, unsigned int extra,
- const void *extra_data)
-{
- if ( unlikely(tb_init_done) )
- __trace_var(event, cycles, extra, extra_data);
-}
-
void __trace_hypercall(uint32_t event, unsigned long op,
const xen_ulong_t *args);
@@ -72,10 +63,6 @@ static inline int trace_will_trace_event(uint32_t event)
static inline void trace(
uint32_t event, unsigned int extra, const void *extra_data) {}
-static inline void trace_var(uint32_t event, bool cycles, unsigned int extra,
- const void *extra_data) {}
-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 /* CONFIG_TRACEBUFFER */
@@ -104,38 +91,4 @@ static inline void trace_time(
/* Create a trace record with time included. */
#define TRACE_TIME(_e, ...) TRACE((_e) | TRC_HD_CYCLE_FLAG, ## __VA_ARGS__)
-/* Convenience macros for calling the trace function. */
-#define TRACE_0D(_e) \
- do { \
- trace_var(_e, 1, 0, NULL); \
- } while ( 0 )
-
-/* Common helper for TRACE_{1..6}D() below. */
-#define TRACE_varD(_e, ...) \
- do { \
- if ( unlikely(tb_init_done) ) \
- { \
- uint32_t _d[] = { __VA_ARGS__ }; \
- __trace_var(_e, true, sizeof(_d), _d); \
- } \
- } while ( 0 )
-
-#define TRACE_1D(_e, d1) \
- TRACE_varD(_e, d1)
-
-#define TRACE_2D(_e, d1, d2) \
- TRACE_varD(_e, d1, d2)
-
-#define TRACE_3D(_e, d1, d2, d3) \
- TRACE_varD(_e, d1, d2, d3)
-
-#define TRACE_4D(_e, d1, d2, d3, d4) \
- TRACE_varD(_e, d1, d2, d3, d4)
-
-#define TRACE_5D(_e, d1, d2, d3, d4, d5) \
- TRACE_varD(_e, d1, d2, d3, d4, d5)
-
-#define TRACE_6D(_e, d1, d2, d3, d4, d5, d6) \
- TRACE_varD(_e, d1, d2, d3, d4, d5, d6)
-
#endif /* __XEN_TRACE_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |