51#ifndef ZEPHYR_INCLUDE_STATS_STATS_H_
52#define ZEPHYR_INCLUDE_STATS_STATS_H_
64} __attribute__((packed));
71#ifdef CONFIG_STATS_NAMES
83#define STATS_SECT_DECL(group__) \
84 struct stats_ ## group__
89#define STATS_SECT_END }
101#define STATS_SECT_START(group__) \
102 STATS_SECT_DECL(group__) { \
103 struct stats_hdr s_hdr;
110#define STATS_SECT_ENTRY(var__) uint32_t var__;
117#define STATS_SECT_ENTRY16(var__) uint16_t var__;
124#define STATS_SECT_ENTRY32(var__) uint32_t var__;
131#define STATS_SECT_ENTRY64(var__) uint64_t var__;
143#define STATS_INCN(group__, var__, n__) \
144 ((group__).var__ += (n__))
155#define STATS_INC(group__, var__) \
156 STATS_INCN(group__, var__, 1)
167#define STATS_CLEAR(group__, var__) \
168 ((group__).var__ = 0)
170#define STATS_SIZE_16 (sizeof(uint16_t))
171#define STATS_SIZE_32 (sizeof(uint32_t))
172#define STATS_SIZE_64 (sizeof(uint64_t))
174#define STATS_SIZE_INIT_PARMS(group__, size__) \
176 ((sizeof(group__)) - sizeof(struct stats_hdr)) / (size__)
192#define STATS_INIT_AND_REG(group__, size__, name__) \
193 stats_init_and_reg( \
196 (sizeof(group__) - sizeof(struct stats_hdr)) / (size__), \
197 STATS_NAME_INIT_PARMS(group__), \
232int stats_register(
const char *name,
struct stats_hdr *shdr);
281typedef int stats_walk_fn(
struct stats_hdr *hdr,
void *arg,
294int stats_walk(
struct stats_hdr *hdr, stats_walk_fn *walk_cb,
void *arg);
305typedef int stats_group_walk_fn(
struct stats_hdr *hdr,
void *arg);
316int stats_group_walk(stats_group_walk_fn *walk_cb,
void *arg);
337struct stats_hdr *stats_group_find(
const char *name);
341#define STATS_SECT_START(group__) \
342 STATS_SECT_DECL(group__) {
344#define STATS_SECT_ENTRY(var__)
345#define STATS_SECT_ENTRY16(var__)
346#define STATS_SECT_ENTRY32(var__)
347#define STATS_SECT_ENTRY64(var__)
348#define STATS_RESET(var__)
349#define STATS_SIZE_INIT_PARMS(group__, size__)
350#define STATS_INCN(group__, var__, n__)
351#define STATS_INC(group__, var__)
352#define STATS_CLEAR(group__, var__)
353#define STATS_INIT_AND_REG(group__, size__, name__) (0)
357#ifdef CONFIG_STATS_NAMES
359#define STATS_NAME_MAP_NAME(sectname__) stats_map_ ## sectname__
361#define STATS_NAME_START(sectname__) \
362 const struct stats_name_map STATS_NAME_MAP_NAME(sectname__)[] = {
364#define STATS_NAME(sectname__, entry__) \
365 { offsetof(STATS_SECT_DECL(sectname__), entry__), #entry__ },
367#define STATS_NAME_END(sectname__) }
369#define STATS_NAME_INIT_PARMS(name__) \
370 &(STATS_NAME_MAP_NAME(name__)[0]), \
371 (sizeof(STATS_NAME_MAP_NAME(name__)) / sizeof(struct stats_name_map))
375#define STATS_NAME_START(name__)
376#define STATS_NAME(name__, entry__)
377#define STATS_NAME_END(name__)
378#define STATS_NAME_INIT_PARMS(name__) NULL, 0
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa off
Definition: asm-macro-32-bit-gnu.h:17
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
uint8_t s_size
Definition: stats.h:68
uint16_t s_cnt
Definition: stats.h:69
const char * s_name
Definition: stats.h:67
uint8_t s_pad1
Definition: stats.h:70
struct stats_hdr * s_next
Definition: stats.h:75
const char * snm_name
Definition: stats.h:63
uint16_t snm_off
Definition: stats.h:62
static int cur
Definition: timeout_order.c:16