Skip to content

Commit 45dd9b0

Browse files
committed
tracing/x86/xen: Remove zero data size trace events trace_xen_mmu_flush_tlb{_all}
Doing an audit of trace events, I discovered two trace events in the xen subsystem that use a hack to create zero data size trace events. This is not what trace events are for. Trace events add memory footprint overhead, and if all you need to do is see if a function is hit or not, simply make that function noinline and use function tracer filtering. Worse yet, the hack used was: __array(char, x, 0) Which creates a static string of zero in length. There's assumptions about such constructs in ftrace that this is a dynamic string that is nul terminated. This is not the case with these tracepoints and can cause problems in various parts of ftrace. Nuke the trace events! Link: http://lkml.kernel.org/r/[email protected] Cc: [email protected] Fixes: 95a7d76 ("xen/mmu: Use Xen specific TLB flush instead of the generic one.") Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent dc432c3 commit 45dd9b0

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

arch/x86/xen/mmu.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ xmaddr_t arbitrary_virt_to_machine(void *vaddr)
4242
}
4343
EXPORT_SYMBOL_GPL(arbitrary_virt_to_machine);
4444

45-
static void xen_flush_tlb_all(void)
45+
static noinline void xen_flush_tlb_all(void)
4646
{
4747
struct mmuext_op *op;
4848
struct multicall_space mcs;
4949

50-
trace_xen_mmu_flush_tlb_all(0);
51-
5250
preempt_disable();
5351

5452
mcs = xen_mc_entry(sizeof(*op));

arch/x86/xen/mmu_pv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,13 +1310,11 @@ unsigned long xen_read_cr2_direct(void)
13101310
return this_cpu_read(xen_vcpu_info.arch.cr2);
13111311
}
13121312

1313-
static void xen_flush_tlb(void)
1313+
static noinline void xen_flush_tlb(void)
13141314
{
13151315
struct mmuext_op *op;
13161316
struct multicall_space mcs;
13171317

1318-
trace_xen_mmu_flush_tlb(0);
1319-
13201318
preempt_disable();
13211319

13221320
mcs = xen_mc_entry(sizeof(*op));

include/trace/events/xen.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -352,22 +352,6 @@ DECLARE_EVENT_CLASS(xen_mmu_pgd,
352352
DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin);
353353
DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin);
354354

355-
TRACE_EVENT(xen_mmu_flush_tlb_all,
356-
TP_PROTO(int x),
357-
TP_ARGS(x),
358-
TP_STRUCT__entry(__array(char, x, 0)),
359-
TP_fast_assign((void)x),
360-
TP_printk("%s", "")
361-
);
362-
363-
TRACE_EVENT(xen_mmu_flush_tlb,
364-
TP_PROTO(int x),
365-
TP_ARGS(x),
366-
TP_STRUCT__entry(__array(char, x, 0)),
367-
TP_fast_assign((void)x),
368-
TP_printk("%s", "")
369-
);
370-
371355
TRACE_EVENT(xen_mmu_flush_tlb_one_user,
372356
TP_PROTO(unsigned long addr),
373357
TP_ARGS(addr),

0 commit comments

Comments
 (0)