EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
em_info.c
1/*
2 * Copyright (c) 2015-2026, Nokia Solutions and Networks
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of the copyright holder nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* Copyright (c) 2018, Linaro Limited
32 * Copyright (c) 2020-2021, Nokia
33 * All rights reserved.
34 *
35 * SPDX-License-Identifier: BSD-3-Clause
36 */
37
38/* sysinfo printouts from the ODP example: odp_sysinfo.c */
39/* SW ISA detection from the <arch>/odp_sysinfo_parse.c files */
40
41#ifndef _GNU_SOURCE
42#define _GNU_SOURCE
43#endif
44
45#ifdef HAVE_CONFIG_H
46#include "config.h"
47#endif
48
49#include <errno.h>
50#include <stdbool.h>
51#include <stdint.h>
52#include <stdio.h>
53#include <string.h>
54#include <unistd.h>
55
56#include <odp_api.h>
57
58#include <event_machine.h>
60
61#include "em_atomic_group.h"
62#include "em_chaining.h"
63#include "em_core.h"
64#include "em_dispatcher.h"
65#include "em_eo.h"
66#include "em_error.h"
67#include "em_event.h"
68#include "em_event_group.h"
69#include "em_hooks.h"
70#include "em_info.h"
71#include "em_libconfig.h"
72#include "em_mem.h"
73#include "em_pool.h"
74#include "em_queue.h"
75#include "em_queue_group.h"
76#include "em_timer.h"
77
78typedef struct {
79 /* EM-cores: */
80 int logic_cores[EM_MAX_CORES];
81 int phys_cores[EM_MAX_CORES];
82 int thr_ids[EM_MAX_CORES];
83 pid_t tids[EM_MAX_CORES];
84 em_core_type_t core_types[EM_MAX_CORES];
85 char proc_tid_stat_paths[EM_MAX_CORES][32];
86
87 /* External EM threads/processes: */
88 pid_t ext_tids[ODP_THREAD_COUNT_MAX];
89 int ext_thr_ids[ODP_THREAD_COUNT_MAX];
91
92static ENV_LOCAL current_core_map_t current_core_map;
93
94static const char *cpu_arch_name(odp_cpu_arch_t cpu_arch)
95{
96 switch (cpu_arch) {
97 case ODP_CPU_ARCH_ARM:
98 return "ARM";
99 case ODP_CPU_ARCH_MIPS:
100 return "MIPS";
101 case ODP_CPU_ARCH_PPC:
102 return "PPC";
103 case ODP_CPU_ARCH_RISCV:
104 return "RISC-V";
105 case ODP_CPU_ARCH_X86:
106 return "x86";
107 default:
108 return "Unknown";
109 }
110}
111
112static const char *arm_isa_name(odp_cpu_arch_arm_t isa)
113{
114 switch (isa) {
115 case ODP_CPU_ARCH_ARMV6:
116 return "ARMv6";
117 case ODP_CPU_ARCH_ARMV7:
118 return "ARMv7-A";
119 case ODP_CPU_ARCH_ARMV8_0:
120 return "ARMv8.0-A";
121 case ODP_CPU_ARCH_ARMV8_1:
122 return "ARMv8.1-A";
123 case ODP_CPU_ARCH_ARMV8_2:
124 return "ARMv8.2-A";
125 case ODP_CPU_ARCH_ARMV8_3:
126 return "ARMv8.3-A";
127 case ODP_CPU_ARCH_ARMV8_4:
128 return "ARMv8.4-A";
129 case ODP_CPU_ARCH_ARMV8_5:
130 return "ARMv8.5-A";
131 case ODP_CPU_ARCH_ARMV8_6:
132 return "ARMv8.6-A";
133 case ODP_CPU_ARCH_ARMV8_7:
134 return "ARMv8.7-A";
135 case ODP_CPU_ARCH_ARMV9_0:
136 return "ARMv9.0-A";
137 case ODP_CPU_ARCH_ARMV9_1:
138 return "ARMv9.1-A";
139 case ODP_CPU_ARCH_ARMV9_2:
140 return "ARMv9.2-A";
141 case ODP_CPU_ARCH_ARMV8_8:
142 return "ARMv8.8-A";
143 case ODP_CPU_ARCH_ARMV8_9:
144 return "ARMv8.9-A";
145 case ODP_CPU_ARCH_ARMV9_3:
146 return "ARMv9.3-A";
147 default:
148 return "Unknown";
149 }
150}
151
152static const char *x86_isa_name(odp_cpu_arch_x86_t isa)
153{
154 switch (isa) {
155 case ODP_CPU_ARCH_X86_I686:
156 return "x86_i686";
157 case ODP_CPU_ARCH_X86_64:
158 return "x86_64";
159 default:
160 return "Unknown";
161 }
162}
163
164static const char *cpu_arch_isa_name(odp_cpu_arch_t cpu_arch,
165 odp_cpu_arch_isa_t cpu_arch_isa)
166{
167 switch (cpu_arch) {
168 case ODP_CPU_ARCH_ARM:
169 return arm_isa_name(cpu_arch_isa.arm);
170 case ODP_CPU_ARCH_MIPS:
171 return "Unknown";
172 case ODP_CPU_ARCH_PPC:
173 return "Unknown";
174 case ODP_CPU_ARCH_RISCV:
175 return "Unknown";
176 case ODP_CPU_ARCH_X86:
177 return x86_isa_name(cpu_arch_isa.x86);
178 default:
179 return "Unknown";
180 }
181}
182
183/*
184 * Detect the ARM ISA used when compiling the em-odp library.
185 * (based on the <arch>/odp_sysinfo_parse.c files)
186 */
187static odp_cpu_arch_arm_t detect_sw_isa_arm(void)
188{
189#if defined(__ARM_ARCH)
190 if (__ARM_ARCH == 8) {
191 #ifdef __ARM_FEATURE_QRDMX
192 /* v8.1 or higher */
193 return ODP_CPU_ARCH_ARMV8_1;
194 #else
195 return ODP_CPU_ARCH_ARMV8_0;
196 #endif
197 }
198
199 if (__ARM_ARCH == 9) {
200 /* v9.0 or higher */
201 return ODP_CPU_ARCH_ARMV9_0;
202 }
203
204 if (__ARM_ARCH >= 800) {
205 /*
206 * ACLE 2018 defines that from v8.1 onwards the value includes
207 * the minor version number: __ARM_ARCH = X * 100 + Y
208 * E.g. for Armv8.1 __ARM_ARCH = 801
209 */
210 int major = __ARM_ARCH / 100;
211 int minor = __ARM_ARCH - (major * 100);
212
213 if (major == 8) {
214 switch (minor) {
215 case 0:
216 return ODP_CPU_ARCH_ARMV8_0;
217 case 1:
218 return ODP_CPU_ARCH_ARMV8_1;
219 case 2:
220 return ODP_CPU_ARCH_ARMV8_2;
221 case 3:
222 return ODP_CPU_ARCH_ARMV8_3;
223 case 4:
224 return ODP_CPU_ARCH_ARMV8_4;
225 case 5:
226 return ODP_CPU_ARCH_ARMV8_5;
227 case 6:
228 return ODP_CPU_ARCH_ARMV8_6;
229 case 7:
230 return ODP_CPU_ARCH_ARMV8_7;
231 case 8:
232 return ODP_CPU_ARCH_ARMV8_8;
233 case 9:
234 return ODP_CPU_ARCH_ARMV8_9;
235 default:
236 return ODP_CPU_ARCH_ARM_UNKNOWN;
237 }
238 } else if (major == 9) {
239 switch (minor) {
240 case 0:
241 return ODP_CPU_ARCH_ARMV9_0;
242 case 1:
243 return ODP_CPU_ARCH_ARMV9_1;
244 case 2:
245 return ODP_CPU_ARCH_ARMV9_2;
246 case 3:
247 return ODP_CPU_ARCH_ARMV9_3;
248 default:
249 return ODP_CPU_ARCH_ARM_UNKNOWN;
250 }
251 }
252 }
253#endif
254 return ODP_CPU_ARCH_ARM_UNKNOWN;
255}
256
257/*
258 * Detect the x86 ISA used when compiling the em-odp library.
259 * (based on the <arch>/odp_sysinfo_parse.c files)
260 */
261static odp_cpu_arch_x86_t detect_sw_isa_x86(void)
262{
263 odp_cpu_arch_x86_t isa_x86 = ODP_CPU_ARCH_X86_UNKNOWN;
264
265#if defined __x86_64 || defined __x86_64__
266 isa_x86 = ODP_CPU_ARCH_X86_64;
267#elif defined __i686 || defined __i686__
268 isa_x86 = ODP_CPU_ARCH_X86_I686;
269#endif
270 return isa_x86;
271}
272
273static odp_cpu_arch_mips_t detect_sw_isa_mips(void)
274{
275 return ODP_CPU_ARCH_MIPS_UNKNOWN;
276}
277
278static odp_cpu_arch_ppc_t detect_sw_isa_ppc(void)
279{
280 return ODP_CPU_ARCH_PPC_UNKNOWN;
281}
282
283static odp_cpu_arch_riscv_t detect_sw_isa_riscv(void)
284{
285 return ODP_CPU_ARCH_RISCV_UNKNOWN;
286}
287
288/*
289 * Detect the SW CPU ISA used when compiling the em-odp library.
290 * (based on the <arch>/odp_sysinfo_parse.c files)
291 */
292static odp_cpu_arch_isa_t detect_sw_isa(odp_cpu_arch_t cpu_arch)
293{
294 odp_cpu_arch_isa_t sw_isa;
295
296 switch (cpu_arch) {
297 case ODP_CPU_ARCH_ARM:
298 sw_isa.arm = detect_sw_isa_arm();
299 break;
300 case ODP_CPU_ARCH_MIPS:
301 sw_isa.mips = detect_sw_isa_mips();
302 break;
303 case ODP_CPU_ARCH_PPC:
304 sw_isa.ppc = detect_sw_isa_ppc();
305 break;
306 case ODP_CPU_ARCH_RISCV:
307 sw_isa.riscv = detect_sw_isa_riscv();
308 break;
309 case ODP_CPU_ARCH_X86:
310 sw_isa.x86 = detect_sw_isa_x86();
311 break;
312 default:
313 sw_isa.arm = ODP_CPU_ARCH_ARM_UNKNOWN;
314 break;
315 }
316
317 return sw_isa;
318}
319
320/* Helper to print_core_map_info(): print EM-cores stored in 'cur-map' */
321static void print_em_cores(const current_core_map_t *const cur_map, int cnt)
322{
323 if (unlikely(cnt <= 0))
324 return;
325
326 /* cnt >= 1 up to core_count */
327 const int logic_last = cur_map->logic_cores[cnt - 1];
328 int idx = 0;
329
330 for (int i = 0; i <= logic_last; i++) {
331 if (i == cur_map->logic_cores[idx]) {
332 int phys_core = cur_map->phys_cores[idx];
333 char phys_core_str[20];
334
335 if (phys_core >= 0)
336 snprintf(phys_core_str, sizeof(phys_core_str), "%2d", phys_core);
337 else
338 snprintf(phys_core_str, sizeof(phys_core_str), " ?");
339 phys_core_str[sizeof(phys_core_str) - 1] = '\0';
340
341 EM_PRINT(" %2d %s %2d %s %" PRIu64 "\n",
342 cur_map->logic_cores[idx], phys_core_str, cur_map->thr_ids[idx],
343 cur_map->core_types[idx] == EM_CORE_TYPE_WORKER ? "WRK" : "CTL",
344 (uint64_t)cur_map->tids[idx]);
345 idx++;
346 } else {
347 EM_PRINT(" - - - - -\n");
348 }
349 }
350}
351
352/* Helper to print_core_map_info(): print EM external threads/processes stored in 'cur-map' */
353static void print_ext_threads(const current_core_map_t *const cur_map, int ext_cnt)
354{
355 if (unlikely(ext_cnt <= 0))
356 return;
357
358 for (int i = 0; i < ext_cnt; i++) {
359 EM_PRINT(" - - %2d EXT %" PRIu64 "\n",
360 cur_map->ext_thr_ids[i], (uint64_t)cur_map->ext_tids[i]);
361 }
362}
363
364void print_core_map_info(void)
365{
366 core_map_t *const core_map = &em_shm->core_map;
367 current_core_map_t *const cur_map = &current_core_map;
368 const odp_cpumask_t *const logic_mask = &core_map->rwlocked.logic_mask.odp_cpumask;
369 const odp_thrmask_t *const thrmask_extthrs = &core_map->rwlocked.thrmask_extthrs;
370
371 odp_rwlock_read_lock(&core_map->rwlock);
372
373 /* Read the current mappings for EM_CORE_TYPE_WORKER & _CONTROL */
374 uint32_t cnt = 0;
375 int logic_core = odp_cpumask_first(logic_mask);
376
377 while (logic_core >= 0 && cnt < EM_MAX_CORES) {
378 cur_map->logic_cores[cnt] = logic_core;
379 /* set later: cur_map->phys_cores[cnt] */
380 cur_map->thr_ids[cnt] = core_map->rwlocked.thr_vs_logic.odp_thr[logic_core];
381 cur_map->tids[cnt] = core_map->rwlocked.tids[logic_core];
382 cur_map->core_types[cnt] = core_map->rwlocked.core_types[logic_core];
383 memcpy(cur_map->proc_tid_stat_paths[cnt],
384 core_map->rwlocked.proc_tid_stat_paths[logic_core],
385 sizeof(cur_map->proc_tid_stat_paths[cnt]));
386 logic_core = odp_cpumask_next(logic_mask, logic_core);
387 cnt++;
388 }
389
390 /* Ext threads/processes: EM_CORE_TYPE_EXTERNAL */
391 int ext_cnt = 0;
392 int ext_thr = odp_thrmask_first(thrmask_extthrs);
393
394 while (ext_thr >= 0 && ext_cnt < ODP_THREAD_COUNT_MAX) {
395 cur_map->ext_thr_ids[ext_cnt] = ext_thr;
396 cur_map->ext_tids[ext_cnt] = core_map->rwlocked.ext_tids[ext_thr];
397 ext_thr = odp_thrmask_next(thrmask_extthrs, ext_thr);
398 ext_cnt++;
399 }
400
401 odp_rwlock_read_unlock(&core_map->rwlock);
402
403 if (unlikely(cnt == 0 && ext_cnt == 0))
404 goto core_map_error;
405
406 /* read the phys core from the stored /proc/[tid]/stat files */
407 for (uint32_t i = 0; i < cnt; i++) {
408 const char *path = cur_map->proc_tid_stat_paths[i];
409
410 if (unlikely(path[0] == '\0')) {
411 cur_map->phys_cores[i] = -1; /* prints '?' */
412 continue;
413 }
414
415 FILE *file = fopen(path, "r");
416
417 if (!file) {
418 EM_LOG(EM_LOG_ERR, "fopen(%s) failed: %s (%d)\n",
419 path, strerror(errno), errno);
420 return;
421 }
422 cur_map->phys_cores[i] = read_proc_cpuid(file);
423 fclose(file);
424 }
425
426 /* Print outside of rwlock */
427 EM_PRINT("Core mapping:\n"
428 "EM-core <-> phys-core <-> ODP-thread <-> type <-> pid\n");
429
430 /* Print EM worker and control cores */
431 print_em_cores(cur_map, cnt);
432
433 /* Print EM external threads/processes: */
434 print_ext_threads(cur_map, ext_cnt);
435
436 EM_PRINT("\n");
437 return;
438
439core_map_error:
440 EM_PRINT("Core mapping:\n"
441 "EM-core <-> phys-core <-> ODP-thread <-> type <-> pid\n"
442 " - - - - -\n\n");
443}
444
445void print_cpu_arch_info(void)
446{
447 odp_system_info_t sysinfo;
448 int err;
449
450 err = odp_system_info(&sysinfo);
451 if (err) {
452 EM_PRINT("%s(): odp_system_info() call failed:%d\n",
453 __func__, err);
454 return;
455 }
456
457 /* detect & print EM SW ISA info here also */
458 odp_cpu_arch_isa_t isa_em = detect_sw_isa(sysinfo.cpu_arch);
459
460 const char *cpu_arch = cpu_arch_name(sysinfo.cpu_arch);
461 const char *hw_isa = cpu_arch_isa_name(sysinfo.cpu_arch,
462 sysinfo.cpu_isa_hw);
463 const char *sw_isa_odp = cpu_arch_isa_name(sysinfo.cpu_arch,
464 sysinfo.cpu_isa_sw);
465 const char *sw_isa_em = cpu_arch_isa_name(sysinfo.cpu_arch, isa_em);
466
467 EM_PRINT("CPU model: %s\n"
468 "CPU arch: %s\n"
469 "CPU ISA version: %s\n"
470 " SW ISA version (ODP): %s\n"
471 " SW ISA version (EM): %s\n"
472 "\n",
473 odp_cpu_model_str(), cpu_arch,
474 hw_isa, sw_isa_odp, sw_isa_em);
475}
476
477static void print_mem_info(void)
478{
479 EM_PRINT("EM shared mem size: %zu B\n"
480 "EM local mem size: %zu B (per core)\n",
481 sizeof(em_shm_t), sizeof(em_locm_t));
482
483 DBG_PRINT("\nem_locm_t:\t\t\t offset\t size\n"
484 "\t\t\t\t ------\t ----\n"
485 "current:\t\t\t%5zu B\t%5zu B\n"
486 "idle_state:\t\t\t%5zu B\t%5zu B\n"
487 "dispatch_cnt:\t\t\t%5zu B\t%5zu B\n"
488 "poll_drain_dispatch_cnt:\t%5zu B\t%5zu B\n"
489 "event_burst_cnt:\t\t%5zu B\t%5zu B\n"
490 "core_id:\t\t\t%5zu B\t%5zu B\n"
491 "local_queues:\t\t\t%5zu B\t%5zu B\n"
492 "local_event_cnt:\t\t%5zu B\t%5zu B\n"
493 "input_poll_fn:\t\t\t%5zu B\t%5zu B\n"
494 "output_drain_fn:\t\t%5zu B\t%5zu B\n"
495 "atomic_group_released:\t\t%5zu B\t%5zu B\n"
496 "is_sched_paused:\t\t%5zu B\t%5zu B\n"
497 "is_em_core:\t\t\t%5zu B\t%5zu B\n"
498 "is_external_thread:\t\t%5zu B\t%5zu B\n"
499 "is_term_thread_done:\t\t%5zu B\t%5zu B\n"
500 "is_core_local_inited:\t\t%5zu B\t%5zu B\n"
501 "dispatch_last_run:\t\t%5zu B\t%5zu B\n"
502 "poll_ctrl_interval_time:\t%5zu B\t%5zu B\n"
503 "poll_drain_dispatch_last_run:\t%5zu B\t%5zu B\n"
504 "poll_drain_interval_time:\t%5zu B\t%5zu B\n"
505 "init_pid:\t\t\t%5zu B\t%5zu B\n"
506 "start_eo_elem:\t\t\t%5zu B\t%5zu B\n"
507 "error_count:\t\t\t%5zu B\t%5zu B\n"
508 "log_fn:\t\t\t\t%5zu B\t%5zu B\n"
509 "vlog_fn:\t\t\t%5zu B\t%5zu B\n"
510 "sync_api:\t\t\t%5zu B\t%5zu B\n"
511 "debug_ts[]:\t\t\t%5zu B\t%5zu B\n"
512 "output_queue_track:\t\t%5zu B\t%5zu B\n"
513 "conf_local:\t\t\t%5zu B\t%5zu B\n"
514 "evhdr_nonem:\t\t\t%5zu B\t%5zu B\n"
515 "end:\t\t\t\t%5zu B\t%5zu B\n\n",
516 offsetof(em_locm_t, current),
517 sizeof_field(em_locm_t, current),
518 offsetof(em_locm_t, idle_state),
519 sizeof_field(em_locm_t, idle_state),
520 offsetof(em_locm_t, dispatch_cnt),
521 sizeof_field(em_locm_t, dispatch_cnt),
522 offsetof(em_locm_t, poll_drain_dispatch_cnt),
523 sizeof_field(em_locm_t, poll_drain_dispatch_cnt),
524 offsetof(em_locm_t, event_burst_cnt),
525 sizeof_field(em_locm_t, event_burst_cnt),
526 offsetof(em_locm_t, core_id),
527 sizeof_field(em_locm_t, core_id),
528 offsetof(em_locm_t, local_queues),
529 sizeof_field(em_locm_t, local_queues),
530 offsetof(em_locm_t, local_event_cnt),
531 sizeof_field(em_locm_t, local_event_cnt),
532 offsetof(em_locm_t, input_poll_fn),
533 sizeof_field(em_locm_t, input_poll_fn),
534 offsetof(em_locm_t, output_drain_fn),
535 sizeof_field(em_locm_t, output_drain_fn),
536 offsetof(em_locm_t, atomic_group_released),
537 sizeof_field(em_locm_t, atomic_group_released),
538 offsetof(em_locm_t, is_sched_paused),
539 sizeof_field(em_locm_t, is_sched_paused),
540 offsetof(em_locm_t, is_em_core),
541 sizeof_field(em_locm_t, is_em_core),
542 offsetof(em_locm_t, is_external_thread),
543 sizeof_field(em_locm_t, is_external_thread),
544 offsetof(em_locm_t, is_term_thread_done),
545 sizeof_field(em_locm_t, is_term_thread_done),
546 offsetof(em_locm_t, is_core_local_inited),
547 sizeof_field(em_locm_t, is_core_local_inited),
548 offsetof(em_locm_t, dispatch_last_run),
549 sizeof_field(em_locm_t, dispatch_last_run),
550 offsetof(em_locm_t, poll_ctrl_interval_time),
551 sizeof_field(em_locm_t, poll_ctrl_interval_time),
552 offsetof(em_locm_t, poll_drain_dispatch_last_run),
553 sizeof_field(em_locm_t, poll_drain_dispatch_last_run),
554 offsetof(em_locm_t, poll_drain_interval_time),
555 sizeof_field(em_locm_t, poll_drain_interval_time),
556 offsetof(em_locm_t, init_pid),
557 sizeof_field(em_locm_t, init_pid),
558 offsetof(em_locm_t, start_eo_elem),
559 sizeof_field(em_locm_t, start_eo_elem),
560 offsetof(em_locm_t, error_count),
561 sizeof_field(em_locm_t, error_count),
562 offsetof(em_locm_t, log_fn),
563 sizeof_field(em_locm_t, log_fn),
564 offsetof(em_locm_t, vlog_fn),
565 sizeof_field(em_locm_t, vlog_fn),
566 offsetof(em_locm_t, sync_api),
567 sizeof_field(em_locm_t, sync_api),
568 offsetof(em_locm_t, debug_ts),
569 sizeof_field(em_locm_t, debug_ts),
570 offsetof(em_locm_t, output_queue_track),
571 sizeof_field(em_locm_t, output_queue_track),
572 offsetof(em_locm_t, conf_local),
573 sizeof_field(em_locm_t, conf_local),
574 offsetof(em_locm_t, evhdr_nonem),
575 sizeof_field(em_locm_t, evhdr_nonem),
576 offsetof(em_locm_t, end),
577 sizeof_field(em_locm_t, end)
578 );
579}
580
581void print_version_info(void)
582{
583 EM_PRINT("\n"
584 "===========================================================\n"
585 "EM version information: %s\n"
586 "===========================================================\n"
587 "EM API version: %s\n"
588 "EM version: %s, "
589#ifdef EM_64_BIT
590 "64 bit "
591#else
592 "32 bit "
593#endif
594 "(EM_CHECK_LEVEL:%d, EM_ESV_ENABLE:%d)\n"
595 "EM build info: %s\n"
596 "ODP API version: %s\n"
597 "ODP impl name: %s\n"
598 "ODP impl details: %s\n",
602 odp_version_api_str(),
603 odp_version_impl_name(),
604 odp_version_impl_str());
605
606 print_cpu_arch_info();
607}
608
609/**
610 * Print information about EM & the environment
611 */
612void print_em_info(void)
613{
614 EM_PRINT("\n"
615 "===========================================================\n"
616 "EM Info on target: %s\n"
617 "===========================================================\n",
619 print_mem_info();
620 print_core_map_info();
621 print_queue_capa();
622 print_queue_elem_info();
623 queue_group_info_print_all();
625 print_pool_elem_info();
626 print_ag_elem_info();
627 print_event_info();
628}
em_shm_t * em_shm
#define EM_ESV_ENABLE
#define EM_CHECK_LEVEL
#define EM_MAX_CORES
em_core_type_t
@ EM_CORE_TYPE_WORKER
void em_pool_info_print_all(void)
#define EM_VERSION_API_STR
#define EM_VERSION_STR
#define EM_TARGET_STR
#define EM_BUILD_INFO_STR
odp_rwlock_t rwlock
char proc_tid_stat_paths[EM_MAX_CORES][32]
em_core_type_t core_types[EM_MAX_CORES]
pid_t ext_tids[ODP_THREAD_COUNT_MAX]
uint16_t odp_thr[EM_MAX_CORES]
odp_thrmask_t thrmask_extthrs
em_core_mask_t logic_mask
pid_t tids[EM_MAX_CORES]