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)
168#define STATS_SET(group__, var__, n__) \
169 ((group__).var__ = (n__))
180#define STATS_CLEAR(group__, var__) \
181 ((group__).var__ = 0)
183#define STATS_SIZE_16 (sizeof(uint16_t))
184#define STATS_SIZE_32 (sizeof(uint32_t))
185#define STATS_SIZE_64 (sizeof(uint64_t))
187#define STATS_SIZE_INIT_PARMS(group__, size__) \
189 ((sizeof(group__)) - sizeof(struct stats_hdr)) / (size__)
205#define STATS_INIT_AND_REG(group__, size__, name__) \
206 stats_init_and_reg( \
209 (sizeof(group__) - sizeof(struct stats_hdr)) / (size__), \
210 STATS_NAME_INIT_PARMS(group__), \
245int stats_register(
const char *name,
struct stats_hdr *shdr);
294typedef int stats_walk_fn(
struct stats_hdr *hdr,
void *arg,
307int stats_walk(
struct stats_hdr *hdr, stats_walk_fn *walk_cb,
void *arg);
318typedef int stats_group_walk_fn(
struct stats_hdr *hdr,
void *arg);
329int stats_group_walk(stats_group_walk_fn *walk_cb,
void *arg);
350struct stats_hdr *stats_group_find(
const char *name);
354#define STATS_SECT_START(group__) \
355 STATS_SECT_DECL(group__) {
357#define STATS_SECT_ENTRY(var__)
358#define STATS_SECT_ENTRY16(var__)
359#define STATS_SECT_ENTRY32(var__)
360#define STATS_SECT_ENTRY64(var__)
361#define STATS_RESET(var__)
362#define STATS_SIZE_INIT_PARMS(group__, size__)
363#define STATS_INCN(group__, var__, n__)
364#define STATS_INC(group__, var__)
365#define STATS_SET(group__, var__)
366#define STATS_CLEAR(group__, var__)
367#define STATS_INIT_AND_REG(group__, size__, name__) (0)
371#ifdef CONFIG_STATS_NAMES
373#define STATS_NAME_MAP_NAME(sectname__) stats_map_ ## sectname__
375#define STATS_NAME_START(sectname__) \
376 static const struct stats_name_map STATS_NAME_MAP_NAME(sectname__)[] = {
378#define STATS_NAME(sectname__, entry__) \
379 { offsetof(STATS_SECT_DECL(sectname__), entry__), #entry__ },
381#define STATS_NAME_END(sectname__) }
383#define STATS_NAME_INIT_PARMS(name__) \
384 &(STATS_NAME_MAP_NAME(name__)[0]), \
385 (sizeof(STATS_NAME_MAP_NAME(name__)) / sizeof(struct stats_name_map))
389#define STATS_NAME_START(name__)
390#define STATS_NAME(name__, entry__)
391#define STATS_NAME_END(name__)
392#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:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
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