[PATCH v8 18/21] x86,fs/resctrl: Remove duplicated trace header files

James Morse posted 21 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v8 18/21] x86,fs/resctrl: Remove duplicated trace header files
Posted by James Morse 8 months, 1 week ago
The copy-pasting python script harmlessly creates some empty trace
point header files. Remove them.

Signed-off-by: James Morse <james.morse@arm.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64
Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64
Tested-by: Babu Moger <babu.moger@amd.com>
---
 arch/x86/kernel/cpu/resctrl/monitor.c       |  4 ----
 arch/x86/kernel/cpu/resctrl/monitor_trace.h | 17 -----------------
 fs/resctrl/pseudo_lock.c                    |  4 ----
 fs/resctrl/pseudo_lock_trace.h              | 17 -----------------
 4 files changed, 42 deletions(-)
 delete mode 100644 arch/x86/kernel/cpu/resctrl/monitor_trace.h
 delete mode 100644 fs/resctrl/pseudo_lock_trace.h

diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
index 1809e3fe6ef3..800e52845b1d 100644
--- a/arch/x86/kernel/cpu/resctrl/monitor.c
+++ b/arch/x86/kernel/cpu/resctrl/monitor.c
@@ -27,10 +27,6 @@
 
 #include "internal.h"
 
-#define CREATE_TRACE_POINTS
-
-#include "monitor_trace.h"
-
 /*
  * Global boolean for rdt_monitor which is true if any
  * resource monitoring is enabled.
diff --git a/arch/x86/kernel/cpu/resctrl/monitor_trace.h b/arch/x86/kernel/cpu/resctrl/monitor_trace.h
deleted file mode 100644
index b5a142dd0f0e..000000000000
--- a/arch/x86/kernel/cpu/resctrl/monitor_trace.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM resctrl
-
-#if !defined(_FS_RESCTRL_MONITOR_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _FS_RESCTRL_MONITOR_TRACE_H
-
-#include <linux/tracepoint.h>
-
-#endif /* _FS_RESCTRL_MONITOR_TRACE_H */
-
-#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
-
-#define TRACE_INCLUDE_FILE monitor_trace
-
-#include <trace/define_trace.h>
diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
index 29682dd46871..7305b232384e 100644
--- a/fs/resctrl/pseudo_lock.c
+++ b/fs/resctrl/pseudo_lock.c
@@ -30,10 +30,6 @@
 #include "../../events/perf_event.h" /* For X86_CONFIG() */
 #include "internal.h"
 
-#define CREATE_TRACE_POINTS
-
-#include "pseudo_lock_trace.h"
-
 /*
  * Major number assigned to and shared by all devices exposing
  * pseudo-locked regions.
diff --git a/fs/resctrl/pseudo_lock_trace.h b/fs/resctrl/pseudo_lock_trace.h
deleted file mode 100644
index 7a6a1983953a..000000000000
--- a/fs/resctrl/pseudo_lock_trace.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#undef TRACE_SYSTEM
-#define TRACE_SYSTEM resctrl
-
-#if !defined(_X86_RESCTRL_PSEUDO_LOCK_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
-#define _X86_RESCTRL_PSEUDO_LOCK_TRACE_H
-
-#include <linux/tracepoint.h>
-
-#endif /* _X86_RESCTRL_PSEUDO_LOCK_TRACE_H */
-
-#undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
-
-#define TRACE_INCLUDE_FILE pseudo_lock_trace
-
-#include <trace/define_trace.h>
-- 
2.20.1
Re: [PATCH v8 18/21] x86,fs/resctrl: Remove duplicated trace header files
Posted by Fenghua Yu 8 months ago
Hi, James,

On 4/11/25 09:42, James Morse wrote:
> The copy-pasting python script harmlessly creates some empty trace
> point header files. Remove them.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> Tested-by: Peter Newman <peternewman@google.com>
> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64
> Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64
> Tested-by: Babu Moger <babu.moger@amd.com>
> ---
>   arch/x86/kernel/cpu/resctrl/monitor.c       |  4 ----
>   arch/x86/kernel/cpu/resctrl/monitor_trace.h | 17 -----------------
>   fs/resctrl/pseudo_lock.c                    |  4 ----
>   fs/resctrl/pseudo_lock_trace.h              | 17 -----------------
>   4 files changed, 42 deletions(-)
>   delete mode 100644 arch/x86/kernel/cpu/resctrl/monitor_trace.h
>   delete mode 100644 fs/resctrl/pseudo_lock_trace.h
>
> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
> index 1809e3fe6ef3..800e52845b1d 100644
> --- a/arch/x86/kernel/cpu/resctrl/monitor.c
> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c
> @@ -27,10 +27,6 @@
>   
>   #include "internal.h"
>   
> -#define CREATE_TRACE_POINTS
> -
> -#include "monitor_trace.h"
> -
>   /*
>    * Global boolean for rdt_monitor which is true if any
>    * resource monitoring is enabled.
> diff --git a/arch/x86/kernel/cpu/resctrl/monitor_trace.h b/arch/x86/kernel/cpu/resctrl/monitor_trace.h
> deleted file mode 100644
> index b5a142dd0f0e..000000000000
> --- a/arch/x86/kernel/cpu/resctrl/monitor_trace.h
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM resctrl
> -
> -#if !defined(_FS_RESCTRL_MONITOR_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
> -#define _FS_RESCTRL_MONITOR_TRACE_H
> -
> -#include <linux/tracepoint.h>
> -
> -#endif /* _FS_RESCTRL_MONITOR_TRACE_H */
> -
> -#undef TRACE_INCLUDE_PATH
> -#define TRACE_INCLUDE_PATH .
> -
> -#define TRACE_INCLUDE_FILE monitor_trace
> -
> -#include <trace/define_trace.h>
> diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
> index 29682dd46871..7305b232384e 100644
> --- a/fs/resctrl/pseudo_lock.c
> +++ b/fs/resctrl/pseudo_lock.c
> @@ -30,10 +30,6 @@
>   #include "../../events/perf_event.h" /* For X86_CONFIG() */
>   #include "internal.h"
>   
> -#define CREATE_TRACE_POINTS
> -
> -#include "pseudo_lock_trace.h"
> -
>   /*
>    * Major number assigned to and shared by all devices exposing
>    * pseudo-locked regions.
> diff --git a/fs/resctrl/pseudo_lock_trace.h b/fs/resctrl/pseudo_lock_trace.h
> deleted file mode 100644
> index 7a6a1983953a..000000000000
> --- a/fs/resctrl/pseudo_lock_trace.h
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM resctrl
> -
> -#if !defined(_X86_RESCTRL_PSEUDO_LOCK_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
> -#define _X86_RESCTRL_PSEUDO_LOCK_TRACE_H
> -
> -#include <linux/tracepoint.h>
> -
> -#endif /* _X86_RESCTRL_PSEUDO_LOCK_TRACE_H */
> -
> -#undef TRACE_INCLUDE_PATH
> -#define TRACE_INCLUDE_PATH .
> -
> -#define TRACE_INCLUDE_FILE pseudo_lock_trace
> -
> -#include <trace/define_trace.h>

Will patches 18-21 be merged into patch 17 eventually before they are 
pushed into upstream?

Thanks.

-Fenghua
Re: [PATCH v8 18/21] x86,fs/resctrl: Remove duplicated trace header files
Posted by James Morse 7 months, 4 weeks ago
Hi Fenghua,

On 22/04/2025 15:23, Fenghua Yu wrote:
> On 4/11/25 09:42, James Morse wrote:
>> The copy-pasting python script harmlessly creates some empty trace
>> point header files. Remove them.

>> diff --git a/fs/resctrl/pseudo_lock_trace.h b/fs/resctrl/pseudo_lock_trace.h
>> deleted file mode 100644
>> index 7a6a1983953a..000000000000
>> --- a/fs/resctrl/pseudo_lock_trace.h
>> +++ /dev/null
>> @@ -1,17 +0,0 @@
>> -/* SPDX-License-Identifier: GPL-2.0 */
>> -#undef TRACE_SYSTEM
>> -#define TRACE_SYSTEM resctrl
>> -
>> -#if !defined(_X86_RESCTRL_PSEUDO_LOCK_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
>> -#define _X86_RESCTRL_PSEUDO_LOCK_TRACE_H
>> -
>> -#include <linux/tracepoint.h>
>> -
>> -#endif /* _X86_RESCTRL_PSEUDO_LOCK_TRACE_H */
>> -
>> -#undef TRACE_INCLUDE_PATH
>> -#define TRACE_INCLUDE_PATH .
>> -
>> -#define TRACE_INCLUDE_FILE pseudo_lock_trace
>> -
>> -#include <trace/define_trace.h>

> Will patches 18-21 be merged into patch 17 eventually before they are pushed into upstream?

Up to the maintainers - but that is the plan I describe in the cover letter.
The history of those patches isn't interesting - but they do need to be broken out to be
reviewed.


Thanks,

James
Re: [PATCH v8 18/21] x86,fs/resctrl: Remove duplicated trace header files
Posted by Reinette Chatre 8 months, 1 week ago
Hi James,

On 4/11/25 9:42 AM, James Morse wrote:
> The copy-pasting python script harmlessly creates some empty trace
> point header files. Remove them.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> Tested-by: Peter Newman <peternewman@google.com>
> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64
> Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64
> Tested-by: Babu Moger <babu.moger@amd.com>
> ---
>  arch/x86/kernel/cpu/resctrl/monitor.c       |  4 ----
>  arch/x86/kernel/cpu/resctrl/monitor_trace.h | 17 -----------------
>  fs/resctrl/pseudo_lock.c                    |  4 ----
>  fs/resctrl/pseudo_lock_trace.h              | 17 -----------------
>  4 files changed, 42 deletions(-)
>  delete mode 100644 arch/x86/kernel/cpu/resctrl/monitor_trace.h
>  delete mode 100644 fs/resctrl/pseudo_lock_trace.h
> 
> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
> index 1809e3fe6ef3..800e52845b1d 100644
> --- a/arch/x86/kernel/cpu/resctrl/monitor.c
> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c
> @@ -27,10 +27,6 @@
>  
>  #include "internal.h"
>  
> -#define CREATE_TRACE_POINTS
> -
> -#include "monitor_trace.h"
> -
>  /*
>   * Global boolean for rdt_monitor which is true if any
>   * resource monitoring is enabled.
> diff --git a/arch/x86/kernel/cpu/resctrl/monitor_trace.h b/arch/x86/kernel/cpu/resctrl/monitor_trace.h
> deleted file mode 100644
> index b5a142dd0f0e..000000000000
> --- a/arch/x86/kernel/cpu/resctrl/monitor_trace.h
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#undef TRACE_SYSTEM
> -#define TRACE_SYSTEM resctrl
> -
> -#if !defined(_FS_RESCTRL_MONITOR_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
> -#define _FS_RESCTRL_MONITOR_TRACE_H
> -
> -#include <linux/tracepoint.h>
> -
> -#endif /* _FS_RESCTRL_MONITOR_TRACE_H */
> -
> -#undef TRACE_INCLUDE_PATH
> -#define TRACE_INCLUDE_PATH .
> -
> -#define TRACE_INCLUDE_FILE monitor_trace
> -
> -#include <trace/define_trace.h>

Should the "CFLAGS_monitor.o = -I$(src)" be removed from arch/x86/kernel/cpu/resctrl/Makefile
as part of the above changes?

Reinette
Re: [PATCH v8 18/21] x86,fs/resctrl: Remove duplicated trace header files
Posted by James Morse 7 months, 4 weeks ago
Hi Reinette,

On 16/04/2025 03:18, Reinette Chatre wrote:
> On 4/11/25 9:42 AM, James Morse wrote:
>> The copy-pasting python script harmlessly creates some empty trace
>> point header files. Remove them.

>> diff --git a/arch/x86/kernel/cpu/resctrl/monitor_trace.h b/arch/x86/kernel/cpu/resctrl/monitor_trace.h
>> deleted file mode 100644
>> index b5a142dd0f0e..000000000000
>> --- a/arch/x86/kernel/cpu/resctrl/monitor_trace.h
>> +++ /dev/null
>> @@ -1,17 +0,0 @@
>> -/* SPDX-License-Identifier: GPL-2.0 */
>> -#undef TRACE_SYSTEM
>> -#define TRACE_SYSTEM resctrl
>> -
>> -#if !defined(_FS_RESCTRL_MONITOR_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
>> -#define _FS_RESCTRL_MONITOR_TRACE_H
>> -
>> -#include <linux/tracepoint.h>
>> -
>> -#endif /* _FS_RESCTRL_MONITOR_TRACE_H */
>> -
>> -#undef TRACE_INCLUDE_PATH
>> -#define TRACE_INCLUDE_PATH .
>> -
>> -#define TRACE_INCLUDE_FILE monitor_trace
>> -
>> -#include <trace/define_trace.h>

> Should the "CFLAGS_monitor.o = -I$(src)" be removed from arch/x86/kernel/cpu/resctrl/Makefile
> as part of the above changes?

Yes! It took a while of staring at build errors to work out what those things were about...

I'll also fix the 'harmless' comment in the commit message with Fenghua's description of
the ftrace thing.


Thanks,

James