Home
last modified time | relevance | path

Searched full:stats (Results 1 – 25 of 206) sorted by relevance

123456789

/Zephyr-latest/tests/lib/mem_blocks_stats/src/
Dmain.c21 struct sys_memory_stats stats; in ZTEST() local
29 status = sys_mem_blocks_runtime_stats_get(NULL, &stats); in ZTEST()
49 struct sys_memory_stats stats; in ZTEST() local
53 /* Verify initial stats */ in ZTEST()
55 status = sys_mem_blocks_runtime_stats_get(&mem_block_01, &stats); in ZTEST()
58 zassert_equal(stats.free_bytes, BLK_SZ * NUM_BLOCKS, in ZTEST()
60 BLK_SZ * NUM_BLOCKS, stats.free_bytes); in ZTEST()
61 zassert_equal(stats.allocated_bytes, 0, in ZTEST()
63 stats.allocated_bytes); in ZTEST()
64 zassert_equal(stats.max_allocated_bytes, 0, in ZTEST()
[all …]
/Zephyr-latest/tests/kernel/mem_slab/mslab_stats/src/
Dmain.c17 struct sys_memory_stats stats; in ZTEST() local
25 status = k_mem_slab_runtime_stats_get(NULL, &stats); in ZTEST()
45 struct sys_memory_stats stats; in ZTEST() local
49 /* Verify initial stats */ in ZTEST()
51 status = k_mem_slab_runtime_stats_get(&kmslab, &stats); in ZTEST()
54 zassert_equal(stats.free_bytes, BLK_SZ * NUM_BLOCKS, in ZTEST()
56 BLK_SZ * NUM_BLOCKS, stats.free_bytes); in ZTEST()
57 zassert_equal(stats.allocated_bytes, 0, in ZTEST()
59 stats.allocated_bytes); in ZTEST()
60 zassert_equal(stats.max_allocated_bytes, 0, in ZTEST()
[all …]
/Zephyr-latest/subsys/net/l2/ethernet/
Deth_stats.h22 struct net_stats_eth *stats; in eth_stats_update_bytes_rx() local
28 stats = api->get_stats(net_if_get_device(iface)); in eth_stats_update_bytes_rx()
29 if (!stats) { in eth_stats_update_bytes_rx()
33 stats->bytes.received += bytes; in eth_stats_update_bytes_rx()
41 struct net_stats_eth *stats; in eth_stats_update_bytes_tx() local
47 stats = api->get_stats(net_if_get_device(iface)); in eth_stats_update_bytes_tx()
48 if (!stats) { in eth_stats_update_bytes_tx()
52 stats->bytes.sent += bytes; in eth_stats_update_bytes_tx()
59 struct net_stats_eth *stats; in eth_stats_update_pkts_rx() local
65 stats = api->get_stats(net_if_get_device(iface)); in eth_stats_update_pkts_rx()
[all …]
/Zephyr-latest/subsys/net/l2/ppp/
Dppp_stats.h21 struct net_stats_ppp *stats; in ppp_stats_update_bytes_rx() local
27 stats = api->get_stats(net_if_get_device(iface)); in ppp_stats_update_bytes_rx()
28 if (!stats) { in ppp_stats_update_bytes_rx()
32 stats->bytes.received += bytes; in ppp_stats_update_bytes_rx()
40 struct net_stats_ppp *stats; in ppp_stats_update_bytes_tx() local
46 stats = api->get_stats(net_if_get_device(iface)); in ppp_stats_update_bytes_tx()
47 if (!stats) { in ppp_stats_update_bytes_tx()
51 stats->bytes.sent += bytes; in ppp_stats_update_bytes_tx()
58 struct net_stats_ppp *stats; in ppp_stats_update_pkts_rx() local
64 stats = api->get_stats(net_if_get_device(iface)); in ppp_stats_update_pkts_rx()
[all …]
/Zephyr-latest/tests/net/conn_mgr_monitor/src/
Dmain.c147 * @brief Copy and then reset global test stats.
149 * @return struct test_stats -- The copy of the global test stats struct before it was reset
287 struct test_stats stats; in cycle_ready_ifaces() local
295 stats = get_reset_stats(); in cycle_ready_ifaces()
296 zassert_equal(stats.event_count_gen, 0, in cycle_ready_ifaces()
304 stats = get_reset_stats(); in cycle_ready_ifaces()
305 zassert_equal(stats.conn_count_gen, 1, in cycle_ready_ifaces()
307 zassert_equal(stats.event_count_gen, 1, in cycle_ready_ifaces()
309 zassert_equal(stats.conn_iface_gen, ifa, "ifa should be blamed."); in cycle_ready_ifaces()
316 stats = get_reset_stats(); in cycle_ready_ifaces()
[all …]
/Zephyr-latest/samples/basic/hash_map/src/
Dmain.c25 static void print_stats(const struct _stats *stats);
32 struct _stats stats = {0}; in main() local
45 ++stats.n_insert; in main()
46 ++stats.max_size; in main()
55 for (i = 0; i < stats.max_size; ++i) { in main()
57 ires = sys_hashmap_insert(&map, i, stats.max_size - i, NULL); in main()
59 ++stats.n_replace; in main()
68 for (i = stats.max_size; i > 0; --i) { in main()
71 ++stats.n_remove; in main()
84 print_stats(&stats); in main()
[all …]
/Zephyr-latest/subsys/net/ip/
Dnet_stats.h22 #define GET_STAT(iface, s) (iface ? iface->stats.s : net_stats.s)
23 #define GET_STAT_ADDR(iface, s) (iface ? &iface->stats.s : &net_stats.s)
34 /* Core stats */
38 UPDATE_STAT(iface, stats.processing_error++); in net_stats_update_processing_error()
43 UPDATE_STAT(iface, stats.ip_errors.protoerr++); in net_stats_update_ip_errors_protoerr()
48 UPDATE_STAT(iface, stats.ip_errors.vhlerr++); in net_stats_update_ip_errors_vhlerr()
54 UPDATE_STAT(iface, stats.bytes.received += bytes); in net_stats_update_bytes_recv()
60 UPDATE_STAT(iface, stats.bytes.sent += bytes); in net_stats_update_bytes_sent()
71 /* IPv6 stats */
75 UPDATE_STAT(iface, stats.ipv6.sent++); in net_stats_update_ipv6_sent()
[all …]
/Zephyr-latest/kernel/
Dusage.c122 void z_sched_cpu_usage(uint8_t cpu_id, struct k_thread_runtime_stats *stats) in z_sched_cpu_usage() argument
136 * Getting stats for the current CPU. Update both its in z_sched_cpu_usage()
137 * current thread stats and the CPU stats as the CPU's in z_sched_cpu_usage()
151 stats->total_cycles = cpu->usage->total; in z_sched_cpu_usage()
153 stats->current_cycles = cpu->usage->current; in z_sched_cpu_usage()
154 stats->peak_cycles = cpu->usage->longest; in z_sched_cpu_usage()
157 stats->average_cycles = 0; in z_sched_cpu_usage()
159 stats->average_cycles = stats->total_cycles / in z_sched_cpu_usage()
164 stats->idle_cycles = in z_sched_cpu_usage()
167 stats->execution_cycles = stats->total_cycles + stats->idle_cycles; in z_sched_cpu_usage()
[all …]
Dobj_core.c30 obj_core->stats = NULL; in k_obj_core_init()
125 int k_obj_core_stats_register(struct k_obj_core *obj_core, void *stats, in k_obj_core_stats_register() argument
138 obj_core->stats = stats; in k_obj_core_stats_register()
156 obj_core->stats = NULL; in k_obj_core_stats_deregister()
165 int k_obj_core_stats_raw(struct k_obj_core *obj_core, void *stats, in k_obj_core_stats_raw() argument
177 } else if ((desc->raw_size != stats_len) || (obj_core->stats == NULL)) { in k_obj_core_stats_raw()
179 * Either the size of the stats buffer is wrong or in k_obj_core_stats_raw()
184 rv = desc->raw(obj_core, stats); in k_obj_core_stats_raw()
192 int k_obj_core_stats_query(struct k_obj_core *obj_core, void *stats, in k_obj_core_stats_query() argument
204 } else if ((desc->query_size != stats_len) || (obj_core->stats == NULL)) { in k_obj_core_stats_query()
[all …]
/Zephyr-latest/tests/drivers/mm/sys_mm_drv_bank/src/
Dmain.c17 struct sys_memory_stats *stats, in test_stats() argument
20 zassert_equal(stats->free_bytes, expected->free_bytes, in test_stats()
22 stats->free_bytes, expected->free_bytes); in test_stats()
23 zassert_equal(stats->allocated_bytes, expected->allocated_bytes, in test_stats()
25 stats->allocated_bytes, expected->allocated_bytes); in test_stats()
26 zassert_equal(stats->max_allocated_bytes, expected->max_allocated_bytes, in test_stats()
28 stats->max_allocated_bytes, in test_stats()
34 struct sys_memory_stats stats; in ZTEST() local
45 sys_mm_drv_bank_stats_get(&bank_data, &stats); in ZTEST()
46 test_stats("MM Bank Init Error", &stats, &expected); in ZTEST()
[all …]
/Zephyr-latest/tests/kernel/mem_protect/demand_paging/mem_map/src/
Dmain.c99 static void print_paging_stats(struct k_mem_paging_stats_t *stats, const char *scope) in print_paging_stats() argument
102 printk(" - Total: %lu\n", stats->pagefaults.cnt); in print_paging_stats()
103 printk(" - IRQ locked: %lu\n", stats->pagefaults.irq_locked); in print_paging_stats()
104 printk(" - IRQ unlocked: %lu\n", stats->pagefaults.irq_unlocked); in print_paging_stats()
106 printk(" - in ISR: %lu\n", stats->pagefaults.in_isr); in print_paging_stats()
111 stats->eviction.clean + stats->eviction.dirty); in print_paging_stats()
113 stats->eviction.clean); in print_paging_stats()
115 stats->eviction.dirty); in print_paging_stats()
123 struct k_mem_paging_stats_t stats; in touch_anon_pages() local
162 k_mem_paging_stats_get(&stats); in touch_anon_pages()
[all …]
/Zephyr-latest/tests/kernel/obj_core/obj_core_stats_api/src/
Dmain.c40 * Attempt to enable stats for an object core that is not enabled in ZTEST()
56 * Note: Testing the stats enable function pointer is done in another in ZTEST()
71 * Attempt to disable stats for an object core that is not enabled in ZTEST()
87 * Note: Testing the stats disable function pointer is done in in ZTEST()
102 * Attempt to reset stats for an object core that is not enabled in ZTEST()
118 * Note: Testing the stats reset function pointer is done in in ZTEST()
129 int (*saved_query)(struct k_obj_core *obj_core, void *stats); in ZTEST()
134 * Attempt to query stats for an object core that is not enabled in ZTEST()
152 * Note: Testing the stats query function pointer is done in in ZTEST()
163 int (*saved_raw)(struct k_obj_core *obj_core, void *stats); in ZTEST()
[all …]
/Zephyr-latest/tests/kernel/timer/timer_behavior/pytest/
Dtest_timer.py14 def do_analysis(test, stats, stats_count, config, sys_clock_hw_cycles_per_sec): argument
46 time_diff = stats['total_time'] - seconds - expected_total_drift
48 logger.info(f'min: {stats["min"] * 1_000_000:.6f} us')
49 logger.info(f'max: {stats["max"] * 1_000_000:.6f} us')
50 logger.info(f'mean: {stats["mean"] * 1_000_000:.6f} us')
51 logger.info(f'variance: {stats["var"] * 1_000_000:.6f} us')
52 logger.info(f'stddev: {stats["stddev"] * 1_000_000:.6f} us')
53 logger.info(f'total time: {stats["total_time"] * 1_000_000:.6f} us')
61 ', '.join(['"{}_us":{:.6f}'.format(k, v * 1_000_000) for k,v in stats.items()]) +
81 assert stats['stddev'] < max_stddev
[all …]
/Zephyr-latest/subsys/pm/
Dpm_stats.c12 #include <zephyr/stats/stats.h>
27 static STATS_SECT_DECL(pm_stats) stats[CONFIG_MP_MAX_NUM_CPUS][PM_STATE_COUNT];
43 stats_init(&(stats[i][j].s_hdr), STATS_SIZE_32, 3U, in pm_stats_init()
45 stats_register(names[i][j], &(stats[i][j].s_hdr)); in pm_stats_init()
69 STATS_INC(stats[cpu][state], state_count); in pm_stats_update()
70 STATS_INCN(stats[cpu][state], state_total_cycles, time_total); in pm_stats_update()
71 STATS_SET(stats[cpu][state], state_last_cycles, time_total); in pm_stats_update()
/Zephyr-latest/lib/heap/
Dheap_stats.c12 struct sys_memory_stats *stats) in sys_heap_runtime_stats_get() argument
14 if ((heap == NULL) || (stats == NULL)) { in sys_heap_runtime_stats_get()
18 stats->free_bytes = heap->heap->free_bytes; in sys_heap_runtime_stats_get()
19 stats->allocated_bytes = heap->heap->allocated_bytes; in sys_heap_runtime_stats_get()
20 stats->max_allocated_bytes = heap->heap->max_allocated_bytes; in sys_heap_runtime_stats_get()
/Zephyr-latest/kernel/paging/
Dstatistics.c91 void z_impl_k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats) in z_impl_k_mem_paging_stats_get() argument
93 if (stats == NULL) { in z_impl_k_mem_paging_stats_get()
98 memcpy(stats, &paging_stats, sizeof(paging_stats)); in z_impl_k_mem_paging_stats_get()
103 void z_vrfy_k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats) in z_vrfy_k_mem_paging_stats_get() argument
105 K_OOPS(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats))); in z_vrfy_k_mem_paging_stats_get()
106 z_impl_k_mem_paging_stats_get(stats); in z_vrfy_k_mem_paging_stats_get()
113 struct k_mem_paging_stats_t *stats) in z_impl_k_mem_paging_thread_stats_get() argument
115 if ((thread == NULL) || (stats == NULL)) { in z_impl_k_mem_paging_thread_stats_get()
120 memcpy(stats, &thread->paging_stats, sizeof(thread->paging_stats)); in z_impl_k_mem_paging_thread_stats_get()
126 struct k_mem_paging_stats_t *stats) in z_vrfy_k_mem_paging_thread_stats_get() argument
[all …]
/Zephyr-latest/samples/basic/sys_heap/src/
Dmain.c39 struct sys_memory_stats stats; in print_sys_memory_stats() local
41 sys_heap_runtime_stats_get(&heap, &stats); in print_sys_memory_stats()
44 stats.allocated_bytes, stats.free_bytes, in print_sys_memory_stats()
45 stats.max_allocated_bytes, HEAP_SIZE); in print_sys_memory_stats()
/Zephyr-latest/subsys/shell/modules/kernel_service/
Dheap.c21 struct sys_memory_stats stats; in cmd_kernel_heap() local
23 err = sys_heap_runtime_stats_get(&_system_heap, &stats); in cmd_kernel_heap()
29 shell_print(sh, "free: %zu", stats.free_bytes); in cmd_kernel_heap()
30 shell_print(sh, "allocated: %zu", stats.allocated_bytes); in cmd_kernel_heap()
31 shell_print(sh, "max. allocated: %zu", stats.max_allocated_bytes); in cmd_kernel_heap()
/Zephyr-latest/subsys/net/lib/shell/
Dmem.c161 STRUCT_SECTION_FOREACH(net_pkt_alloc_stats_slab, stats) { in cmd_net_mem()
162 if (stats->ok.count) { in cmd_net_mem()
163 PR("%p\tOK \t%u\t%llu\t\t%llu\n", stats->slab, stats->ok.count, in cmd_net_mem()
164 stats->ok.alloc_sum / (uint64_t)stats->ok.count, in cmd_net_mem()
165 k_cyc_to_us_ceil64(stats->ok.time_sum / in cmd_net_mem()
166 (uint64_t)stats->ok.count)); in cmd_net_mem()
169 if (stats->fail.count) { in cmd_net_mem()
170 PR("%p\tFAIL\t%u\t%llu\t\t%llu\n", stats->slab, stats->fail.count, in cmd_net_mem()
171 stats->fail.alloc_sum / (uint64_t)stats->fail.count, in cmd_net_mem()
172 k_cyc_to_us_ceil64(stats->fail.time_sum / in cmd_net_mem()
[all …]
/Zephyr-latest/subsys/stats/
Dstats_shell.c8 #include <zephyr/stats/stats.h>
36 shell_print(sh, "Stats Group %s (hdr addr: %p)", hdr->s_name, (void *)hdr); in stats_group_cb()
47 SHELL_CMD(list, NULL, "List stats", cmd_stats_list),
51 SHELL_CMD_REGISTER(stats, &sub_stats, "Stats commands", NULL);
DKconfig5 config STATS config
14 depends on STATS
23 depends on STATS && SHELL
/Zephyr-latest/include/zephyr/kernel/
Dobj_core.h93 size_t raw_size; /**< Internal representation stats buffer size */
94 size_t query_size; /**< Stats buffer size used for reporting */
96 /** Function pointer to retrieve internal representation of stats */
97 int (*raw)(struct k_obj_core *obj_core, void *stats);
99 int (*query)(struct k_obj_core *obj_core, void *stats);
125 void *stats; /**< Pointer to kernel object's stats */ member
256 * @brief Initialize the object type's stats descriptor
258 * This routine initializes the object type's stats descriptor.
276 * @param stats Pointer to the object's raw statistics
279 void *stats) in k_obj_core_stats_init() argument
[all …]
/Zephyr-latest/include/zephyr/net/
Dnet_stats.h929 &(iface)->stats.ipv6.sent); \
936 &(iface)->stats.ipv6.recv); \
943 &(iface)->stats.ipv6.drop); \
950 &(iface)->stats.ipv6.forwarded)
964 &(iface)->stats.ipv4.sent); \
971 &(iface)->stats.ipv4.recv); \
978 &(iface)->stats.ipv4.drop); \
985 &(iface)->stats.ipv4.forwarded)
999 &(iface)->stats.icmp.sent); \
1006 &(iface)->stats.icmp.recv); \
[all …]
/Zephyr-latest/subsys/net/lib/sockets/
Dsocket_obj_core.c32 static int sock_obj_stats_raw(struct k_obj_core *obj_core, void *stats);
40 .disable = NULL, /* Stats gathering is always on */
41 .enable = NULL, /* Stats gathering is always on */
70 k_obj_core_stats_register(K_OBJ_CORE(sock), &sock->stats, in sock_obj_core_init_and_link()
83 static int sock_obj_stats_raw(struct k_obj_core *obj_core, void *stats) in sock_obj_stats_raw() argument
85 memcpy(stats, obj_core->stats, sizeof(struct sock_obj_type_raw_stats)); in sock_obj_stats_raw()
92 memset(obj_core->stats, 0, sizeof(struct sock_obj_type_raw_stats)); in sock_obj_core_stats_reset()
229 sock_objects[i].stats.sent += bytes; in sock_obj_core_update_send_stats()
245 sock_objects[i].stats.received += bytes; in sock_obj_core_update_recv_stats()
/Zephyr-latest/drivers/mm/
Dmm_drv_bank.c46 struct sys_memory_stats *stats) in sys_mm_drv_bank_stats_get() argument
48 stats->free_bytes = bank->unmapped_pages * in sys_mm_drv_bank_stats_get()
50 stats->allocated_bytes = bank->mapped_pages * in sys_mm_drv_bank_stats_get()
52 stats->max_allocated_bytes = bank->max_mapped_pages * in sys_mm_drv_bank_stats_get()

123456789