aboutsummaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorarjan <arjan@arjan-desktop.localdomain>2010-09-03 19:10:27 -0700
committerarjan <arjan@arjan-desktop.localdomain>2010-09-03 19:10:27 -0700
commitc0e7228177af056a216f73b1be5a47d7b643bf39 (patch)
treed4d0bbb7e13fb5c6818f16928008100f27121c9c /cpu
parentae8383cf734c3dbf132ca8d5dab8cdb3520c604b (diff)
downloadpowertop-c0e7228177af056a216f73b1be5a47d7b643bf39.tar.gz
remove all traces of the cpu parameters; they're a dead end
Diffstat (limited to 'cpu')
-rw-r--r--cpu/abstract_cpu.cpp10
-rw-r--r--cpu/cpu.cpp3
-rw-r--r--cpu/cpu.h3
-rw-r--r--cpu/cpu_core.cpp33
-rw-r--r--cpu/cpu_package.cpp34
-rw-r--r--cpu/cpudevice.cpp55
-rw-r--r--cpu/intel_cpus.cpp122
-rw-r--r--cpu/intel_cpus.h4
8 files changed, 0 insertions, 264 deletions
diff --git a/cpu/abstract_cpu.cpp b/cpu/abstract_cpu.cpp
index 7569c58..b6e5f49 100644
--- a/cpu/abstract_cpu.cpp
+++ b/cpu/abstract_cpu.cpp
@@ -378,16 +378,6 @@ void abstract_cpu::validate(void)
}
}
-void abstract_cpu::report_out(void)
-{
- unsigned int i;
-
- for (i = 0; i < children.size(); i++) {
- if (children[i])
- children[i]->report_out();
- }
-}
-
void abstract_cpu::reset_pstate_data(void)
{
unsigned int i;
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp
index 151a206..fdf113a 100644
--- a/cpu/cpu.cpp
+++ b/cpu/cpu.cpp
@@ -477,9 +477,6 @@ void process_cpu_data(void)
if (system_level.children[i])
system_level.children[i]->validate();
- for (i = 0; i < system_level.children.size(); i++)
- if (system_level.children[i])
- system_level.children[i]->report_out();
}
void end_cpu_data(void)
diff --git a/cpu/cpu.h b/cpu/cpu.h
index 0e3e866..d8a69c7 100644
--- a/cpu/cpu.h
+++ b/cpu/cpu.h
@@ -113,7 +113,6 @@ public:
virtual uint64_t total_pstate_time(void);
virtual void validate(void);
- virtual void report_out(void);
virtual void reset_pstate_data(void);
};
@@ -143,7 +142,6 @@ public:
virtual char * fill_pstate_name(int line_nr, char *buffer);
virtual int can_collapse(void) { return childcount == 1;};
- virtual void measurement_end(void);
};
class cpu_package: public abstract_cpu
@@ -156,7 +154,6 @@ public:
virtual char * fill_pstate_name(int line_nr, char *buffer);
virtual int can_collapse(void) { return childcount == 1;};
- virtual void measurement_end(void);
};
#include "intel_cpus.h"
diff --git a/cpu/cpu_core.cpp b/cpu/cpu_core.cpp
index 5a474b6..976afb0 100644
--- a/cpu/cpu_core.cpp
+++ b/cpu/cpu_core.cpp
@@ -72,36 +72,3 @@ char * cpu_core::fill_pstate_line(int line_nr, char *buffer)
-void cpu_core::measurement_end(void)
-{
- unsigned int i;
- char buffer[256];
-
- abstract_cpu::measurement_end();
-
- if (pstates.size() > 1) {
- for (i = 0; i < pstates.size() - 1; i ++) {
- sprintf(buffer,"core-freq-%s", pstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < pstates.size() - 1; i ++) {
- sprintf(buffer,"core-%i-freq-%s", number, pstates[i]->human_name);
- report_utilization(buffer, percentage(1.0* (pstates[i]->time_after - pstates[i]->time_before) / time_factor * 10000 / pstates[i]->after_count));
- }
- }
-
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"core-idle-%s", cstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"core-%i-idle-%s", number, cstates[i]->human_name);
- report_utilization(buffer, percentage(cstates[i]->duration_delta / time_factor));
- }
- }
-} \ No newline at end of file
diff --git a/cpu/cpu_package.cpp b/cpu/cpu_package.cpp
index 5ad818c..c3b00b6 100644
--- a/cpu/cpu_package.cpp
+++ b/cpu/cpu_package.cpp
@@ -70,37 +70,3 @@ char * cpu_package::fill_pstate_line(int line_nr, char *buffer)
return buffer;
}
-
-void cpu_package::measurement_end(void)
-{
- unsigned int i;
- char buffer[256];
-
- abstract_cpu::measurement_end();
-
- if (pstates.size() > 1) {
- for (i = 0; i < pstates.size() - 1; i ++) {
- sprintf(buffer,"package-freq-%s", pstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < pstates.size() - 1; i ++) {
- sprintf(buffer,"package-%i-freq-%s", number, pstates[i]->human_name);
- report_utilization(buffer, percentage(1.0* (pstates[i]->time_after - pstates[i]->time_before) / time_factor * 10000 / pstates[i]->after_count));
- }
- }
-
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"package-idle-%s", cstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"package-%i-idle-%s", number, cstates[i]->human_name);
- report_utilization(buffer, percentage(cstates[i]->duration_delta / time_factor));
- }
- }
-}
diff --git a/cpu/cpudevice.cpp b/cpu/cpudevice.cpp
index 7ba1a4f..0efc84e 100644
--- a/cpu/cpudevice.cpp
+++ b/cpu/cpudevice.cpp
@@ -18,61 +18,6 @@ double cpudevice::power_usage(struct result_bundle *result, struct parameter_bun
double power = 0;
unsigned int i, j;
- for (i = 0; i < cpu->pstates.size(); i ++) {
- double factor;
- double util;
- char buffer[128];
- sprintf(buffer,"package-freq-%s", cpu->pstates[i]->human_name);
- factor = get_parameter_value(buffer, bundle);
- sprintf(buffer,"package-%i-freq-%s", cpu->number, cpu->pstates[i]->human_name);
- util = get_result_value(buffer, result);
-
- power += factor * util / 100.0;
- }
-
- for (i = 0; i < cpu->cstates.size(); i ++) {
- double factor;
- double util;
- char buffer[128];
- sprintf(buffer,"package-idle-%s", cpu->cstates[i]->human_name);
- factor = get_parameter_value(buffer, bundle);
- sprintf(buffer,"package-%i-idle-%s", cpu->number, cpu->cstates[i]->human_name);
- util = get_result_value(buffer, result);
-
- power += factor * util / 100.0;
- }
-
- for (j = 0; j < cpu->children.size(); j++) {
- class abstract_cpu *child;
- child = cpu->children[j];
- if (!child)
- continue;
-
- for (i = 0; i < child->pstates.size(); i ++) {
- double factor;
- double util;
- char buffer[128];
- sprintf(buffer,"core-freq-%s", child->pstates[i]->human_name);
- factor = get_parameter_value(buffer, bundle);
- sprintf(buffer,"core-%i-freq-%s", child->number, child->pstates[i]->human_name);
- util = get_result_value(buffer, result);
-
- power += factor * util / 100.0;
- }
-
- for (i = 0; i < child->cstates.size(); i ++) {
- double factor;
- double util;
- char buffer[128];
- sprintf(buffer,"core-idle-%s", child->cstates[i]->human_name);
- factor = get_parameter_value(buffer, bundle);
- sprintf(buffer,"core-%i-idle-%s", child->number, child->cstates[i]->human_name);
- util = get_result_value(buffer, result);
-
- power += factor * util / 100.0;
- }
-
- }
return power;
}
diff --git a/cpu/intel_cpus.cpp b/cpu/intel_cpus.cpp
index 7facfab..f97bcd2 100644
--- a/cpu/intel_cpus.cpp
+++ b/cpu/intel_cpus.cpp
@@ -89,8 +89,6 @@ void nhm_core::measurement_end(void)
unsigned int i;
uint64_t time_delta;
double ratio;
- char buffer[4096];
-
c3_after = get_msr(first_cpu, MSR_CORE_C3_RESIDENCY);
c6_after = get_msr(first_cpu, MSR_CORE_C6_RESIDENCY);
@@ -147,21 +145,6 @@ void nhm_core::measurement_end(void)
}
#endif
total_stamp = 0;
-
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"core-idle-%s", cstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
- }
-
- for (i = 0; i < pstates.size(); i ++) {
- if (strstr(pstates[i]->human_name,"Idle"))
- continue;
- sprintf(buffer,"core-freq-%s", pstates[i]->human_name);
- register_parameter(buffer, 1);
- }
}
void nhm_core::account_freq(uint64_t freq, uint64_t duration)
@@ -376,99 +359,8 @@ void nhm_package::measurement_end(void)
}
total_stamp = 0;
- char buffer[256];
-
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"core-idle-%s", cstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
-
- }
-
- for (i = 0; i < pstates.size(); i ++) {
- if (strstr(pstates[i]->human_name,"Idle"))
- continue;
- sprintf(buffer,"package-freq-%s", pstates[i]->human_name);
- register_parameter(buffer, 1);
- }
-
}
-void nhm_package::report_out(void)
-{
- unsigned int i;
- char buffer[256];
- if (total_stamp ==0) {
- for (i = 0; i < pstates.size(); i++)
- total_stamp += pstates[i]->time_after;
- if (total_stamp == 0)
- total_stamp = 1;
- }
-
- for (i = 0; i < pstates.size(); i ++) {
- if (strstr(pstates[i]->human_name,"Idle"))
- continue;
- sprintf(buffer,"package-%i-freq-%s", number, pstates[i]->human_name);
- report_utilization(buffer, percentage(1.0* (pstates[i]->time_after) / total_stamp));
- }
-
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- if (!cstates[i])
- continue;
- sprintf(buffer,"package-idle-%s", cstates[i]->human_name);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < cstates.size() - 1; i ++) {
- if (!cstates[i])
- continue;
- sprintf(buffer,"package-%i-idle-%s", number, cstates[i]->human_name);
- report_utilization(buffer, percentage(cstates[i]->duration_delta / time_factor));
- }
- }
- abstract_cpu::report_out();
-}
-
-void nhm_core::report_out(void)
-{
- unsigned int i;
- char buffer[256];
- if (total_stamp ==0) {
- for (i = 0; i < pstates.size(); i++)
- total_stamp += pstates[i]->time_after;
- if (total_stamp == 0)
- total_stamp = 1;
- }
-
- for (i = 0; i < pstates.size(); i ++) {
- if (strstr(pstates[i]->human_name,"Idle"))
- continue;
- sprintf(buffer,"core-%i-freq-%s", number, pstates[i]->human_name);
- report_utilization(buffer, percentage(1.0* (pstates[i]->time_after) / total_stamp));
- }
-
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- if (!cstates[i])
- continue;
- sprintf(buffer,"core-idle-%s", cstates[i]->human_name);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < cstates.size() - 1; i ++) {
- if (!cstates[i])
- continue;
- sprintf(buffer,"core-%i-idle-%s", number, cstates[i]->human_name);
- report_utilization(buffer, percentage(cstates[i]->duration_delta / time_factor));
- }
- }
- abstract_cpu::report_out();
-}
-
-
void nhm_package::account_freq(uint64_t freq, uint64_t duration)
{
struct frequency *state = NULL;
@@ -597,7 +489,6 @@ void nhm_cpu::measurement_end(void)
uint64_t time_delta;
double ratio;
unsigned int i;
- char buffer[4096];
aperf_after = get_msr(number, MSR_APERF);
mperf_after = get_msr(number, MSR_MPERF);
@@ -626,19 +517,6 @@ void nhm_cpu::measurement_end(void)
total_stamp = 0;
- if (cstates.size() > 1) {
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"cpu-idle-%s", cstates[i]->human_name);
- printf("registering %s \n", buffer);
- register_parameter(buffer, 1);
- }
-
- for (i = 0; i < cstates.size() - 1; i ++) {
- sprintf(buffer,"cpu-%i-idle-%s", number, cstates[i]->human_name);
- report_utilization(buffer, percentage(cstates[i]->duration_delta / time_factor));
- }
- }
-
}
diff --git a/cpu/intel_cpus.h b/cpu/intel_cpus.h
index f4ab1d7..7b8e457 100644
--- a/cpu/intel_cpus.h
+++ b/cpu/intel_cpus.h
@@ -35,8 +35,6 @@ public:
virtual void calculate_freq(uint64_t time);
virtual void change_effective_frequency(uint64_t time, uint64_t freq);
- virtual void report_out(void);
-
};
class nhm_core: public cpu_core
@@ -60,8 +58,6 @@ public:
virtual void calculate_freq(uint64_t time);
virtual void change_effective_frequency(uint64_t time, uint64_t freq);
- virtual void report_out(void);
-
};
class nhm_cpu: public cpu_linux