linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined
@ 2017-10-10 23:12 Steven Rostedt
  2017-10-10 23:25 ` Boris Ostrovsky
  2017-10-12  0:39 ` Jeremy Linton
  0 siblings, 2 replies; 5+ messages in thread
From: Steven Rostedt @ 2017-10-10 23:12 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Boris Ostrovsky, Juergen Gross, Kirill A. Shutemov,
	Jeremy Linton

From: Steven Rostedt (VMware) <rostedt@goodmis.org>

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.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Index: linux-trace.git/include/trace/events/xen.h
===================================================================
--- linux-trace.git.orig/include/trace/events/xen.h
+++ 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
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined
  2017-10-10 23:12 [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined Steven Rostedt
@ 2017-10-10 23:25 ` Boris Ostrovsky
  2017-10-12  1:05   ` Steven Rostedt
  2017-10-12  0:39 ` Jeremy Linton
  1 sibling, 1 reply; 5+ messages in thread
From: Boris Ostrovsky @ 2017-10-10 23:25 UTC (permalink / raw)
  To: Steven Rostedt, LKML
  Cc: Ingo Molnar, Juergen Gross, Kirill A. Shutemov, Jeremy Linton

On 10/10/2017 07:12 PM, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> 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.
>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined
  2017-10-10 23:12 [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined Steven Rostedt
  2017-10-10 23:25 ` Boris Ostrovsky
@ 2017-10-12  0:39 ` Jeremy Linton
  2017-10-12  1:05   ` Steven Rostedt
  1 sibling, 1 reply; 5+ messages in thread
From: Jeremy Linton @ 2017-10-12  0:39 UTC (permalink / raw)
  To: Steven Rostedt, LKML
  Cc: Ingo Molnar, Boris Ostrovsky, Juergen Gross, Kirill A. Shutemov

On 10/10/2017 06:12 PM, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> 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.

Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>

Thanks,

> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> Index: linux-trace.git/include/trace/events/xen.h
> ===================================================================
> --- linux-trace.git.orig/include/trace/events/xen.h
> +++ 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
>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined
  2017-10-10 23:25 ` Boris Ostrovsky
@ 2017-10-12  1:05   ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2017-10-12  1:05 UTC (permalink / raw)
  To: Boris Ostrovsky
  Cc: LKML, Ingo Molnar, Juergen Gross, Kirill A. Shutemov, Jeremy Linton

On Tue, 10 Oct 2017 19:25:10 -0400
Boris Ostrovsky <boris.ostrovsky@oracle.com> wrote:

> On 10/10/2017 07:12 PM, Steven Rostedt wrote:
> > From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> >
> > 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.
> >
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>  
> 
> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> 

Thanks Boris,

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined
  2017-10-12  0:39 ` Jeremy Linton
@ 2017-10-12  1:05   ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2017-10-12  1:05 UTC (permalink / raw)
  To: Jeremy Linton
  Cc: LKML, Ingo Molnar, Boris Ostrovsky, Juergen Gross, Kirill A. Shutemov

On Wed, 11 Oct 2017 19:39:20 -0500
Jeremy Linton <jeremy.linton@arm.com> wrote:

> On 10/10/2017 06:12 PM, Steven Rostedt wrote:
> > From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > 
> > 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.
> 
> Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
> 

Thanks Jeremy,

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-12  1:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 23:12 [PATCH] tracing/xen: Hide events that are not used when X86_PAE is not defined Steven Rostedt
2017-10-10 23:25 ` Boris Ostrovsky
2017-10-12  1:05   ` Steven Rostedt
2017-10-12  0:39 ` Jeremy Linton
2017-10-12  1:05   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).