diff options
author | Chris E Ferron <chris.e.ferron@linux.intel.com> | 2012-10-26 09:19:35 -0700 |
---|---|---|
committer | Chris E Ferron <chris.e.ferron@linux.intel.com> | 2012-10-26 09:19:35 -0700 |
commit | 0b91b0e86bab66b6954b18c7292045a7f56ed3da (patch) | |
tree | f48756a24e66f7efd7f96703ce9850ba4bf9f3da | |
parent | e0e99320abfe54e0ffb2c3a510a5fc4e202f238b (diff) |
The previous commit wrongly replaced strings identifying abstract type to the reporting functions with a new abstract type field. This ended up braking a important Macro in the reporting that allow for the decision on whether or not to use translation or not depending on report type. This commit back out the breakage, uses the new type field in decision making for cstate cores, and adds a comment on why not to just use the field for the reporting function.
-rw-r--r-- | src/cpu/cpu.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index 18cbffc..7f3af69 100644 --- a/src/cpu/cpu.cpp +++ b/src/cpu/cpu.cpp @@ -434,7 +434,7 @@ void report_display_cpu_cstates(void) if (line == LEVEL_HEADER) { if (first_core) { report.begin_cell(CELL_FIRST_PACKAGE_HEADER); - report.addf(__("%s %i"), _package->get_type(), _package->get_number()); + report.addf(__("Package %i"), _package->get_number()); } else { report.begin_cell(CELL_EMPTY_PACKAGE_HEADER); report.add_empty_cell(); @@ -458,7 +458,19 @@ void report_display_cpu_cstates(void) if (line == LEVEL_HEADER) { report.begin_cell(CELL_CORE_HEADER); - report.addf(__("%s %i"), _core->get_type(), _core->get_number()); + /* Here we need to check for which core type we + * are using. Do not use the core type for the + * report.addf as it breaks an important macro use + * for translation decision making for the reports. + */ + const char* core_type = _core->get_type(); + if (core_type != NULL) { + if (strcmp(core_type, "Core") == 0 ) { + report.addf(__("Core %i"), _core->get_number()); + } else { + report.addf(__("GPU %i"), _core->get_number()); + } + } } else { report.begin_cell(CELL_STATE_NAME); report.add(_core->fill_cstate_name(line, buffer)); @@ -478,7 +490,7 @@ void report_display_cpu_cstates(void) report.set_cpu_number(cpu); if (line == LEVEL_HEADER) { report.begin_cell(CELL_CPU_CSTATE_HEADER); - report.addf(__("%s %i"), _cpu->get_type(), _cpu->get_number()); + report.addf(__("CPU %i"), _cpu->get_number()); continue; } @@ -548,7 +560,7 @@ void report_display_cpu_pstates(void) if (first_core) { if (line == LEVEL_HEADER) { report.begin_cell(CELL_FIRST_PACKAGE_HEADER); - report.addf(__("%s %i"), _package->get_type(), _package->get_number()); + report.addf(__("Package %i"), _package->get_number()); } else { report.begin_cell(CELL_STATE_NAME); report.add(_package->fill_pstate_name(line, buffer)); @@ -568,7 +580,7 @@ void report_display_cpu_pstates(void) buffer2[0] = 0; if (line == LEVEL_HEADER) { report.begin_cell(CELL_CORE_HEADER); - report.addf(__("%s %i"), _core->get_type(), _core->get_number()); + report.addf(__("Core %i"), _core->get_number()); } else { report.begin_cell(CELL_STATE_NAME); report.add(_core->fill_pstate_name(line, buffer)); @@ -589,7 +601,7 @@ void report_display_cpu_pstates(void) report.set_cpu_number(cpu); if (line == LEVEL_HEADER) { report.begin_cell(CELL_CPU_PSTATE_HEADER); - report.addf(__("%s %i"), _cpu->get_type(), _cpu->get_number()); + report.addf(__("CPU %i"), _cpu->get_number()); continue; } |