Skip to content

Commit 709c078

Browse files
Dirk Brandewierafaeljw
authored andcommitted
intel_pstate: Remove energy reporting from pstate_sample tracepoint
Remove the reporting of energy since it does not provide any useful information about the state of the driver and will be a maintainance headache going forward since the RAPL energy units register is not architectural and subject to change between micro-architectures References: https://bugzilla.kernel.org/show_bug.cgi?id=69831 Fixes: b69880f (intel_pstate: Add trace point to report internal state.) Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent fcb6a15 commit 709c078

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

‎drivers/cpufreq/intel_pstate.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ static inline int32_t div_fp(int32_t x, int32_t y)
5151
return div_s64((int64_t)x << FRAC_BITS, (int64_t)y);
5252
}
5353

54-
static u64 energy_divisor;
55-
5654
struct sample {
5755
int32_t core_pct_busy;
5856
u64 aperf;
@@ -630,12 +628,10 @@ static void intel_pstate_timer_func(unsigned long __data)
630628
{
631629
struct cpudata *cpu = (struct cpudata *) __data;
632630
struct sample *sample;
633-
u64 energy;
634631

635632
intel_pstate_sample(cpu);
636633

637634
sample = &cpu->samples[cpu->sample_ptr];
638-
rdmsrl(MSR_PKG_ENERGY_STATUS, energy);
639635

640636
intel_pstate_adjust_busy_pstate(cpu);
641637

@@ -644,7 +640,6 @@ static void intel_pstate_timer_func(unsigned long __data)
644640
cpu->pstate.current_pstate,
645641
sample->mperf,
646642
sample->aperf,
647-
div64_u64(energy, energy_divisor),
648643
sample->freq);
649644

650645
intel_pstate_set_sample_time(cpu);
@@ -926,7 +921,6 @@ static int __init intel_pstate_init(void)
926921
int cpu, rc = 0;
927922
const struct x86_cpu_id *id;
928923
struct cpu_defaults *cpu_info;
929-
u64 units;
930924

931925
if (no_load)
932926
return -ENODEV;
@@ -960,9 +954,6 @@ static int __init intel_pstate_init(void)
960954
if (rc)
961955
goto out;
962956

963-
rdmsrl(MSR_RAPL_POWER_UNIT, units);
964-
energy_divisor = 1 << ((units >> 8) & 0x1f); /* bits{12:8} */
965-
966957
intel_pstate_debug_expose_params();
967958
intel_pstate_sysfs_expose_params();
968959

‎include/trace/events/power.h‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ TRACE_EVENT(pstate_sample,
4242
u32 state,
4343
u64 mperf,
4444
u64 aperf,
45-
u32 energy,
4645
u32 freq
4746
),
4847

@@ -51,7 +50,6 @@ TRACE_EVENT(pstate_sample,
5150
state,
5251
mperf,
5352
aperf,
54-
energy,
5553
freq
5654
),
5755

@@ -61,7 +59,6 @@ TRACE_EVENT(pstate_sample,
6159
__field(u32, state)
6260
__field(u64, mperf)
6361
__field(u64, aperf)
64-
__field(u32, energy)
6562
__field(u32, freq)
6663

6764
),
@@ -72,17 +69,15 @@ TRACE_EVENT(pstate_sample,
7269
__entry->state = state;
7370
__entry->mperf = mperf;
7471
__entry->aperf = aperf;
75-
__entry->energy = energy;
7672
__entry->freq = freq;
7773
),
7874

79-
TP_printk("core_busy=%lu scaled=%lu state=%lu mperf=%llu aperf=%llu energy=%lu freq=%lu ",
75+
TP_printk("core_busy=%lu scaled=%lu state=%lu mperf=%llu aperf=%llu freq=%lu ",
8076
(unsigned long)__entry->core_busy,
8177
(unsigned long)__entry->scaled_busy,
8278
(unsigned long)__entry->state,
8379
(unsigned long long)__entry->mperf,
8480
(unsigned long long)__entry->aperf,
85-
(unsigned long)__entry->energy,
8681
(unsigned long)__entry->freq
8782
)
8883

0 commit comments

Comments
 (0)