turbostat.c (4c2122d42116ebaa1665ad0fbef2c558fdc0e3c6) | turbostat.c (42dd45209201edb222de5f9eadc1c8f93700ef28) |
---|---|
1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 2478 unchanged lines hidden (view full) --- 2487 if (node < pni[pkg].min) 2488 pni[pkg].min = node; 2489 } 2490 2491 for (pkg = 0; pkg < topo.num_packages; pkg++) 2492 if (pni[pkg].count > topo.nodes_per_pkg) 2493 topo.nodes_per_pkg = pni[0].count; 2494 | 1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 2478 unchanged lines hidden (view full) --- 2487 if (node < pni[pkg].min) 2488 pni[pkg].min = node; 2489 } 2490 2491 for (pkg = 0; pkg < topo.num_packages; pkg++) 2492 if (pni[pkg].count > topo.nodes_per_pkg) 2493 topo.nodes_per_pkg = pni[0].count; 2494 |
2495 /* Fake 1 node per pkg for machines that don't 2496 * expose nodes and thus avoid -nan results 2497 */ 2498 if (topo.nodes_per_pkg == 0) 2499 topo.nodes_per_pkg = 1; 2500 |
|
2495 for (cpu = 0; cpu < topo.num_cpus; cpu++) { 2496 pkg = cpus[cpu].physical_package_id; 2497 node = cpus[cpu].physical_node_id; 2498 cpus[cpu].logical_node_id = node - pni[pkg].min; 2499 } 2500 free(pni); 2501 2502} --- 2396 unchanged lines hidden (view full) --- 4899 int pkg_id = cpus[cpu_id].physical_package_id; 4900 int node_id = cpus[cpu_id].logical_node_id; 4901 int core_id = cpus[cpu_id].physical_core_id; 4902 int thread_id = cpus[cpu_id].thread_id; 4903 struct thread_data *t; 4904 struct core_data *c; 4905 struct pkg_data *p; 4906 | 2501 for (cpu = 0; cpu < topo.num_cpus; cpu++) { 2502 pkg = cpus[cpu].physical_package_id; 2503 node = cpus[cpu].physical_node_id; 2504 cpus[cpu].logical_node_id = node - pni[pkg].min; 2505 } 2506 free(pni); 2507 2508} --- 2396 unchanged lines hidden (view full) --- 4905 int pkg_id = cpus[cpu_id].physical_package_id; 4906 int node_id = cpus[cpu_id].logical_node_id; 4907 int core_id = cpus[cpu_id].physical_core_id; 4908 int thread_id = cpus[cpu_id].thread_id; 4909 struct thread_data *t; 4910 struct core_data *c; 4911 struct pkg_data *p; 4912 |
4913 4914 /* Workaround for systems where physical_node_id==-1 4915 * and logical_node_id==(-1 - topo.num_cpus) 4916 */ 4917 if (node_id < 0) 4918 node_id = 0; 4919 |
|
4907 t = GET_THREAD(thread_base, thread_id, core_id, node_id, pkg_id); 4908 c = GET_CORE(core_base, core_id, node_id, pkg_id); 4909 p = GET_PKG(pkg_base, pkg_id); 4910 4911 t->cpu_id = cpu_id; 4912 if (thread_id == 0) { 4913 t->flags |= CPU_IS_FIRST_THREAD_IN_CORE; 4914 if (cpu_is_first_core_in_package(cpu_id)) --- 646 unchanged lines hidden --- | 4920 t = GET_THREAD(thread_base, thread_id, core_id, node_id, pkg_id); 4921 c = GET_CORE(core_base, core_id, node_id, pkg_id); 4922 p = GET_PKG(pkg_base, pkg_id); 4923 4924 t->cpu_id = cpu_id; 4925 if (thread_id == 0) { 4926 t->flags |= CPU_IS_FIRST_THREAD_IN_CORE; 4927 if (cpu_is_first_core_in_package(cpu_id)) --- 646 unchanged lines hidden --- |