1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (C) 2024 Intel Corporation. 3 * All rights reserved. 4 */ 5 #ifndef EVENT_INTERNAL_H 6 #define EVENT_INTERNAL_H 7 8 #include "spdk/stdinc.h" 9 #include "spdk/cpuset.h" 10 #include "spdk/queue.h" 11 #include "spdk_internal/event.h" 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 struct spdk_lw_thread { 18 TAILQ_ENTRY(spdk_lw_thread) link; 19 uint64_t tsc_start; 20 uint32_t lcore; 21 uint32_t initial_lcore; 22 bool resched; 23 /* stats over a lifetime of a thread */ 24 struct spdk_thread_stats total_stats; 25 /* stats during the last scheduling period */ 26 struct spdk_thread_stats current_stats; 27 }; 28 29 /** 30 * Parse proc/stat and get time spent processing system mode and user mode 31 * 32 * \param core Core which will be queried 33 * \param usr Holds time [USER_HZ] spent processing in user mode 34 * \param sys Holds time [USER_HZ] spent processing in system mode 35 * \param irq Holds time [USER_HZ] spent processing interrupts 36 * 37 * \return 0 on success -1 on fail 38 */ 39 int app_get_proc_stat(unsigned int core, uint64_t *usr, uint64_t *sys, uint64_t *irq); 40 41 /** 42 * Get isolated CPU core mask. 43 */ 44 const char *scheduler_get_isolated_core_mask(void); 45 46 /** 47 * Set isolated CPU core mask. 48 */ 49 bool scheduler_set_isolated_core_mask(struct spdk_cpuset isolated_core_mask); 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif /* EVENT_INTERNAL_H */ 56