Skip to contentSkip to conversation

tracing/xen: Hide events that are not used when X86_PAE is not defined

PATCH In review Steven Rostedt 3 participants 5 messages Oct 10, 2017 – Oct 12, 2017 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing/xen: Hide events that are not used when X86_PAE is not defined

From: Steven Rostedt (VMware) <[email protected]>

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.

---

include/trace/events/xen.h +19 -16
Index: linux-trace.git/include/trace/events/xen.h
===================================================================
@@ -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,
@@ -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,
@@ -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),
@@ -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
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Steven Rostedt

From: Steven Rostedt (VMware) <[email protected]>

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.

author maintainer
#2 lore raw
Quoted 7 lines · On Tue, 10 Oct 2017 19:25:10 -0400 Boris Ostrovsky…
Quoted 6 lines · Steven Rostedt

From: Steven Rostedt (VMware) <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines

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.

Thanks Boris,

-- Steve

Reviewed-by on v1 1/1
#3 lore raw
In reply to Steven Rostedt
Quoted 8 lines · Steven Rostedt

From: Steven Rostedt (VMware) <[email protected]>

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.

The only place i see them being used is mmu_pv.c, where they are wrapped in the stated #define.

Looks good.

Thanks,

Quoted 71 lines

---
Index: linux-trace.git/include/trace/events/xen.h
===================================================================

include/trace/events/xen.h +19 -16
@@ -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,
@@ -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,
@@ -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),
@@ -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
 
author maintainer
#4 lore raw
Quoted 10 lines · On Wed, 11 Oct 2017 19:39:20 -0500 Jeremy Linton <[email protected]> wrote:
Quoted 8 lines · Steven Rostedt

From: Steven Rostedt (VMware) <[email protected]>

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.

Quoted 7 lines

The only place i see them being used is mmu_pv.c, where they are wrapped in the stated #define.

Looks good.

Thanks Jeremy,

-- Steve