Skip to content

Commit

Permalink
tracing/xen: Hide events that are not used when X86_PAE is not defined
Browse files Browse the repository at this point in the history
TRACE_EVENTS() take up memory. If they are defined but not used, then
they simply waste space. If their use case is behind a define, then the
trace events should be as well.

The trace events xen_mmu_set_pte_atomic, xen_mmu_pte_clear, and
xen_mmu_pmd_clear are not used when CONFIG_X86_PAE is not defined.

Link: http://lkml.kernel.org/r/20171010191256.3d6d72cb@gandalf.local.home

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (VMware) committed Oct 13, 2017
1 parent c3b5b6e commit e83543b
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions include/trace/events/xen.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ DECLARE_EVENT_CLASS(xen_mmu__set_pte,
TP_ARGS(ptep, pteval))

DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte);
DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte_atomic);

TRACE_EVENT(xen_mmu_set_pte_at,
TP_PROTO(struct mm_struct *mm, unsigned long addr,
Expand All @@ -169,21 +168,6 @@ TRACE_EVENT(xen_mmu_set_pte_at,
(int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
);

TRACE_EVENT(xen_mmu_pte_clear,
TP_PROTO(struct mm_struct *mm, unsigned long addr, pte_t *ptep),
TP_ARGS(mm, addr, ptep),
TP_STRUCT__entry(
__field(struct mm_struct *, mm)
__field(unsigned long, addr)
__field(pte_t *, ptep)
),
TP_fast_assign(__entry->mm = mm;
__entry->addr = addr;
__entry->ptep = ptep),
TP_printk("mm %p addr %lx ptep %p",
__entry->mm, __entry->addr, __entry->ptep)
);

TRACE_DEFINE_SIZEOF(pmdval_t);

TRACE_EVENT(xen_mmu_set_pmd,
Expand All @@ -201,6 +185,24 @@ TRACE_EVENT(xen_mmu_set_pmd,
(int)sizeof(pmdval_t) * 2, (unsigned long long)__entry->pmdval)
);

#ifdef CONFIG_X86_PAE
DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte_atomic);

TRACE_EVENT(xen_mmu_pte_clear,
TP_PROTO(struct mm_struct *mm, unsigned long addr, pte_t *ptep),
TP_ARGS(mm, addr, ptep),
TP_STRUCT__entry(
__field(struct mm_struct *, mm)
__field(unsigned long, addr)
__field(pte_t *, ptep)
),
TP_fast_assign(__entry->mm = mm;
__entry->addr = addr;
__entry->ptep = ptep),
TP_printk("mm %p addr %lx ptep %p",
__entry->mm, __entry->addr, __entry->ptep)
);

TRACE_EVENT(xen_mmu_pmd_clear,
TP_PROTO(pmd_t *pmdp),
TP_ARGS(pmdp),
Expand All @@ -210,6 +212,7 @@ TRACE_EVENT(xen_mmu_pmd_clear,
TP_fast_assign(__entry->pmdp = pmdp),
TP_printk("pmdp %p", __entry->pmdp)
);
#endif

#if CONFIG_PGTABLE_LEVELS >= 4

Expand Down

0 comments on commit e83543b

Please sign in to comment.