Skip to contentSkip to conversation

platform/x86: intel_telemetry: Remove deadcode

PATCH In review [email protected] 2 participants 5 messages Jun 8, 2025 – Jun 9, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover platform/x86: intel_telemetry: Remove deadcode

From: "Dr. David Alan Gilbert" <[email protected]>

Many of the entries in the Telemetry core driver are not called anywhere, and haven't been since they were originally added in 2016.

Remove them.

Dr. David Alan Gilbert (3):
platform/x86: intel_telemetry: Remove unused telemetry_*_events platform/x86: intel_telemetry: Remove unused [gs]et_sampling_period platform/x86: intel_telemetry: Remove unused telemetry_raw_read_events

 arch/x86/include/asm/intel_telemetry.h        |  37 ---
 drivers/platform/x86/intel/telemetry/core.c   | 177 --------------
 drivers/platform/x86/intel/telemetry/pltdrv.c | 231 ------------------
 3 files changed, 445 deletions(-)
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/3 platform/x86: intel_telemetry: Remove unused telemetry_*_events

From: "Dr. David Alan Gilbert" <[email protected]>

The functions:
telemetry_add_events(), telemetry_update_events(),
telemetry_reset_events(), telemetry_get_eventconfig()
were all added in 2016's
commit 378f956e3f93 ("platform/x86: Add Intel Telemetry Core Driver") but have remained unused.

They're each a tiny wrapper that is the only caller through a similarly named function pointer, and for each function pointer there's a 'def' empty implementation and a plt implementation.

Remove all of those components for each function.

---
 arch/x86/include/asm/intel_telemetry.h        |  24 ----
 drivers/platform/x86/intel/telemetry/core.c   | 101 ----------------
 drivers/platform/x86/intel/telemetry/pltdrv.c | 114 ------------------
 3 files changed, 239 deletions(-)
arch/x86/include/asm/intel_telemetry.h +0 -24
index 43b7657febca..3d7e0b922341 100644
@@ -62,13 +62,6 @@ struct telemetry_core_ops {
 	int (*get_sampling_period)(u8 *pss_min_period, u8 *pss_max_period,
 				   u8 *ioss_min_period, u8 *ioss_max_period);
 
-	int (*get_eventconfig)(struct telemetry_evtconfig *pss_evtconfig,
-			       struct telemetry_evtconfig *ioss_evtconfig,
-			       int pss_len, int ioss_len);
-
-	int (*update_events)(struct telemetry_evtconfig pss_evtconfig,
-			     struct telemetry_evtconfig ioss_evtconfig);
-
 	int (*set_sampling_period)(u8 pss_period, u8 ioss_period);
 
 	int (*get_trace_verbosity)(enum telemetry_unit telem_unit,
@@ -84,11 +77,6 @@ struct telemetry_core_ops {
 	int (*read_eventlog)(enum telemetry_unit telem_unit,
 			     struct telemetry_evtlog *evtlog,
 			     int len, int log_all_evts);
-
-	int (*add_events)(u8 num_pss_evts, u8 num_ioss_evts,
-			  u32 *pss_evtmap, u32 *ioss_evtmap);
-
-	int (*reset_events)(void);
 };
 
 int telemetry_set_pltdata(const struct telemetry_core_ops *ops,
@@ -101,18 +89,6 @@ struct telemetry_plt_config *telemetry_get_pltdata(void);
 int telemetry_get_evtname(enum telemetry_unit telem_unit,
 			  const char **name, int len);
 
-int telemetry_update_events(struct telemetry_evtconfig pss_evtconfig,
-			    struct telemetry_evtconfig ioss_evtconfig);
-
-int telemetry_add_events(u8 num_pss_evts, u8 num_ioss_evts,
-			 u32 *pss_evtmap, u32 *ioss_evtmap);
-
-int telemetry_reset_events(void);
-
-int telemetry_get_eventconfig(struct telemetry_evtconfig *pss_config,
-			      struct telemetry_evtconfig *ioss_config,
-			      int pss_len, int ioss_len);
-
 int telemetry_read_events(enum telemetry_unit telem_unit,
 			  struct telemetry_evtlog *evtlog, int len);
 
drivers/platform/x86/intel/telemetry/core.c +0 -101

134 lines not on this page · raw message

drivers/platform/x86/intel/telemetry/pltdrv.c +0 -114

133 lines not on this page · raw message

Signature · 1 line
2.49.0
#2 lore raw

PATCH 2/3 platform/x86: intel_telemetry: Remove unused [gs]et_sampling_period

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

The functions:
get_sampling_period() and
set_sampling_period()

were both added in 2016's
commit 378f956e3f93 ("platform/x86: Add Intel Telemetry Core Driver") but have remained unused.

They're each a tiny wrapper that is the only caller through a similarly named function pointer, and for each function pointer there's a 'def' empty implementation and a plt implementation.

Remove all of those components for each function.

---
 arch/x86/include/asm/intel_telemetry.h        |  10 --
 drivers/platform/x86/intel/telemetry/core.c   |  57 ---------
 drivers/platform/x86/intel/telemetry/pltdrv.c | 117 ------------------
 3 files changed, 184 deletions(-)
arch/x86/include/asm/intel_telemetry.h +0 -10
index 3d7e0b922341..e7fb005ac8d8 100644
@@ -59,11 +59,6 @@ struct telemetry_plt_config {
 };
 
 struct telemetry_core_ops {
-	int (*get_sampling_period)(u8 *pss_min_period, u8 *pss_max_period,
-				   u8 *ioss_min_period, u8 *ioss_max_period);
-
-	int (*set_sampling_period)(u8 pss_period, u8 ioss_period);
-
 	int (*get_trace_verbosity)(enum telemetry_unit telem_unit,
 				   u32 *verbosity);
 
@@ -101,11 +96,6 @@ int telemetry_read_eventlog(enum telemetry_unit telem_unit,
 int telemetry_raw_read_eventlog(enum telemetry_unit telem_unit,
 				struct telemetry_evtlog *evtlog, int len);
 
-int telemetry_get_sampling_period(u8 *pss_min_period, u8 *pss_max_period,
-				  u8 *ioss_min_period, u8 *ioss_max_period);
-
-int telemetry_set_sampling_period(u8 pss_period, u8 ioss_period);
-
 int telemetry_set_trace_verbosity(enum telemetry_unit telem_unit,
 				  u32 verbosity);
 
drivers/platform/x86/intel/telemetry/core.c +0 -57

75 lines not on this page · raw message

drivers/platform/x86/intel/telemetry/pltdrv.c +0 -117

129 lines not on this page · raw message

Signature · 1 line
2.49.0
#3 lore raw

PATCH 3/3 platform/x86: intel_telemetry: Remove unused telemetry_raw_read_events

In reply to [email protected]

From: "Dr. David Alan Gilbert" <[email protected]>

telemetry_raw_read_events() was added in 2016's
commit 378f956e3f93 ("platform/x86: Add Intel Telemetry Core Driver") but have remained unused.

Unlike the others in this set, it's wrapper calls into a pointer also used by another entry, so it's only the entry wrapper that's unused.

Remove it.

---
 arch/x86/include/asm/intel_telemetry.h      |  3 ---
 drivers/platform/x86/intel/telemetry/core.c | 19 -------------------
 2 files changed, 22 deletions(-)
arch/x86/include/asm/intel_telemetry.h +0 -3
index e7fb005ac8d8..944637a4e6de 100644
@@ -87,9 +87,6 @@ int telemetry_get_evtname(enum telemetry_unit telem_unit,
 int telemetry_read_events(enum telemetry_unit telem_unit,
 			  struct telemetry_evtlog *evtlog, int len);
 
-int telemetry_raw_read_events(enum telemetry_unit telem_unit,
-			      struct telemetry_evtlog *evtlog, int len);
-
 int telemetry_read_eventlog(enum telemetry_unit telem_unit,
 			    struct telemetry_evtlog *evtlog, int len);
 
drivers/platform/x86/intel/telemetry/core.c +0 -19
index fe9e8580a8f5..f312864b8d07 100644
@@ -72,25 +72,6 @@ int telemetry_read_events(enum telemetry_unit telem_unit,
 }
 EXPORT_SYMBOL_GPL(telemetry_read_events);
 
-/**
- * telemetry_raw_read_events() - Fetch samples specified by evtlog.telem_evt_id
- * @telem_unit: Specify whether IOSS or PSS Read
- * @evtlog:	Array of telemetry_evtlog structs to fill data
- *		evtlog.telem_evt_id specifies the ids to read
- * @len:	Length of array of evtlog
- *
- * The caller must take care of locking in this case.
- *
- * Return: number of eventlogs read for success, < 0 for failure
- */
-int telemetry_raw_read_events(enum telemetry_unit telem_unit,
-			      struct telemetry_evtlog *evtlog, int len)
-{
-	return telm_core_conf.telem_ops->raw_read_eventlog(telem_unit, evtlog,
-							   len, 0);
-}
-EXPORT_SYMBOL_GPL(telemetry_raw_read_events);
-
 /**
  * telemetry_read_eventlog() - Fetch the Telemetry log from PSS or IOSS
  * @telem_unit: Specify whether IOSS or PSS Read
Signature · 1 line
2.49.0
maintainer
#4 lore raw
In reply to [email protected]
Quoted 8 lines · On Sun, 08 Jun 2025 02:25:09 +0100, [email protected] wrote:

Many of the entries in the Telemetry core driver are not called anywhere, and haven't been since they were originally added in 2016.

Remove them.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/3] platform/x86: intel_telemetry: Remove unused telemetry_*_events

      commit: 22428723a27e6ee03dffd86ba62501bffe5b4c78
[2/3] platform/x86: intel_telemetry: Remove unused [gs]et_sampling_period
      commit: 2ad029bde3d4dd7787483f646384a93a95922cf8
[3/3] platform/x86: intel_telemetry: Remove unused telemetry_raw_read_events
      commit: 458957b8e3d552701cdb55ffacc38627d2039fe8

--
i.