Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/power turbostat: Delete core_data.core_id

Delete redundant core_data.core_id.
Use cpus[].core_id as the single copy of the truth.

No functional change.

Signed-off-by: Len Brown <len.brown@intel.com>

Len Brown 439632cf 5e160646

+4 -9
+4 -9
tools/power/x86/turbostat/turbostat.c
··· 2143 2143 unsigned long long mc6_us; /* duplicate as per-core for now, even though per module */ 2144 2144 unsigned int core_temp_c; 2145 2145 struct rapl_counter core_energy; /* MSR_CORE_ENERGY_STAT */ 2146 - unsigned int core_id; 2147 2146 unsigned long long core_throt_cnt; 2148 2147 unsigned long long counter[MAX_ADDED_CORE_COUNTERS]; 2149 2148 unsigned long long perf_counter[MAX_ADDED_CORE_COUNTERS]; ··· 3177 3178 } 3178 3179 3179 3180 if (c && is_cpu_first_thread_in_core(t, c)) { 3180 - outp += sprintf(outp, "core: %d\n", c->core_id); 3181 + outp += sprintf(outp, "core: %d\n", cpus[t->cpu_id].core_id); 3181 3182 outp += sprintf(outp, "c3: %016llX\n", c->c3); 3182 3183 outp += sprintf(outp, "c6: %016llX\n", c->c6); 3183 3184 outp += sprintf(outp, "c7: %016llX\n", c->c7); ··· 3386 3387 } 3387 3388 if (DO_BIC(BIC_Core)) { 3388 3389 if (c) 3389 - outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), c->core_id); 3390 + outp += sprintf(outp, "%s%d", (printed++ ? delim : ""), cpus[t->cpu_id].core_id); 3390 3391 else 3391 3392 outp += sprintf(outp, "%s-", (printed++ ? delim : "")); 3392 3393 } ··· 5283 5284 return -10; 5284 5285 5285 5286 for (i = 0, pp = sys.pmt_cp; pp; i++, pp = pp->next) 5286 - c->pmt_counter[i] = pmt_read_counter(pp, c->core_id); 5287 + c->pmt_counter[i] = pmt_read_counter(pp, cpus[t->cpu_id].core_id); 5287 5288 5288 5289 /* collect package counters only for 1st core in package */ 5289 5290 if (!is_cpu_first_core_in_package(t, p)) ··· 9704 9705 if (*c == NULL) 9705 9706 goto error; 9706 9707 9707 - for (i = 0; i < num_cores; i++) { 9708 - (*c)[i].core_id = -1; 9708 + for (i = 0; i < num_cores; i++) 9709 9709 (*c)[i].first_cpu = -1; 9710 - } 9711 9710 9712 9711 *p = calloc(topo.num_packages, sizeof(struct pkg_data)); 9713 9712 if (*p == NULL) ··· 9750 9753 if (pkg_base[pkg_id].first_cpu < 0) 9751 9754 pkg_base[pkg_id].first_cpu = t->cpu_id; 9752 9755 } 9753 - 9754 - c->core_id = core_id; 9755 9756 } 9756 9757 9757 9758 int initialize_counters(int cpu_id)