aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2012-08-05 10:01:08 -0700
committerChris E Ferron <chris.e.ferron@linux.intel.com>2012-08-06 09:26:17 -0700
commitc111ebb756353bf5df5cbeabdc97cd6b23416df8 (patch)
treed7e35be7d97e2270a4b988ac4b36fc146d56d360
parentb323d85f41f186d681967cfd23a992359032ba3a (diff)
Allow for cores without P-states
In a hybrid system (CPU and GPU), it's common (well, for Intel graphics) to not have statistics for the GPU P states, while we do have statistics for the GPU C states. This patch puts all the plumbing in place to allow for cores that don't have P states, to not show up in the P state displays
-rw-r--r--src/cpu/cpu.cpp5
-rw-r--r--src/cpu/cpu.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp
index eb0a46c..63e48ee 100644
--- a/src/cpu/cpu.cpp
+++ b/src/cpu/cpu.cpp
@@ -626,6 +626,8 @@ void report_display_cpu_pstates(void)
_core = _package->children[core];
if (!_core)
continue;
+ if (!_core->has_pstates())
+ continue;
for (line = LEVEL_HEADER; line < (int)pstates_num; line++) {
int first = 1;
@@ -821,6 +823,9 @@ void impl_w_display_cpu_states(int state)
_core = _package->children[core];
if (!_core)
continue;
+ if (!_core->has_pstates() && state == PSTATE)
+ continue;
+
for (line = LEVEL_HEADER; line < 10; line++) {
int first = 1;
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index d51e3b2..ec9dbfc 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -130,6 +130,7 @@ public:
virtual char * fill_pstate_line(int line_nr, char *buffer) { return buffer;};
virtual char * fill_pstate_name(int line_nr, char *buffer) { return buffer;};
virtual int has_pstate_level(int level);
+ virtual int has_pstates(void) { return 1; };
/* Frequency micro accounting methods */
virtual void calculate_freq(uint64_t time);