diff mbox series

[v4,08/13] powerpc/mm/trace: Convert trace event to trace event class

Message ID 20230710160842.56300-9-aneesh.kumar@linux.ibm.com (mailing list archive)
State New
Headers show
Series Add support for DAX vmemmap optimization for ppc64 | expand

Commit Message

Aneesh Kumar K.V July 10, 2023, 4:08 p.m. UTC
A follow-up patch will add a pud variant for this same event.
Using event class makes that addition simpler.

No functional change in this patch.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/mm/book3s64/hash_pgtable.c  |  2 +-
 arch/powerpc/mm/book3s64/radix_pgtable.c |  2 +-
 include/trace/events/thp.h               | 23 ++++++++++++++++-------
 3 files changed, 18 insertions(+), 9 deletions(-)

Comments

Christophe Leroy July 10, 2023, 5:32 p.m. UTC | #1
Le 10/07/2023 à 18:08, Aneesh Kumar K.V a écrit :
> A follow-up patch will add a pud variant for this same event.
> Using event class makes that addition simpler.
> 
> No functional change in this patch.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   arch/powerpc/mm/book3s64/hash_pgtable.c  |  2 +-
>   arch/powerpc/mm/book3s64/radix_pgtable.c |  2 +-
>   include/trace/events/thp.h               | 23 ++++++++++++++++-------
>   3 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/powerpc/mm/book3s64/hash_pgtable.c b/arch/powerpc/mm/book3s64/hash_pgtable.c
> index 51f48984abca..988948d69bc1 100644
> --- a/arch/powerpc/mm/book3s64/hash_pgtable.c
> +++ b/arch/powerpc/mm/book3s64/hash_pgtable.c
> @@ -214,7 +214,7 @@ unsigned long hash__pmd_hugepage_update(struct mm_struct *mm, unsigned long addr
>   
>   	old = be64_to_cpu(old_be);
>   
> -	trace_hugepage_update(addr, old, clr, set);
> +	trace_hugepage_update_pmd(addr, old, clr, set);
>   	if (old & H_PAGE_HASHPTE)
>   		hpte_do_hugepage_flush(mm, addr, pmdp, old);
>   	return old;
> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
> index e7ea492ac510..02e185d2e4d6 100644
> --- a/arch/powerpc/mm/book3s64/radix_pgtable.c
> +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
> @@ -962,7 +962,7 @@ unsigned long radix__pmd_hugepage_update(struct mm_struct *mm, unsigned long add
>   #endif
>   
>   	old = radix__pte_update(mm, addr, pmdp_ptep(pmdp), clr, set, 1);
> -	trace_hugepage_update(addr, old, clr, set);
> +	trace_hugepage_update_pmd(addr, old, clr, set);
>   
>   	return old;
>   }
> diff --git a/include/trace/events/thp.h b/include/trace/events/thp.h
> index 202b3e3e67ff..a95c78b10561 100644
> --- a/include/trace/events/thp.h
> +++ b/include/trace/events/thp.h
> @@ -8,25 +8,29 @@
>   #include <linux/types.h>
>   #include <linux/tracepoint.h>
>   
> -TRACE_EVENT(hugepage_set_pmd,
> +DECLARE_EVENT_CLASS(hugepage_set,
>   
> -	    TP_PROTO(unsigned long addr, unsigned long pmd),
> -	    TP_ARGS(addr, pmd),
> +	    TP_PROTO(unsigned long addr, unsigned long pte),
> +	    TP_ARGS(addr, pte),
>   	    TP_STRUCT__entry(
>   		    __field(unsigned long, addr)
> -		    __field(unsigned long, pmd)
> +		    __field(unsigned long, pte)
>   		    ),
>   
>   	    TP_fast_assign(
>   		    __entry->addr = addr;
> -		    __entry->pmd = pmd;
> +		    __entry->pte = pte;
>   		    ),
>   
> -	    TP_printk("Set pmd with 0x%lx with 0x%lx", __entry->addr, __entry->pmd)
> +	    TP_printk("Set page table entry with 0x%lx with 0x%lx", __entry->addr, __entry->pte)
>   );
>   
> +DEFINE_EVENT(hugepage_set, hugepage_set_pmd,
> +	    TP_PROTO(unsigned long addr, unsigned long pmd),
> +	    TP_ARGS(addr, pmd)
> +);
>   
> -TRACE_EVENT(hugepage_update,
> +DECLARE_EVENT_CLASS(hugepage_update,
>   
>   	    TP_PROTO(unsigned long addr, unsigned long pte, unsigned long clr, unsigned long set),
>   	    TP_ARGS(addr, pte, clr, set),
> @@ -48,6 +52,11 @@ TRACE_EVENT(hugepage_update,
>   	    TP_printk("hugepage update at addr 0x%lx and pte = 0x%lx clr = 0x%lx, set = 0x%lx", __entry->addr, __entry->pte, __entry->clr, __entry->set)
>   );
>   
> +DEFINE_EVENT(hugepage_update, hugepage_update_pmd,
> +	    TP_PROTO(unsigned long addr, unsigned long pmd, unsigned long clr, unsigned long set),
> +	    TP_ARGS(addr, pmd, clr, set)
> +);
> +
>   DECLARE_EVENT_CLASS(migration_pmd,
>   
>   		TP_PROTO(unsigned long addr, unsigned long pmd),
diff mbox series

Patch

diff --git a/arch/powerpc/mm/book3s64/hash_pgtable.c b/arch/powerpc/mm/book3s64/hash_pgtable.c
index 51f48984abca..988948d69bc1 100644
--- a/arch/powerpc/mm/book3s64/hash_pgtable.c
+++ b/arch/powerpc/mm/book3s64/hash_pgtable.c
@@ -214,7 +214,7 @@  unsigned long hash__pmd_hugepage_update(struct mm_struct *mm, unsigned long addr
 
 	old = be64_to_cpu(old_be);
 
-	trace_hugepage_update(addr, old, clr, set);
+	trace_hugepage_update_pmd(addr, old, clr, set);
 	if (old & H_PAGE_HASHPTE)
 		hpte_do_hugepage_flush(mm, addr, pmdp, old);
 	return old;
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index e7ea492ac510..02e185d2e4d6 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -962,7 +962,7 @@  unsigned long radix__pmd_hugepage_update(struct mm_struct *mm, unsigned long add
 #endif
 
 	old = radix__pte_update(mm, addr, pmdp_ptep(pmdp), clr, set, 1);
-	trace_hugepage_update(addr, old, clr, set);
+	trace_hugepage_update_pmd(addr, old, clr, set);
 
 	return old;
 }
diff --git a/include/trace/events/thp.h b/include/trace/events/thp.h
index 202b3e3e67ff..a95c78b10561 100644
--- a/include/trace/events/thp.h
+++ b/include/trace/events/thp.h
@@ -8,25 +8,29 @@ 
 #include <linux/types.h>
 #include <linux/tracepoint.h>
 
-TRACE_EVENT(hugepage_set_pmd,
+DECLARE_EVENT_CLASS(hugepage_set,
 
-	    TP_PROTO(unsigned long addr, unsigned long pmd),
-	    TP_ARGS(addr, pmd),
+	    TP_PROTO(unsigned long addr, unsigned long pte),
+	    TP_ARGS(addr, pte),
 	    TP_STRUCT__entry(
 		    __field(unsigned long, addr)
-		    __field(unsigned long, pmd)
+		    __field(unsigned long, pte)
 		    ),
 
 	    TP_fast_assign(
 		    __entry->addr = addr;
-		    __entry->pmd = pmd;
+		    __entry->pte = pte;
 		    ),
 
-	    TP_printk("Set pmd with 0x%lx with 0x%lx", __entry->addr, __entry->pmd)
+	    TP_printk("Set page table entry with 0x%lx with 0x%lx", __entry->addr, __entry->pte)
 );
 
+DEFINE_EVENT(hugepage_set, hugepage_set_pmd,
+	    TP_PROTO(unsigned long addr, unsigned long pmd),
+	    TP_ARGS(addr, pmd)
+);
 
-TRACE_EVENT(hugepage_update,
+DECLARE_EVENT_CLASS(hugepage_update,
 
 	    TP_PROTO(unsigned long addr, unsigned long pte, unsigned long clr, unsigned long set),
 	    TP_ARGS(addr, pte, clr, set),
@@ -48,6 +52,11 @@  TRACE_EVENT(hugepage_update,
 	    TP_printk("hugepage update at addr 0x%lx and pte = 0x%lx clr = 0x%lx, set = 0x%lx", __entry->addr, __entry->pte, __entry->clr, __entry->set)
 );
 
+DEFINE_EVENT(hugepage_update, hugepage_update_pmd,
+	    TP_PROTO(unsigned long addr, unsigned long pmd, unsigned long clr, unsigned long set),
+	    TP_ARGS(addr, pmd, clr, set)
+);
+
 DECLARE_EVENT_CLASS(migration_pmd,
 
 		TP_PROTO(unsigned long addr, unsigned long pmd),