Lines Matching defs:topo

1226 	  topo.nodes_per_pkg * topo.cores_per_node * topo.threads_per_core) + \
1227 ((node_no) * topo.cores_per_node * topo.threads_per_core) + \
1228 ((core_no) * topo.threads_per_core) + \
1233 ((pkg_no) * topo.nodes_per_pkg * topo.cores_per_node) + \
1234 ((node_no) * topo.cores_per_node) + \
1422 } topo;
1455 for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) {
1456 for (node_no = 0; node_no < topo.nodes_per_pkg; node_no++) {
1457 for (core_no = 0; core_no < topo.cores_per_node; ++core_no) {
1458 for (thread_no = 0; thread_no < topo.threads_per_core; ++thread_no) {
2092 /* topo columns, print blanks on 1st (average) line */
2841 if ((mp->format == FORMAT_RAW) && (topo.num_packages == 0))
2865 average.threads.tsc /= topo.allowed_cpus;
2866 average.threads.aperf /= topo.allowed_cpus;
2867 average.threads.mperf /= topo.allowed_cpus;
2868 average.threads.instr_count /= topo.allowed_cpus;
2869 average.threads.c1 /= topo.allowed_cpus;
2874 average.cores.c3 /= topo.allowed_cores;
2875 average.cores.c6 /= topo.allowed_cores;
2876 average.cores.c7 /= topo.allowed_cores;
2877 average.cores.mc6_us /= topo.allowed_cores;
2880 average.packages.pkg_wtd_core_c0 /= topo.allowed_packages;
2882 average.packages.pkg_any_core_c0 /= topo.allowed_packages;
2884 average.packages.pkg_any_gfxe_c0 /= topo.allowed_packages;
2886 average.packages.pkg_both_core_gfxe_c0 /= topo.allowed_packages;
2888 average.packages.pc2 /= topo.allowed_packages;
2890 average.packages.pc3 /= topo.allowed_packages;
2892 average.packages.pc6 /= topo.allowed_packages;
2894 average.packages.pc7 /= topo.allowed_packages;
2896 average.packages.pc8 /= topo.allowed_packages;
2897 average.packages.pc9 /= topo.allowed_packages;
2898 average.packages.pc10 /= topo.allowed_packages;
2908 average.threads.counter[i] /= topo.allowed_cpus;
2917 average.cores.counter[i] /= topo.allowed_cores;
2926 average.packages.counter[i] /= topo.allowed_packages;
4136 for (i = 0; i < topo.max_cpu_num + 1; ++i) {
4152 for (i = 0; i < topo.max_cpu_num + 1; ++i) {
4169 for (int i = 0; i < topo.max_cpu_num + 1; ++i) {
4183 const int num_domains = platform->has_per_core_rapl ? topo.num_cores : topo.num_packages;
4241 for (i = 0; i <= topo.max_cpu_num; ++i) {
4302 for (cpu = 0; cpu <= topo.max_cpu_num; ++cpu)
4306 for (pkg = 0; pkg < topo.num_packages; pkg++) {
4308 for (cpu = 0; cpu <= topo.max_cpu_num; ++cpu) {
4321 for (cpux = cpu; cpux <= topo.max_cpu_num; cpux++) {
4328 if (lnode > topo.nodes_per_pkg)
4329 topo.nodes_per_pkg = lnode;
4331 if (cpu_count >= topo.max_cpu_num)
4343 for (i = 0; i <= topo.max_cpu_num; i++) {
4414 int offset = topo.max_cpu_num + 1;
4418 thiscpu->put_ids = CPU_ALLOC((topo.max_cpu_num + 1));
4424 size = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
4468 for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) {
4469 for (node_no = 0; node_no < topo.nodes_per_pkg; ++node_no) {
4470 for (core_no = 0; core_no < topo.cores_per_node; ++core_no) {
4471 for (thread_no = 0; thread_no < topo.threads_per_core; ++thread_no) {
4579 fprintf(outf, "turbostat: re-initialized with num_cpus %d, allowed_cpus %d\n", topo.num_cpus,
4580 topo.allowed_cpus);
4596 topo.max_cpu_num = 0;
4598 topo.max_cpu_num += BITMASK_SIZE;
4600 topo.max_cpu_num--; /* 0 based */
4611 topo.num_cpus++;
4645 for (column = 0; column < topo.num_cpus; ++column) {
4652 if (cpu_number > topo.max_cpu_num) {
4653 warn("/proc/interrupts: cpu%d: > %d", cpu_number, topo.max_cpu_num);
4671 for (column = 0; column < topo.num_cpus; ++column) {
4959 per_cpu_msr_sum = calloc(topo.max_cpu_num + 1, sizeof(struct msr_sum_array));
5313 for (i = 0; i < topo.num_packages; ++i) {
5314 for (j = 0; j < topo.num_die; ++j) {
6465 fd_instr_count_percpu = calloc(topo.max_cpu_num + 1, sizeof(int));
6473 fd_amperf_percpu = calloc(topo.max_cpu_num + 1, sizeof(*fd_amperf_percpu));
6481 const int num_domains = platform->has_per_core_rapl ? topo.num_cores : topo.num_packages;
6515 for (int cpu = 0; cpu < topo.max_cpu_num + 1; ++cpu) {
6975 topo.num_cpus = 0;
6977 if (!summary_only && topo.num_cpus > 1)
6981 fprintf(outf, "num_cpus %d max_cpu_num %d\n", topo.num_cpus, topo.max_cpu_num);
6983 cpus = calloc(1, (topo.max_cpu_num + 1) * sizeof(struct cpu_topology));
6990 cpu_present_set = CPU_ALLOC((topo.max_cpu_num + 1));
6993 cpu_present_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
7000 cpu_effective_set = CPU_ALLOC((topo.max_cpu_num + 1));
7003 cpu_effective_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
7010 cpu_allowed_set = CPU_ALLOC((topo.max_cpu_num + 1));
7013 cpu_allowed_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
7057 cpu_affinity_set = CPU_ALLOC((topo.max_cpu_num + 1));
7060 cpu_affinity_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
7069 for (i = 0; i <= topo.max_cpu_num; ++i) {
7092 if (cpus[i].physical_node_id > topo.max_node_num)
7093 topo.max_node_num = cpus[i].physical_node_id;
7105 topo.num_cores++;
7108 topo.cores_per_node = max_core_id + 1;
7110 fprintf(outf, "max_core_id %d, sizing for %d cores per package\n", max_core_id, topo.cores_per_node);
7111 if (!summary_only && topo.cores_per_node > 1)
7114 topo.num_die = max_die_id + 1;
7116 fprintf(outf, "max_die_id %d, sizing for %d die\n", max_die_id, topo.num_die);
7117 if (!summary_only && topo.num_die > 1)
7120 topo.num_packages = max_package_id + 1;
7122 fprintf(outf, "max_package_id %d, sizing for %d packages\n", max_package_id, topo.num_packages);
7123 if (!summary_only && topo.num_packages > 1)
7128 fprintf(outf, "nodes_per_pkg %d\n", topo.nodes_per_pkg);
7129 if (!summary_only && topo.nodes_per_pkg > 1)
7132 topo.threads_per_core = max_siblings;
7139 for (i = 0; i <= topo.max_cpu_num; ++i) {
7153 int num_cores = topo.cores_per_node * topo.nodes_per_pkg * topo.num_packages;
7154 int num_threads = topo.threads_per_core * num_cores;
7172 *p = calloc(topo.num_packages, sizeof(struct pkg_data));
7176 for (i = 0; i < topo.num_packages; i++) {
7202 * and logical_node_id==(-1 - topo.num_cpus)
7232 output_buffer = calloc(1, (1 + topo.num_cpus) * 2048);
7240 fd_percpu = calloc(topo.max_cpu_num + 1, sizeof(int));
7247 irq_column_2_cpu = calloc(topo.num_cpus, sizeof(int));
7249 err(-1, "calloc %d", topo.num_cpus);
7251 irqs_per_cpu = calloc(topo.max_cpu_num + 1, sizeof(int));
7253 err(-1, "calloc %d", topo.max_cpu_num + 1);
7258 topo.allowed_cpus++;
7260 topo.allowed_cores++;
7262 topo.allowed_packages++;
7269 topo.allowed_cpus = 0;
7270 topo.allowed_cores = 0;
7271 topo.allowed_packages = 0;
7291 for (i = 0; i < topo.max_cpu_num + 1; ++i) {