Lines Matching defs:topo

2073 	  topo.nodes_per_pkg * topo.cores_per_node * topo.threads_per_core) + \
2074 ((node_no) * topo.cores_per_node * topo.threads_per_core) + \
2075 ((core_no) * topo.threads_per_core) + \
2080 ((pkg_no) * topo.nodes_per_pkg * topo.cores_per_node) + \
2081 ((node_no) * topo.cores_per_node) + \
2305 } topo;
2343 for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) {
2344 for (node_no = 0; node_no < topo.nodes_per_pkg; node_no++) {
2345 for (core_no = 0; core_no < topo.cores_per_node; ++core_no) {
2346 for (thread_no = 0; thread_no < topo.threads_per_core; ++thread_no) {
3187 /* topo columns, print blanks on 1st (average) line */
4194 if ((mp->format == FORMAT_RAW) && (topo.num_packages == 0))
4201 if ((pp->format == FORMAT_RAW) && (topo.num_packages == 0))
4232 average.threads.tsc /= topo.allowed_cpus;
4233 average.threads.aperf /= topo.allowed_cpus;
4234 average.threads.mperf /= topo.allowed_cpus;
4235 average.threads.instr_count /= topo.allowed_cpus;
4236 average.threads.c1 /= topo.allowed_cpus;
4243 average.cores.c3 /= topo.allowed_cores;
4244 average.cores.c6 /= topo.allowed_cores;
4245 average.cores.c7 /= topo.allowed_cores;
4246 average.cores.mc6_us /= topo.allowed_cores;
4249 average.packages.pkg_wtd_core_c0 /= topo.allowed_packages;
4251 average.packages.pkg_any_core_c0 /= topo.allowed_packages;
4253 average.packages.pkg_any_gfxe_c0 /= topo.allowed_packages;
4255 average.packages.pkg_both_core_gfxe_c0 /= topo.allowed_packages;
4257 average.packages.pc2 /= topo.allowed_packages;
4259 average.packages.pc3 /= topo.allowed_packages;
4261 average.packages.pc6 /= topo.allowed_packages;
4263 average.packages.pc7 /= topo.allowed_packages;
4265 average.packages.pc8 /= topo.allowed_packages;
4266 average.packages.pc9 /= topo.allowed_packages;
4267 average.packages.pc10 /= topo.allowed_packages;
4268 average.packages.die_c6 /= topo.allowed_packages;
4278 average.threads.counter[i] /= topo.allowed_cpus;
4287 average.cores.counter[i] /= topo.allowed_cores;
4296 average.packages.counter[i] /= topo.allowed_packages;
4307 average.threads.perf_counter[i] /= topo.allowed_cpus;
4316 average.cores.perf_counter[i] /= topo.allowed_cores;
4325 average.packages.perf_counter[i] /= topo.allowed_packages;
4329 average.threads.pmt_counter[i] /= topo.allowed_cpus;
4332 average.cores.pmt_counter[i] /= topo.allowed_cores;
4335 average.packages.pmt_counter[i] /= topo.allowed_packages;
4412 for (die = 0; die <= topo.max_die_id; ++die) {
5068 int num_packages = topo.max_package_id + 1;
5075 num_cores_per_package = topo.max_core_id + 1;
5083 int nr_cores_per_package = topo.max_core_id + 1;
5723 for (i = 0; i < topo.max_cpu_num + 1; ++i) {
5737 for (int i = 0; i < topo.max_cpu_num + 1; ++i) {
5771 for (int cpu = 0; cpu < topo.max_cpu_num; ++cpu) {
5879 for (i = 0; i <= topo.max_cpu_num; ++i) {
5945 for (cpu = 0; cpu <= topo.max_cpu_num; ++cpu)
5949 for (pkg = 0; pkg < topo.num_packages; pkg++) {
5951 for (cpu = 0; cpu <= topo.max_cpu_num; ++cpu) {
5964 for (cpux = cpu; cpux <= topo.max_cpu_num; cpux++) {
5971 if (lnode > topo.nodes_per_pkg)
5972 topo.nodes_per_pkg = lnode;
5974 if (cpu_count >= topo.max_cpu_num)
5986 for (i = 0; i <= topo.max_cpu_num; i++) {
6060 int offset = topo.max_cpu_num + 1;
6064 thiscpu->put_ids = CPU_ALLOC((topo.max_cpu_num + 1));
6070 size = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
6116 for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) {
6117 for (node_no = 0; node_no < topo.nodes_per_pkg; ++node_no) {
6118 for (core_no = 0; core_no < topo.cores_per_node; ++core_no) {
6119 for (thread_no = 0; thread_no < topo.threads_per_core; ++thread_no) {
6229 fprintf(outf, "turbostat: re-initialized with num_cpus %d, allowed_cpus %d\n", topo.num_cpus,
6230 topo.allowed_cpus);
6246 topo.max_cpu_num = 0;
6248 topo.max_cpu_num += BITMASK_SIZE;
6250 topo.max_cpu_num--; /* 0 based */
6261 topo.num_cpus++;
6321 for (column = 0; column < topo.num_cpus; ++column) {
6328 if (cpu_number > topo.max_cpu_num) {
6329 warn("/proc/interrupts: cpu%d: > %d", cpu_number, topo.max_cpu_num);
6352 for (column = 0; column < topo.num_cpus; ++column) {
6637 per_cpu_msr_sum = calloc(topo.max_cpu_num + 1, sizeof(struct msr_sum_array));
6997 for (i = 0; i < topo.num_packages; ++i) {
6998 for (j = 0; j <= topo.max_die_id; ++j) {
8374 fd_instr_count_percpu = calloc(topo.max_cpu_num + 1, sizeof(int));
8420 for (int cpu = 0; cpu < topo.max_cpu_num + 1; ++cpu) {
8568 const int mci_num = topo.max_cpu_num + 1;
8648 const int cores_visited_elems = topo.max_core_id + 1;
8649 const int pkg_visited_elems = topo.max_package_id + 1;
8650 const int cci_num = topo.max_cpu_num + 1;
9096 topo.num_cpus = 0;
9102 fprintf(outf, "num_cpus %d max_cpu_num %d\n", topo.num_cpus, topo.max_cpu_num);
9104 cpus = calloc(1, (topo.max_cpu_num + 1) * sizeof(struct cpu_topology));
9111 cpu_present_set = CPU_ALLOC((topo.max_cpu_num + 1));
9114 cpu_present_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
9121 cpu_possible_set = CPU_ALLOC((topo.max_cpu_num + 1));
9124 cpu_possible_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
9131 cpu_effective_set = CPU_ALLOC((topo.max_cpu_num + 1));
9134 cpu_effective_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
9141 cpu_allowed_set = CPU_ALLOC((topo.max_cpu_num + 1));
9144 cpu_allowed_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
9188 cpu_affinity_set = CPU_ALLOC((topo.max_cpu_num + 1));
9191 cpu_affinity_setsize = CPU_ALLOC_SIZE((topo.max_cpu_num + 1));
9202 for (i = 0; i <= topo.max_cpu_num; ++i) {
9220 if (cpus[i].die_id > topo.max_die_id)
9221 topo.max_die_id = cpus[i].die_id;
9225 if (cpus[i].l3_id > topo.max_l3_id)
9226 topo.max_l3_id = cpus[i].l3_id;
9230 if (cpus[i].physical_node_id > topo.max_node_num)
9231 topo.max_node_num = cpus[i].physical_node_id;
9243 topo.num_cores++;
9245 topo.max_core_id = max_core_id;
9246 topo.max_package_id = max_package_id;
9248 topo.cores_per_node = max_core_id + 1;
9250 fprintf(outf, "max_core_id %d, sizing for %d cores per package\n", max_core_id, topo.cores_per_node);
9254 topo.num_die = topo.max_die_id + 1;
9256 fprintf(outf, "max_die_id %d, sizing for %d die\n", topo.max_die_id, topo.num_die);
9257 if (!summary_only && topo.num_die > 1)
9260 if (!summary_only && topo.max_l3_id > 0)
9263 topo.num_packages = max_package_id + 1;
9265 fprintf(outf, "max_package_id %d, sizing for %d packages\n", max_package_id, topo.num_packages);
9266 if (!summary_only && topo.num_packages > 1)
9271 fprintf(outf, "nodes_per_pkg %d\n", topo.nodes_per_pkg);
9272 if (!summary_only && topo.nodes_per_pkg > 1)
9275 topo.threads_per_core = max_siblings;
9282 for (i = 0; i <= topo.max_cpu_num; ++i) {
9296 int num_cores = topo.cores_per_node * topo.nodes_per_pkg * topo.num_packages;
9297 int num_threads = topo.threads_per_core * num_cores;
9315 *p = calloc(topo.num_packages, sizeof(struct pkg_data));
9319 for (i = 0; i < topo.num_packages; i++) {
9344 * and logical_node_id==(-1 - topo.num_cpus)
9373 output_buffer = calloc(1, (1 + topo.num_cpus) * 2048);
9381 fd_percpu = calloc(topo.max_cpu_num + 1, sizeof(int));
9388 irq_column_2_cpu = calloc(topo.num_cpus, sizeof(int));
9390 err(-1, "calloc %d", topo.num_cpus);
9392 irqs_per_cpu = calloc(topo.max_cpu_num + 1, sizeof(int));
9394 err(-1, "calloc %d IRQ", topo.max_cpu_num + 1);
9396 nmi_per_cpu = calloc(topo.max_cpu_num + 1, sizeof(int));
9398 err(-1, "calloc %d NMI", topo.max_cpu_num + 1);
9403 topo.allowed_cpus++;
9405 topo.allowed_cores++;
9407 topo.allowed_packages++;
9414 topo.allowed_cpus = 0;
9415 topo.allowed_cores = 0;
9416 topo.allowed_packages = 0;
9436 for (i = 0; i < topo.max_cpu_num + 1; ++i) {
9513 const size_t max_num_domains = MAX(topo.max_cpu_num + 1, MAX(topo.max_core_id + 1, topo.max_package_id + 1));
9520 num_domains = topo.max_cpu_num + 1;
9524 num_domains = topo.max_core_id + 1;
9528 num_domains = topo.max_package_id + 1;
9545 for (int cpu = 0; cpu < topo.max_cpu_num + 1; ++cpu) {
9961 for (cpu_num = 0; cpu_num < topo.max_cpu_num;) {