|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | DEBUG_OWNERSHIP (1) |
|
#define | MACH_DEPTH(mach) (mach->ma_rec.ar_label_nr) |
|
#define | M0_ADDB2_ADD(id, ...) |
|
#define | M0_ADDB2_PUSH(id, ...) |
|
#define | M0_ADDB2_OBJ(obj) ((sizeof *(obj))/sizeof(uint64_t)), (uint64_t *)(obj) |
|
#define | M0_ADDB2_IN(id, stmnt, ...) |
|
#define | M0_ADDB2__PLUGIN_FUNC_NAME "m0_addb2_load_interps" |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_ADDB2_TIMED_0(id, datum, ...) |
|
#define | M0_ADDB2_TIMED(id, counter, datum, ...) |
|
#define | DOM "./_addb2-dump_%d" |
|
#define | COUNTER &counter, &skip, &skip, &skip, &skip, &skip, &skip |
|
#define | FID &fid, &skip |
|
#define | TIMED &duration, &sym |
|
#define | HIST |
|
#define | SKIP2 &skip, &skip |
|
#define | U64 "%16"PRIx64 |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | SYS() (m0_addb2_module_get()->am_sys) |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_ADDB2_HIST(id, hist, datum, ...) |
|
#define | HEADER_XO(h) |
|
#define | TRACE_XO(t) |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
|
#define | VAL(id, ...) |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT |
|
|
enum | {
BUFFER_SIZE = 64 * 1024,
BUFFER_MIN = 4,
BUFFER_MAX = 2 * (FRAME_SIZE_MAX / BUFFER_SIZE + 1),
TAG_MASK = 0xff00000000000000ull,
SENSOR_THRESHOLD = 4 * BUFFER_SIZE / 5
} |
|
enum | { PUSH = 0x10,
POP = 0xf0,
DATA = 0x20,
SENSOR = 0x30
} |
|
enum | { M0_ADDB2__EXT_RANGE_1 = 0x0010000,
M0_ADDB2__EXT_RANGE_2 = 0x0020000,
M0_ADDB2__EXT_RANGE_3 = 0x0030000,
M0_ADDB2__EXT_RANGE_4 = 0x0040000
} |
|
enum | { M0_ADDB2__FIELD_MAX = 15
} |
|
enum | { M0_ADDB2_LABEL_MAX = 64
} |
|
enum | { M0_ADDB2_COUNTER_VALS
} |
|
enum | { BUF_SIZE = 4096,
PLUGINS_MAX = 64
} |
|
enum | { M0_ADDB2_HIST_BUCKETS = 2 * (VALUE_MAX_NR - M0_ADDB2_COUNTER_VALS - 2)
} |
|
enum | m0_addb2_value_id {
M0_AVI_NULL,
M0_AVI_GENERAL_RANGE_START = 0x1000,
M0_AVI_NODE,
M0_AVI_PID,
M0_AVI_CLOCK,
M0_AVI_FOM_RANGE_START = 0x2000,
M0_AVI_LOCALITY,
M0_AVI_THREAD,
M0_AVI_SERVICE,
M0_AVI_FOM,
M0_AVI_PHASE,
M0_AVI_STATE,
M0_AVI_STATE_COUNTER,
M0_AVI_STATE_COUNTER_END = M0_AVI_STATE_COUNTER + 0x100,
M0_AVI_FOM_DESCR,
M0_AVI_FOM_ACTIVE,
M0_AVI_FOM_TO_BULK,
M0_AVI_FOM_TO_TX,
M0_AVI_FOM_TO_STIO,
M0_AVI_RUNQ,
M0_AVI_WAIL,
M0_AVI_AST,
M0_AVI_FOM_CB,
M0_AVI_CHORE,
M0_AVI_LOCALITY_FORQ_DURATION,
M0_AVI_LOCALITY_FORQ,
M0_AVI_LOCALITY_CHAN_WAIT,
M0_AVI_LOCALITY_CHAN_CB,
M0_AVI_LOCALITY_CHAN_QUEUE,
M0_AVI_LONG_LOCK,
M0_AVI_ATTR,
M0_AVI_LIB_RANGE_START = 0x3000,
M0_AVI_ALLOC,
M0_AVI_RM_RANGE_START = 0x4000,
M0_AVI_M0T1FS_RANGE_START = 0x5000,
M0_AVI_IOS_RANGE_START = 0x6000,
M0_AVI_STOB_RANGE_START = 0x7000,
M0_AVI_RPC_RANGE_START = 0x8000,
M0_AVI_ADDB2_RANGE_START = 0x9000,
M0_AVI_BE_RANGE_START = 0xa000,
M0_AVI_NET_RANGE_START = 0xb000,
M0_AVI_CAS_RANGE_START = 0xc000,
M0_AVI_CLIENT_RANGE_START = 0xd000,
M0_AVI_DIX_RANGE_START = 0xe000,
M0_AVI_KEM_RANGE_START = 0xf000,
M0_AVI_DTM0_RANGE_START = 0xf200,
M0_AVI_EXTERNAL_RANGE_1 = M0_ADDB2__EXT_RANGE_1,
M0_AVI_EXTERNAL_RANGE_2 = M0_ADDB2__EXT_RANGE_2,
M0_AVI_EXTERNAL_RANGE_3 = M0_ADDB2__EXT_RANGE_3,
M0_AVI_EXTERNAL_RANGE_4 = M0_ADDB2__EXT_RANGE_4,
M0_AVI_FOP_TYPES_RANGE_START = 0x1000000,
M0_AVI_FOP_TYPES_RANGE_END = 0x1ffffff,
M0_AVI_SIT,
M0_AVI_LAST,
M0_AVI_NODATA = 0x00ffffffffffffffull
} |
|
enum | { VALUE_MAX_NR = 15,
FRAME_TRACE_MAX = 128,
FRAME_SIZE_MAX = 4 * 1024 * 1024
} |
|
enum | storage_constants { BSHIFT = 16,
BSIZE = M0_BITS(BSHIFT)
} |
|
enum | { M0_ADDB2_GLOBAL_PHILTERS = 512
} |
|
enum | { ADDB2_CONSUME = M0_FOM_PHASE_INIT,
ADDB2_DONE = M0_FOM_PHASE_FINISH,
ADDB2_SUBMIT
} |
|
enum | { MAX_INFLIGHT = 8,
IO_FRAG = 2
} |
|
enum | { M0_ADDB2_STOB_KEY = 2
} |
|
enum | m0_addb2_frame_header_format_version { M0_ADDB2_FRAME_HEADER_FORMAT_VERSION_1 = 1,
M0_ADDB2_FRAME_HEADER_FORMAT_VERSION = M0_ADDB2_FRAME_HEADER_FORMAT_VERSION_1
} |
|
enum | { N = 17
} |
|
|
| M0_BASSERT (BUFFER_SIZE > M0_ADDB2_LABEL_MAX *3 *sizeof(uint64_t)) |
|
| M0_TL_DESCR_DEFINE (tr, "addb2 traces", M0_INTERNAL, struct m0_addb2_trace_obj, o_linkage, o_magix, M0_ADDB2_TRACE_MAGIC, M0_ADDB2_TRACE_HEAD_MAGIC) |
|
| M0_TL_DEFINE (tr, M0_INTERNAL, struct m0_addb2_trace_obj) |
|
| M0_TL_DESCR_DEFINE (buf, "addb2 buffers", static, struct buffer, b_linkage, b_magix, M0_ADDB2_BUF_MAGIC, M0_ADDB2_BUF_HEAD_MAGIC) |
|
| M0_TL_DEFINE (buf, static, struct buffer) |
|
| M0_TL_DESCR_DEFINE (sensor, "addb2 sensors", static, struct m0_addb2_sensor, s_linkage, s_magix, M0_ADDB2_SENSOR_MAGIC, M0_ADDB2_SENSOR_HEAD_MAGIC) |
|
| M0_TL_DEFINE (sensor, static, struct m0_addb2_sensor) |
|
| M0_TL_DESCR_DEFINE (mach, "addb2 machines", M0_INTERNAL, struct m0_addb2_mach, ma_linkage, ma_magix, M0_ADDB2_MACH_MAGIC, M0_ADDB2_MACH_HEAD_MAGIC) |
|
| M0_TL_DEFINE (mach, M0_INTERNAL, struct m0_addb2_mach) |
|
static int | buffer_alloc (struct m0_addb2_mach *mach) |
|
static void | buffer_fini (struct buffer *buffer) |
|
static m0_bcount_t | buffer_space (const struct buffer *buffer) |
|
static void | buffer_add (struct buffer *buf, uint64_t datum) |
|
static struct buffer * | mach_buffer (struct m0_addb2_mach *mach) |
|
static struct tentry * | mach_top (struct m0_addb2_mach *m) |
|
static struct buffer * | cur (struct m0_addb2_mach *mach, m0_bcount_t space) |
|
static struct m0_addb2_mach * | mach (void) |
|
static void | mach_put (struct m0_addb2_mach *m) |
|
static void | mach_idle (struct m0_addb2_mach *m) |
|
static void | add (struct m0_addb2_mach *mach, uint64_t id, int n, const uint64_t *value) |
|
static void | pack (struct m0_addb2_mach *mach) |
|
static uint64_t | tag (uint8_t code, uint64_t id) |
|
static void | sensor_place (struct m0_addb2_mach *m, struct m0_addb2_sensor *s) |
|
static void | record_consume (struct m0_addb2_mach *m, uint64_t id, int n, const uint64_t *value) |
|
static bool | trace_invariant (const struct m0_addb2_trace *tr) |
|
void | m0_addb2_push (uint64_t id, int n, const uint64_t *value) |
|
void | m0_addb2_pop (uint64_t id) |
|
void | m0_addb2_add (uint64_t id, int n, const uint64_t *value) |
|
void | m0_addb2_sensor_add (struct m0_addb2_sensor *s, uint64_t id, unsigned nr, int idx, const struct m0_addb2_sensor_ops *ops) |
|
void | m0_addb2_sensor_del (struct m0_addb2_sensor *s) |
|
struct m0_addb2_mach * | m0_addb2_mach_init (const struct m0_addb2_mach_ops *ops, void *cookie) |
|
void | m0_addb2_mach_fini (struct m0_addb2_mach *mach) |
|
void | m0_addb2_force (m0_time_t delay) |
|
static int | addb2_force_loc_cb (void *unused) |
|
static void | addb2_force_loc (struct m0_locality *loc) |
|
void | m0_addb2_force_all (void) |
|
void | m0_addb2_mach_stop (struct m0_addb2_mach *mach) |
|
void | m0_addb2_mach_wait (struct m0_addb2_mach *mach) |
|
void * | m0_addb2_mach_cookie (const struct m0_addb2_mach *mach) |
|
void | m0_addb2_trace_done (const struct m0_addb2_trace *ctrace) |
|
struct m0_addb2_source * | m0_addb2_mach_source (struct m0_addb2_mach *m) |
|
M0_INTERNAL m0_bcount_t | m0_addb2_trace_size (const struct m0_addb2_trace *trace) |
|
void | m0_addb2_cursor_init (struct m0_addb2_cursor *cur, const struct m0_addb2_trace *trace) |
|
void | m0_addb2_cursor_fini (struct m0_addb2_cursor *cur) |
|
int | m0_addb2_cursor_next (struct m0_addb2_cursor *cur) |
|
M0_INTERNAL struct m0_addb2_module * | m0_addb2_module_get (void) |
|
int | m0_addb2_module_init (void) |
|
void | m0_addb2_module_fini (void) |
|
M0_INTERNAL void | m0_addb2__mach_print (const struct m0_addb2_mach *m) |
|
struct m0_addb2_trace | M0_XCA_DOMAIN (rpc) |
|
| M0_TL_DESCR_DEFINE (philter, "addb2 source philters", static, struct m0_addb2_philter, ph_linkage, ph_magix, M0_ADDB2_PHILTER_MAGIC, M0_ADDB2_PHILTER_HEAD_MAGIC) |
|
| M0_TL_DEFINE (philter, static, struct m0_addb2_philter) |
|
| M0_TL_DESCR_DEFINE (callback, "addb2 philter callbacks", static, struct m0_addb2_callback, ca_linkage, ca_magix, M0_ADDB2_CALLBACK_MAGIC, M0_ADDB2_CALLBACK_HEAD_MAGIC) |
|
| M0_TL_DEFINE (callback, static, struct m0_addb2_callback) |
|
static bool | true_matches (struct m0_addb2_philter *philter, const struct m0_addb2_record *rec) |
|
static bool | id_matches (struct m0_addb2_philter *philter, const struct m0_addb2_record *rec) |
|
void | m0_addb2_source_init (struct m0_addb2_source *src) |
|
void | m0_addb2_source_fini (struct m0_addb2_source *src) |
|
void | m0_addb2_philter_init (struct m0_addb2_philter *philter, bool(*matches)(struct m0_addb2_philter *, const struct m0_addb2_record *), void *datum) |
|
void | m0_addb2_philter_fini (struct m0_addb2_philter *philter) |
|
void | m0_addb2_philter_add (struct m0_addb2_source *src, struct m0_addb2_philter *ph) |
|
void | m0_addb2_philter_del (struct m0_addb2_philter *ph) |
|
void | m0_addb2_callback_init (struct m0_addb2_callback *callback, void(*fire)(const struct m0_addb2_source *, const struct m0_addb2_philter *, const struct m0_addb2_callback *, const struct m0_addb2_record *), void *datum) |
|
void | m0_addb2_callback_fini (struct m0_addb2_callback *callback) |
|
void | m0_addb2_callback_add (struct m0_addb2_philter *ph, struct m0_addb2_callback *callback) |
|
void | m0_addb2_callback_del (struct m0_addb2_callback *callback) |
|
struct m0_addb2_source * | m0_addb2_cursor_source (struct m0_addb2_cursor *c) |
|
static void | philter_consume (struct m0_addb2_source *src, struct m0_addb2_philter *ph, const struct m0_addb2_record *rec) |
|
void | m0_addb2_consume (struct m0_addb2_source *src, const struct m0_addb2_record *rec) |
|
void | m0_addb2_philter_true_init (struct m0_addb2_philter *ph) |
|
void | m0_addb2_philter_id_init (struct m0_addb2_philter *ph, uint64_t id) |
|
void | m0_addb2_philter_global_add (struct m0_addb2_philter *ph) |
|
void | m0_addb2_philter_global_del (struct m0_addb2_philter *ph) |
|
static void | counter_warn (struct m0_addb2_counter *c, uint64_t val) |
|
static void | counter_dtor (void *area, void *datum) |
|
static int | counter_ctor (void *area, void *datum) |
|
void | m0_addb2_counter_add (struct m0_addb2_counter *counter, uint64_t label, int idx) |
|
void | m0_addb2_counter_del (struct m0_addb2_counter *counter) |
|
void | m0_addb2_counter_mod (struct m0_addb2_counter *counter, int64_t val) |
|
void | m0_addb2_counter_mod_with (struct m0_addb2_counter *counter, int64_t val, uint64_t datum) |
|
void | m0_addb2_list_counter_add (struct m0_addb2_list_counter *counter, struct m0_tl *list, uint64_t label, int idx) |
|
void | m0_addb2_list_counter_del (struct m0_addb2_list_counter *counter) |
|
void | m0_addb2_clock_add (struct m0_addb2_sensor *clock, uint64_t label, int idx) |
|
void | m0_addb2_clock_del (struct m0_addb2_sensor *clock) |
|
int | m0_addb2_local_counter_init (struct m0_addb2_local_counter *lc, uint64_t id, uint64_t counter) |
|
void | m0_addb2_local_counter_mod (struct m0_addb2_local_counter *lc, uint64_t val, uint64_t datum) |
|
M0_INTERNAL void | m0_addb2__counter_snapshot (struct m0_addb2_sensor *s, uint64_t *area) |
|
static void | counter_fini (struct m0_addb2_sensor *s) |
|
M0_INTERNAL void | m0_addb2__counter_data_init (struct m0_addb2_counter_data *d) |
|
static void | list_counter_snapshot (struct m0_addb2_sensor *s, uint64_t *area) |
|
static void | clock_counter_snapshot (struct m0_addb2_sensor *s, uint64_t *area) |
|
static void | id_init (void) |
|
static void | id_fini (void) |
|
static void | id_set (struct m0_addb2__id_intrp *intrp) |
|
static void | id_set_nr (struct m0_addb2__id_intrp *intrp, int nr) |
|
static struct m0_addb2__id_intrp * | id_get (uint64_t id) |
|
static void | rec_dump (struct m0_addb2__context *ctx, const struct m0_addb2_record *rec) |
|
static void | val_dump (struct m0_addb2__context *ctx, const char *prefix, const struct m0_addb2_value *val, int indent, bool cr) |
|
static void | context_fill (struct m0_addb2__context *ctx, const struct m0_addb2_value *val) |
|
static void | file_dump (struct m0_stob_domain *dom, const char *fname, const uint64_t start_time, const uint64_t stop_time) |
|
static int | plugin_load (struct plugin *plugin) |
|
static void | plugin_unload (struct plugin *plugin) |
|
static int | plugins_load (void) |
|
static void | plugins_unload (void) |
|
static void | libbfd_init (const char *libpath) |
|
static void | libbfd_fini (void) |
|
static void | libbfd_resolve (uint64_t delta, char *buf) |
|
static void | flate (void) |
|
static void | deflate (void) |
|
static void | misc_init (void) |
|
static void | misc_fini (void) |
|
void | m0_dix_cm_repair_cpx_init (void) |
|
void | m0_dix_cm_repair_cpx_fini (void) |
|
void | m0_dix_cm_rebalance_cpx_init (void) |
|
void | m0_dix_cm_rebalance_cpx_fini (void) |
|
static int | plugin_add (const char *path) |
|
int | main (int argc, char **argv) |
| Test server for m0console. More...
|
|
static bool | intrps_equal (const struct m0_addb2__id_intrp *intrp0, const struct m0_addb2__id_intrp *intrp1) |
|
static void | dec (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | hex (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | hex0x (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | oct (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | ptr (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | bol (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | fid (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | skip (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | _clock (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | duration (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | fom_type (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | sm_state (const struct m0_sm_conf *conf, struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | fom_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | fom_phase (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | rpcop (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | sym (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | counter (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | hbar (char *buf, uint32_t val, uint32_t m) |
|
static void | hist (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | sm_trans (const struct m0_sm_conf *conf, const char *name, struct m0_addb2__context *ctx, char *buf) |
|
static void | fom_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | fop_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | rpc_in (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | rpc_out (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | tx_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | dtx0_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | tx_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | dtx0_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | beop_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | op_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | dix_op_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | dix_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | cas_op_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | cas_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | ioo_req_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | ioo_state_counter (struct m0_addb2__context *ctx, char *buf) |
|
static void | cob_req_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | bulk_op_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | stob_io_req_state (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static void | attr (struct m0_addb2__context *ctx, const uint64_t *v, char *buf) |
|
static int | pad (int indent) |
|
static unsigned int | count_nonempty_vals (const struct m0_addb2_value *val) |
|
static void | val_dump_json (struct m0_addb2__context *ctx, const struct m0_addb2_value *val, bool output_timestamp) |
|
static void | val_dump_plaintext (struct m0_addb2__context *ctx, const char *prefix, const struct m0_addb2_value *val, int indent, bool cr) |
|
static int | asymbol_cmp (const void *a0, const void *a1) |
|
M0_INTERNAL void | m0_addb2_global_thread_enter (void) |
|
M0_INTERNAL void | m0_addb2_global_thread_leave (void) |
|
M0_INTERNAL int | m0_addb2_global_init (void) |
|
M0_INTERNAL void | m0_addb2_global_fini (void) |
|
M0_INTERNAL struct m0_addb2_sys * | m0_addb2_global_get (void) |
|
void | m0_addb2_hist_add (struct m0_addb2_hist *hist, int64_t min, int64_t max, uint64_t label, int idx) |
|
void | m0_addb2_hist_add_auto (struct m0_addb2_hist *hist, int skip, uint64_t label, int idx) |
|
void | m0_addb2_hist_del (struct m0_addb2_hist *hist) |
|
void | m0_addb2_hist_mod (struct m0_addb2_hist *hist, int64_t val) |
|
void | m0_addb2_hist_mod_with (struct m0_addb2_hist *hist, int64_t val, uint64_t datum) |
|
int | m0_addb2_hist_bucket (const struct m0_addb2_hist *hist, int64_t val) |
|
static void | hist_snapshot (struct m0_addb2_sensor *s, uint64_t *area) |
|
static void | hist_fini (struct m0_addb2_sensor *s) |
|
| M0_BASSERT (M0_ADDB2_HIST_BUCKETS >=2) |
|
| M0_TL_DESCR_DECLARE (tr, M0_EXTERN) |
|
| M0_TL_DECLARE (tr, M0_INTERNAL, struct m0_addb2_trace_obj) |
|
| M0_TL_DESCR_DECLARE (mach, M0_EXTERN) |
|
| M0_TL_DECLARE (mach, M0_INTERNAL, struct m0_addb2_mach) |
|
M0_INTERNAL struct m0_addb2_storage * | m0_addb2_storage_init (const char *location, uint64_t key, bool mkfs, bool force, const struct m0_addb2_storage_ops *ops, m0_bcount_t size, void *cookie) |
|
M0_INTERNAL int | m0_addb2_storage_submit (struct m0_addb2_storage *stor, struct m0_addb2_trace_obj *obj) |
|
M0_INTERNAL void * | m0_addb2_storage_cookie (const struct m0_addb2_storage *stor) |
|
M0_INTERNAL void | m0_addb2_storage_fini (struct m0_addb2_storage *stor) |
|
M0_INTERNAL void | m0_addb2_storage_stop (struct m0_addb2_storage *stor) |
|
M0_INTERNAL bool | m0_addb2_storage__is_not_locked (const struct m0_addb2_storage *stor) |
|
| M0_TL_DESCR_DEFINE (src, "addb2 rpc sources", static, struct source, s_linkage, s_magix, M0_ADDB2_SOURCE_MAGIC, M0_ADDB2_SOURCE_HEAD_MAGIC) |
|
| M0_TL_DEFINE (src, static, struct source) |
|
static void | src_fini (struct source *s) |
|
static void | net_lock (struct m0_addb2_net *net) |
|
static void | net_unlock (struct m0_addb2_net *net) |
|
static void | net_force (struct m0_addb2_net *net) |
|
static void | net_sent (struct m0_rpc_item *item) |
|
static bool | net_invariant (const struct m0_addb2_net *net) |
|
static void | net_fop_init (struct m0_fop *fop, struct m0_addb2_net *net, struct m0_addb2_trace *trace) |
|
static bool | src_has_item (const struct m0_rpc_item_source *ris) |
|
static void | src_conn_terminating (struct m0_rpc_item_source *ris) |
|
static struct m0_rpc_item * | src_get_item (struct m0_rpc_item_source *ris, m0_bcount_t size) |
|
M0_INTERNAL struct m0_addb2_net * | m0_addb2_net_init (void) |
|
M0_INTERNAL void | m0_addb2_net_fini (struct m0_addb2_net *net) |
|
M0_INTERNAL int | m0_addb2_net_add (struct m0_addb2_net *net, struct m0_rpc_conn *conn) |
|
M0_INTERNAL void | m0_addb2_net_del (struct m0_addb2_net *net, struct m0_rpc_conn *conn) |
|
M0_INTERNAL int | m0_addb2_net_submit (struct m0_addb2_net *net, struct m0_addb2_trace_obj *obj) |
|
M0_INTERNAL void | m0_addb2_net_tick (struct m0_addb2_net *net) |
|
M0_INTERNAL void | m0_addb2_net_stop (struct m0_addb2_net *net, void(*callback)(struct m0_addb2_net *, void *), void *datum) |
|
M0_INTERNAL bool | m0_addb2_net__is_not_locked (const struct m0_addb2_net *net) |
|
M0_INTERNAL int | m0_addb2_net_module_init (void) |
|
M0_INTERNAL void | m0_addb2_net_module_fini (void) |
|
int | m0_addb2_load_interps (uint64_t flags, struct m0_addb2__id_intrp **intrp) |
|
static int | addb2_service_start (struct m0_reqh_service *service) |
|
static void | addb2_service_stop (struct m0_reqh_service *service) |
|
static void | addb2_service_fini (struct m0_reqh_service *service) |
|
static void | addb2_done (struct m0_addb2_trace_obj *obj) |
|
static size_t | addb2_fom_home_locality (const struct m0_fom *fom) |
|
static int | addb2_service_type_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype) |
|
M0_INTERNAL int | m0_addb2_service_module_init (void) |
|
M0_INTERNAL void | m0_addb2_service_module_fini (void) |
|
static int | addb2_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh) |
|
static int | addb2_fom_tick (struct m0_fom *fom0) |
|
static void | addb2_fom_fini (struct m0_fom *fom0) |
|
static bool | header_is_valid (const struct m0_addb2_sit *it, const struct m0_addb2_frame_header *h) |
|
static int | it_init (struct m0_addb2_sit *it, struct m0_addb2_frame_header *h, m0_bindex_t start) |
|
static int | it_alloc (struct m0_addb2_sit *it, struct m0_stob *stob) |
|
static void | it_free (struct m0_addb2_sit *it) |
|
static int | it_next (struct m0_addb2_sit *it, struct m0_addb2_record **out) |
|
static void | it_rec (struct m0_addb2_sit *it, struct m0_addb2_record **out) |
|
static int | it_load (struct m0_addb2_sit *it) |
|
static int | it_read (const struct m0_addb2_sit *it, void *buf, m0_bindex_t offset, m0_bcount_t count) |
|
static bool | it_rounded (const struct m0_addb2_sit *it, m0_bindex_t index) |
|
static bool | it_is_in (const struct m0_addb2_sit *it, m0_bindex_t index) |
|
static bool | it_invariant (const struct m0_addb2_sit *it) |
|
static void | it_trace_set (struct m0_addb2_sit *it) |
|
static int | header_read (struct m0_addb2_sit *it, struct m0_addb2_frame_header *h, m0_bindex_t offset) |
|
static m0_bindex_t | header_next (const struct m0_addb2_sit *it, const struct m0_addb2_frame_header *h) |
|
int | m0_addb2_sit_init (struct m0_addb2_sit **out, struct m0_stob *stob, m0_bindex_t start) |
|
void | m0_addb2_sit_fini (struct m0_addb2_sit *it) |
|
int | m0_addb2_sit_next (struct m0_addb2_sit *it, struct m0_addb2_record **out) |
|
struct m0_addb2_source * | m0_addb2_sit_source (struct m0_addb2_sit *it) |
|
M0_INTERNAL int | m0_addb2_storage_header (struct m0_stob *stob, struct m0_addb2_frame_header *h) |
|
| M0_TL_DESCR_DEFINE (frame, "addb2 frames", static, struct frame, f_linkage, f_magix, M0_ADDB2_FRAME_MAGIC, M0_ADDB2_FRAME_HEAD_MAGIC) |
|
| M0_TL_DEFINE (frame, static, struct frame) |
|
static bool | trace_tryadd (struct m0_addb2_storage *stor, struct m0_addb2_trace *trace) |
|
static bool | trace_fits (const struct frame *frame, const struct m0_addb2_trace *trace) |
|
static void | trace_add (struct frame *frame, struct m0_addb2_trace *trace) |
|
static int | frame_init (struct frame *frame, struct m0_addb2_storage *stor) |
|
static void | frame_fini (struct frame *frame) |
|
static void | frame_clear (struct frame *frame) |
|
static void | frame_submit (struct frame *frame) |
|
static void | frame_idle (struct frame *frame) |
|
static void | frame_done (struct frame *frame) |
|
static int | frame_try (struct frame *frame) |
|
static void | frame_io_pack (struct frame *frame) |
|
static void | frame_io_open (struct frame *frame) |
|
static bool | frame_invariant (const struct frame *frame) |
|
static bool | frame_endio (struct m0_clink *link) |
|
static struct frame * | frame_cur (const struct m0_addb2_storage *stor) |
|
static bool | stor_invariant (const struct m0_addb2_storage *stor) |
|
static void | stor_fini (struct m0_addb2_storage *stor) |
|
static void | stor_balance (struct m0_addb2_storage *stor, int delta) |
|
static void | stor_drain (struct m0_addb2_storage *stor) |
|
static void | stor_update (struct m0_addb2_storage *stor, const struct m0_addb2_frame_header *header) |
|
static m0_bindex_t | stor_round (const struct m0_addb2_storage *stor, m0_bindex_t index) |
|
static bool | stor_rounded (const struct m0_addb2_storage *stor, m0_bindex_t index) |
|
static int | stor_dom_init (struct m0_addb2_storage *stor, const char *location, uint64_t key, bool mkfs, bool force) |
|
static void | stor_dom_fini (struct m0_addb2_storage *stor) |
|
static int | stor_stob_init (struct m0_addb2_storage *stor, uint64_t key) |
|
static void | stor_stob_fini (struct m0_addb2_storage *stor) |
|
static void | sys_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
|
static void | sys_post (struct m0_addb2_sys *sys) |
|
static void | sys_idle (struct m0_addb2_mach *mach) |
|
static void | sys_lock (struct m0_addb2_sys *sys) |
|
static void | sys_unlock (struct m0_addb2_sys *sys) |
|
static void | sys_qlock (struct m0_addb2_sys *sys) |
|
static void | sys_qunlock (struct m0_addb2_sys *sys) |
|
static void | sys_balance (struct m0_addb2_sys *sys) |
|
static bool | sys_invariant (const struct m0_addb2_sys *sys) |
|
static bool | sys_queue_invariant (const struct m0_addb2_sys *sys) |
|
static int | sys_submit (struct m0_addb2_mach *mach, struct m0_addb2_trace_obj *obj) |
|
static void | net_idle (struct m0_addb2_net *net, void *datum) |
|
static void | net_stop (struct m0_addb2_sys *sys) |
|
static void | stor_stop (struct m0_addb2_sys *sys) |
|
static m0_bcount_t | sys_size (const struct m0_addb2_sys *sys) |
|
int | m0_addb2_sys_init (struct m0_addb2_sys **out, const struct m0_addb2_config *conf) |
|
void | m0_addb2_sys_fini (struct m0_addb2_sys *sys) |
|
struct m0_addb2_mach * | m0_addb2_sys_get (struct m0_addb2_sys *sys) |
|
void | m0_addb2_sys_put (struct m0_addb2_sys *sys, struct m0_addb2_mach *m) |
|
int | m0_addb2_sys_net_start (struct m0_addb2_sys *sys) |
|
void | m0_addb2_sys_net_stop (struct m0_addb2_sys *sys) |
|
int | m0_addb2_sys_net_start_with (struct m0_addb2_sys *sys, struct m0_tl *head) |
|
int | m0_addb2_sys_stor_start (struct m0_addb2_sys *sys, const char *location, uint64_t key, bool mkfs, bool force, m0_bcount_t size) |
|
void | m0_addb2_sys_stor_stop (struct m0_addb2_sys *sys) |
|
void | m0_addb2_sys_sm_start (struct m0_addb2_sys *sys) |
|
void | m0_addb2_sys_sm_stop (struct m0_addb2_sys *sys) |
|
int | m0_addb2_sys_submit (struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj) |
|
void | m0_addb2_sys_attach (struct m0_addb2_sys *sys, struct m0_addb2_sys *src) |
|
void | m0_addb2_sys_detach (struct m0_addb2_sys *sys) |
|
void | m0_addb2_sys_counter_add (struct m0_addb2_sys *sys, struct m0_addb2_counter *counter, uint64_t id) |
|
static void | stor_idle (struct m0_addb2_storage *stor) |
|
struct m0_addb2_mach * | mach_set (int(*s)(const struct m0_addb2_mach *, struct m0_addb2_trace *)) |
|
void | mach_fini (struct m0_addb2_mach *m) |
|
int | fill_one (struct m0_addb2_mach *m) |
|
bool | valeq (const struct m0_addb2_value *v0, const struct m0_addb2_value *v1) |
|
bool | receq (const struct m0_addb2_record *r0, const struct small_record *r1) |
|
static void | init_fini (void) |
|
static void | mach_1 (void) |
|
static void | mach_toomany (void) |
|
static void | mach_cache (void) |
|
static void | mach_cache_N (void) |
|
static void | _add (const struct m0_addb2_config *conf, unsigned nr) |
|
static void | add_loop (const struct m0_addb2_config *conf) |
|
static void | noqueue_add (void) |
|
static void | queue_add (void) |
|
static void | submit_trap (struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj) |
|
static void | ast_trap (struct m0_addb2_sys *sys) |
|
static void | sm_add (void) |
|
Temporary note
addb2 is a new implementation of addb sub-system. It has simpler external interface, simpler and smaller implementation. For the time being, addb and addb2 co-exist. Both versions send data over the network and store it separately. Gradually, existing addb users will be converted to addb2. Once the conversion is finished, addb implementation will be removed and addb2 renamed to addb throughout. Then, this note will also be removed.
Overview
"ADDB" stands for "Analytic and Diagnostic Data-Base". Purpose of addb2 sub-system is to collect information about system behaviour for online and offline analysis. For the purpose of addb2 design description, the following components are identified:
* PRODUCER is a part of system that produces addb2 records to describe
its behaviour. Motr sub-system becomes a PRODUCER after it is
instrumented with addb2 calls. addb2 is itself a PRODUCER;
* CONSUMER is a part of system that is interested in learning about
system behaviour through addb2. There are two classes of CONSUMERS:
- online (or synchronous) CONSUMER gets addb2 records as soon as they
are produced,
- offline (or asynchronous) CONSUMER gets addb2 records possibly much
later;
* IMPLEMENTATION is the addb2 sub-system itself (the code is in addb2/
sub-directory). IMPLEMENTATION accepts records from PRODUCERS and
delivers them to CONSUMERS;
* SYSTEM is a code outside of addb2, which configures addb2 and specifies
how addb2 records flow across the network and where they are stored for
offline consumption.
All addb2 records have the same structure: a record (struct m0_addb2_record) is a "measurement", tagged with a set of "labels". Measurements and labels have the same structure, described by struct m0_addb2_value: a 56-bit identifier, plus a time-stamp, plus a (variable up to 15, possibly 0) number of 64-bit data items, called "payload". To give a fictitious, but realistic example of a record:
* | IDENTIFIER TIMESTAMP PAYLOAD[0] PAYLOAD[1] ...
* ------------+------------------------------------------------------------
* MEASUREMENT | IO_WAIT_TIME 851263.911 5117216ns
* LABEL-6 | DEVICE_FID 849265.721 7 200
* LABEL-5 | FOP_OBJ_FID 842124.732 10 23213
* LABEL-4 | CLIENT_ID 842124.732 404
* LABEL-3 | FOP_OP_CODE 842124.732 COB_READ
* LABEL-2 | SERVICE 15216.215 IOSERVICE
* LABEL-1 | CPU_CORE 521.100 3
* LABEL-0 | NODE_ID 100.321 20
*
Labels describe the context, in which the measurement occurred. In this case the context is a read operation on a device with the fid (7, 200), which is part of a read operation on a cob with fid (10, 23213), sent by a client 404 to the ioservice on the server 20 and handled on the 3rd core.
The measurement itself is read operation latency: 5117216ns.
Time-stamps (in nanoseconds) record the time when the measurement was taken or the context was entered.
Measurements can be produced in two ways:
- one-time measurements, like above, explicitly added by m0_addb2_add()
call;
- continuous measurements, produced by "sensors" (m0_addb2_sensor).
IMPLEMENTATION periodically reads the sensors associated with the
context.
Examples (sans time-stamps) of records produced by a sensor would be
* | IDENTIFIER PAYLOAD[0] PAYLOAD[1] PAYLOAD[2]
* ------------+---------------------------------------------------------
* MEASUREMENT | FREE_MEMORY 16GB
* LABEL-0 | NODE_ID 20
*
and
* | IDENTIFIER PAYLOAD[0] PAYLOAD[1] PAYLOAD[2]
* ------------+---------------------------------------------------------
* MEASUREMENT | IO_SIZES 4KB 10MB 4MB
* LABEL-0 | DEVICE_FID 7 200
* LABEL-1 | NODE_ID 20
*
In the latter case, data items of IO_SIZES measurement are minimal (4KB), maximal (10MB) and average (4MB) IO sizes for the given device.
IMPLEMENTATION is not interested in semantics of records. It is up to PRODUCERS and CONSUMERS to agree on common values of identifiers and meaning of payloads.
PRODUCER interface
PRODUCER interface is used to submit addb2 records for consumption. An important feature of this interface is a method used to compose contexts (i.e., label sets) for records. This method must be
- flexible: contexts with variable number of labels with different
payloads should be possible;
- modular: sub-systems should be able to contribute to the context
without global coordination. For example, in the IO_WAIT_TIME example
above, DEVICE_FID is added by the stob sub-system, which has no
knowledge about ioservice.
The interface is based on a notion of addb2 "machine" (m0_addb2_mach), which is a locus, where context is incrementally built. A machine keeps track of the current context, maintained as a stack. New label can be added to a context by a call to m0_addb2_push() and the top-most label can be removed by a call to m0_addb2_pop().
A call to m0_addb2_add() adds a one-time measurement in the current context.
A call to m0_addb2_sensor_add() adds sensor in the current context and associates the sensor with the top label in the context. IMPLEMENTATION periodically queries added sensors. A sensor is automatically de-activated when the label the sensor is associated with is popped from the stack.
An addb2 machine cannot, typically, be concurrently used, because concurrent stack manipulations would make context meaningless.
CONSUMER interface
CONSUMER interface is described in addb2/consumer.h
SYSTEM interface
SYSTEM initialises addb2 machines, associates them with threads. It also initialises network (see addb2/net.h) and storage (see addb2/storage.h) components of IMPLEMENTATION.
External entry-points of PRODUCER interface (m0_addb2_push(), m0_addb2_pop(), m0_addb2_add(), m0_addb2_sensor_add(), etc.) all operate on the "current" addb2 machine. IMPLEMENTATION assumes that the pointer to this machine is stored in m0_thread_tls()->tls_addb2_mach (see addb2/addb2.c:mach()). If this pointer is NULL, no operation is performed. It is up to SYSTEM to setup this pointer in some or all threads.
- Note
- Currently, this pointer is set for all threads except for some light-weight short-living threads like ones used to implement soft timers.
Addb2 CONSUMER interface
CONSUMER interface is used to subscribe to a source of addb2 records (m0_addb2_source) and to get notified when matching records are PRODUCED in the source.
There are two types of record sources:
- online consumers use a source embedded in every m0_addb2_mach
(m0_addb2_mach_source()). When a PRODUCER adds a record to the machine,
this record is immediately available through the machine source;
- offline consumers use a source embedded in every storage iterator
(m0_addb2_sit_source()). Depending on the SYSTEM configuration,
produced records end up in one or more stobs (possibly after
transmission over network). In general there are no guarantees about
the stob in which a particular addb2 record will end up. It is up to
the CONSUMER to organise a map-reduce-like search for desirable
records, if necessary.
CONSUMER accesses the records by adding one or more "philters" (m0_addb2_philter) to a source and adding call-backs (m0_addb2_callback) to a philter. A philter has a predicate (m0_addb2_philter::ph_matches()) over records. When a record matching the philter predicate appears in the source, all call-backs associated with the philter are invoked (m0_addb2_callback::ca_fire() is called).
A histogram (m0_addb2_hist) is a type of addb2 sensor behaving similar to counter (m0_addb2_counter) and, in addition, maintaining a set of "buckets", where each bucket records how many times the counter has had a value in the range associated with the bucket.
Whenever histogram is updated with a value (m0_addb2_hist_mod()), usual counter statistics (minimum, maximum, average, dispersion) are updated. In addition, the bucket corresponding to the value is updated too.
As any counter, a histogram is reset whenever it is recorded in the trace buffer. That is, histogram data delivered to addb2 CONSUMERS correspond to the updates to the histigram made since the previous data were delivered.
The number of buckets in a histogram is globally fixed (M0_ADDB2_HIST_BUCKETS).
Distribution of values into buckets is determined by two per-histogram parameters: minimum (m0_addb2_hist_data::hd_min) and maximum (m0_addb2_hist_data::hd_max).
*
* min min + STEP min + 2*STEP min + N*STEP
* | | | |
* .....--------+------------+------------+--.....----------+------------.....
*
* bucket-0 bucket-1 bucket-1 bucket-N bucket-(N+1)
*
*
Where N == M0_ADDB2_HIST_BUCKETS - 2 and STEP == (max - min)/N.
That is the zeroth bucket is for values less than minimum, the first bucket is for values X such that (min <= X && X < min + STEP) and so on up to the last bucket, which contains the values greater than or equal to min + N*STEP.
All calculations are done in integer arithmetic. Because of this, the start of the last bucket (min + N*STEP) can be less than the histogram maximum.
There are two ways to specify minimum and maximum. When a histogram is initialised with m0_addb2_hist_add(), the minimum and maximum are supplied as parameters. This is suitable for situations where reasonable values of these parameters are known in advance.
When a histogram is initialised with m0_addb2_hist_add_auto(), it remains in "auto-tuning" period for the first "skip" updates (where "skip" is a parameter). During auto-tuning, the histogram behaves exactly as a simple counter and doesn't update buckets. When auto-tuning completes, minimum and maximum values seen during auto-tuning are used to setup buckets. From this point on, buckets are updated. This is suitable for situations where distribution of values is now known in advance, e.g., network latencies.
Identifiers list
addb2/identifier.h contains the list of well-known addb2 measurements and label identifiers.
Addb2 network component
Addb2 network engine (m0_addb2_net) accepts abb2 trace buffers, m0_addb2_trace (wrapped in trace buffer objects m0_addb2_trace_obj) for transmission over network to a remote addb2 service.
Traces are opportunistically piggy-backed to the outgoing rpc packets.
On receiving a trace, addb2 service submits the trace for storage, along with other traces produced normally on the remote node.
Addb2 storage
Addb2 storage (m0_addb2_storage) is responsible for storing addb2 records on storage.
Records are submitted to the storage in the form of traces (m0_addb2_trace), wrapped in trace objects (m0_addb2_trace_obj). When a trace has been stored, m0_addb2_trace_obj::o_done() is invoked. When an entire trace has been stored m0_addb2_storage_ops::sto_done() call-back is invoked. In addition, m0_addb2_storage_ops::sto_commit() is periodically called to inform SYSTEM about the position of the last stored trace. The SYSTEM is supposed to store this information persistently and pass it to m0_addb2_storage_init() on the next initialisation.
SYSTEM interface (detailed)
addb2 SYSTEM interface, defined and implemented in addb2/sys.[ch] provides a "sys" object (m0_addb2_sys) that encapsulates a factory and a cache of addb2 machines, associated with network (m0_addb2_net) and storage (m0_addb2_storage) back-ends.
Sys objects are used to obtain fully functional addb2 machines. As addb2 PRODUCER interface is fully lockless, there should typically exist an addb2 machine per thread, which means that machines should be created very quickly.
Sys object meets this requirement by keeping a cache of fully initialised machines. New machine is requested by calling m0_addb2_sys_get() and returned back by a call to m0_addb2_sys_put().
An addb2 machine, produced by a sys object, has its trace processing call-back (m0_addb2_mach_ops::apo_submit()) set to sys_submit(), which dispatches record traces to the back-ends. Back-end processing is done via asts (see sys_ast()), which allows ->apo_submit() to be called in any context.
Typically a running Motr process has two sys objects instantiated:
- a "fom" sys object for fom locality threads
(m0_fom_domain::fd_addb2_sys). This cache contains an addb2 machine for
each locality handler thread;
- a "global" sys instance used for all other threads. The pointer to the
global sys instance is kept in m0_get()->i_moddata[M0_MODULE_ADDB2].
Both sys objects are initialised early as part of m0_init(), but are not fully functional until m0_reqh_addb2_init() is called. This function associates both sys objects with a stob provided as a parameter and enables back-end processing. Addb2 traces produced before m0_reqh_addb2_init() call are queued in the sys objects (in m0_addb2_sys::sy_queue, up to a configurable limit).
Network back-end is used to process addb2 records when storage back-end is not available. Currently this means that it is only relevant on a client. Network back-end is activated by a call to m0_addb2_sys_net_start_with() in m0t1fs_setup().
IMPLEMENTATION
addb2 machine (m0_addb2_mach) is a structure maintaining the "context" (see addb2/addb2.h top-level comment) and build internal representation of produced records, suitable for storage and network.
Records and contexts are accumulated in m0_addb2_trace, which is an array of 64-bit elements (m0_abbd2_trace::tr_body[]). This array contains context manipulation operations (pushes and pops) and records in order they were issued to the machine.
After a machine is allocated and initialised (m0_addb2_init()), the following operations can be executed against it:
* push (m0_addb2_push()): this operation adds a label to the current
context, maintained in m0_addb2_mach::ma_label[] array. Maximal stack
depth is hard-coded to M0_ADDB2_LABEL_MAX. A label is specified by a
56-bit identifier (given as a 64-bit value with 8 highest bits zeroed)
and a payload, consisting of a given number of 64-bit values. Number of
values in the payload must not exceed VALUE_MAX_NR. In addition to
being stored in the current context, the label is also serialised to
the current trace buffer (m0_addb2_mach::ma_cur) as following:
- first, a 64-bit "tagged identifier" is added to the trace
buffer. Lowest 56 bits of the tagged identifier are equal to the
label identifier. Highest 8 bits are logical OR of the constant
PUSH opcode and the number of values in the payload (this number
always fits into 4 bits);
- then payload values are added one by one;
* pop (m0_addb2_pop()): this operation removes the top-level label from
the current context and adds 64-bit constant POP to the current trace
buffer;
* add (m0_addb2_add()): this operation adds a record. The record is
delivered for online consumption (record_consume()) and added to the
current trace buffer similarly to the push operation, except that DATA
opcode is used instead of PUSH;
* sensor (m0_addb2_sensor_add()): this operation adds a sensor. The
sensor is added to the list hanging off of the top-most context label
(tentry::e_sensor) and is serialised to the trace buffer
(sensor_place()) similarly to the push and add operations, except that
SENSOR opcode is used. The record produced by the sensor is delivered
to online CONSUMERS.
IMPLEMENTATION will read out and serialise the sensor when
- a new trace buffer and initialised and the sensor is still in
context;
- the sensor goes of out context as result of a pop operation.
In either case the produced record is added to the buffer and delivered
to online CONSUMERS.
Trace buffer is parsed by m0_addb2_cursor_next().
Incoming stream of context manipulations and records is parceled into traces. Each trace is self-sufficient: it starts with a sequence of push operations, recreating the context, which was current at the moment the trace began (mach_buffer()).
Traces are internally wrapped in "buffers" (struct buffer). A buffer can be either the current buffer (m0_addb2_mach::ma_cur) to which new elements are added, or belong to one of the two per-machine lists:
* busy list (m0_addb2_mach::ma_busy) is a list of buffers submitted for
processing (network or storage transmission), but not yet processed;
* idle list (m0_addb2_mach:ma_idle) is a list of buffers ready to replace
current buffer, when it becomes full.
When current buffer becomes full it is submitted (pack()) by calling m0_addb2_mach_ops::apo_submit(). If ->apo_submit() returns a positive value, the buffer is assumed accepted for processing and moved to the busy list. If ->apo_submit() returns anything else, the buffer is assumed to be processed instantly and moved to the idle list. When processing of a buffer accepted for processing is completed, m0_addb2_trace_done() should be called. This moves the buffer from busy to idle list.
Machine keeps the total number of allocated buffers between BUFFER_MIN and BUFFER_MAX. If the maximum is reached, the warning is issued (mach_buffer()) and records will be lost.
Concurrency
PRODUCER should guarantee that calls to m0_addb2_{pop,push,add}() are serialised. IMPLEMENTATION internally takes m0_addb2_mach::ma_lock when it has to move a buffer from list to list, that is, when the current buffer becomes full or a buffer processing completes. This lock is taken by m0_addb2_trace_done().
Addb2 network implementation
Traces are piggy-backed to the outgoing rpc packets by using m0_rpc_item_source interface. No attempt is made to aggregate individual traces before sending.
A trace is sent as a one-way fop, with m0_addb2_trace as fop data.
m0addb2dump plugins API.
External plugins allow to add custom addb records interpreters. Custom interpreters should have ids (field ii_id of structure m0_id_intrp) from reserved external ranges (addb2/addb2_internal.h).
Addb2 storage iterator
Storage iterator takes a stob containing trace frames produced by m0_addb2_storage, and iterates over all records in the traces.
Addb2 storage implementation
An addb2 trace is submitted to storage machine by calling m0_addb2_storage_submit(). Traces are collected into "frames". struct frame holds all the information necessary to submit a frame to the storage. A frame contains up to FRAME_TRACE_MAX traces with total size in bytes not exceeding FRAME_SIZE_MAX.
Once the frame reaches the maximal size, it is submitted for write to the stob (frame_try()) and moved to the in-flight list (m0_addb2_storage::as_inflight). When IO completes, completion handler frame_endio() is called, which invokes completion call-backs and moves the frame to the idle list (m0_addb2_storage::as_idle).
If the idle list is empty (all frames are in-flight), newly submitted traces are added to a pending queue m0_addb2_srorage::as_queue).
An intermediate list (m0_addb2_storage::as_pending) contains formed, but still not submitted frames. It is used to avoid keepinf g the storage lock over stob IO launching.
On storage a frame starts with the header (m0_addb2_frame_header), which contains frame size and offset of the previous frame header. This allows frames to be scanned in either direction, starting from any valid frame.
The header is followed by traces (m0_addb2_trace) one after another. The number of traces in a frame is recorded in the frame header (m0_addb2_frame_header::he_trace_nr).
The storage machine maintains the current position, where the next frame will be written (m0_addb2_storage::as_pos). When the position is too close to the stob end, it is wrapped to the beginning (stor_update()).
SYSTEM interface (implementation)
A sys object (m0_addb2_sys) has 2 functions:
- it is a factory and a cache of addb2 machines and
- it binds addb2 machines that it creates to network and storage
back-ends.
Cached addb2 machines are stored in m0_addb2_sys::sy_pool, machines handed to the users are remembered in m0_addb2_sys::sy_granted.
If the pool is about to overflow (grow larger than m0_addb2_sys::sy_conf::co_pool_max) when a machine is returned to it (by a call to m0_addb2_sys_put()), the machine is finalised. Because machine finalisation is asynchronous, additional lists are used for this:
- m0_addb2_sys::sy_moribund: m0_addb2_mach_stop() has been on called on a
machine, but the machine is not yet stopped;
- m0_addb2_sys::sy_deathrow: the machine is completely stopped,
m0_addb2_mach_ops::apo_idle (set to sys_idle()) has been called. The
machine will be finalised on the next sys AST (see sys_balance()).
All back-end processing is done in the AST context. The AST is posted to the current locality by sys_post().
◆ COUNTER
◆ DEBUG_OWNERSHIP
#define DEBUG_OWNERSHIP (1) |
When define, a ->ma_name[] field is added to the m0_addb2_mach, where name of the creator thread is stored.
Definition at line 188 of file addb2.c.
◆ DOM
#define DOM "./_addb2-dump_%d" |
◆ FID
◆ HEADER_XO
Value: .xo_type = m0_addb2_frame_header_xc, \
.xo_ptr = (h) \
}
Definition at line 34 of file internal.h.
◆ HIST
Value:static void hist(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
static void skip(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition at line 1070 of file dump.c.
◆ M0_ADDB2__PLUGIN_FUNC_NAME
#define M0_ADDB2__PLUGIN_FUNC_NAME "m0_addb2_load_interps" |
◆ M0_ADDB2_ADD
#define M0_ADDB2_ADD |
( |
|
id, |
|
|
|
... |
|
) |
| |
Value: (const uint64_t[]){ __VA_ARGS__ })
void m0_addb2_add(uint64_t id, int n, const uint64_t *value)
Helper macro for m0_addb2_add().
Possible uses:
Definition at line 252 of file addb2.h.
◆ M0_ADDB2_HIST
#define M0_ADDB2_HIST |
( |
|
id, |
|
|
|
hist, |
|
|
|
datum, |
|
|
|
... |
|
) |
| |
Value:do { \
M0_ADDB2_TIMED_0((id), (datum), __VA_ARGS__); \
m0_addb2_hist_mod_with(__hist, __duration, __datum); \
} while (0)
static void hist(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition at line 147 of file histogram.h.
◆ M0_ADDB2_IN
#define M0_ADDB2_IN |
( |
|
id, |
|
|
|
stmnt, |
|
|
|
... |
|
) |
| |
Value:do { \
M0_ADDB2_PUSH(id , ##__VA_ARGS__); \
(stmnt); \
m0_addb2_pop(id); \
} while (0)
Executes a statement within temporary context.
Definition at line 281 of file addb2.h.
◆ M0_ADDB2_OBJ
#define M0_ADDB2_OBJ |
( |
|
obj | ) |
((sizeof *(obj))/sizeof(uint64_t)), (uint64_t *)(obj) |
Helper to use structures as payload.
Use as:
Definition at line 276 of file addb2.h.
◆ M0_ADDB2_PUSH
#define M0_ADDB2_PUSH |
( |
|
id, |
|
|
|
... |
|
) |
| |
Value: (const uint64_t[]){ __VA_ARGS__ })
void m0_addb2_push(uint64_t id, int n, const uint64_t *value)
Helper macro for m0_addb2_add().
- See also
- M0_ADDB2_ADD().
Definition at line 261 of file addb2.h.
◆ M0_ADDB2_TIMED
#define M0_ADDB2_TIMED |
( |
|
id, |
|
|
|
counter, |
|
|
|
datum, |
|
|
|
... |
|
) |
| |
Value:do { \
M0_ADDB2_TIMED_0((id), (datum), __VA_ARGS__); \
m0_addb2_counter_mod_with(__counter, __duration, __datum); \
} while (0)
Definition at line 91 of file counter.h.
◆ M0_ADDB2_TIMED_0
#define M0_ADDB2_TIMED_0 |
( |
|
id, |
|
|
|
datum, |
|
|
|
... |
|
) |
| |
Value: m0_time_t __end; \
m0_time_t __duration; \
uint64_t __datum = (datum); \
__VA_ARGS__; \
__duration = (__end - __start) >> 10; \
if (__id != 0) \
M0_ADDB2_ADD(__id, __duration, __datum); \
m0_time_t m0_time_now(void)
Common part of M0_ADDB2_TIMED() and M0_ADDB2_HIST().
Definition at line 79 of file counter.h.
◆ M0_TRACE_SUBSYSTEM [1/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [2/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [3/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [4/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT |
Definition at line 30 of file sys.c.
◆ M0_TRACE_SUBSYSTEM [5/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [6/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [7/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [8/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [9/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
Definition at line 36 of file sit.c.
◆ M0_TRACE_SUBSYSTEM [10/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
Definition at line 39 of file net.c.
◆ M0_TRACE_SUBSYSTEM [11/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
Definition at line 58 of file sys.c.
◆ M0_TRACE_SUBSYSTEM [12/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [13/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ M0_TRACE_SUBSYSTEM [14/14]
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB |
◆ MACH_DEPTH
#define MACH_DEPTH |
( |
|
mach | ) |
(mach->ma_rec.ar_label_nr) |
Depths of machine context stack.
Definition at line 410 of file addb2.c.
◆ SKIP2
◆ SYS
◆ TIMED
◆ TRACE_XO
Value: .xo_type = m0_addb2_trace_xc, \
}
static struct m0_thread t[8]
Definition at line 39 of file internal.h.
◆ U64
◆ VAL
Value:{ \
.va_nr =
ARRAY_SIZE(((
const uint64_t[]) { __VA_ARGS__ })), \
.va_data = ((const uint64_t[]) { __VA_ARGS__ } ) \
}
Definition at line 62 of file common.h.
◆ m0_addb2__intrp_load_t
◆ anonymous enum
Enumerator |
---|
BUFFER_SIZE | Trace buffer size (m0_addb2_trace::tr_body[]) in bytes.
This should be small enough so that traces can be easily piggy-backed to outgoing RPC packets. This should be large enough so that storage (m0_addb2_storage) could build a large storage IO without having to wait for a very large number of traces.
|
BUFFER_MIN | Minimal number of trace buffers allocated for a machine.
|
BUFFER_MAX | Must be enough to push 1 storage frame out.
|
TAG_MASK | Bit-mask identifying bits used to store a "tag", which is (opcode|payloadsize).
|
SENSOR_THRESHOLD | Amount of free space in a buffer after sensor placement.
When a new buffer is created, no more than (BUFFER_SIZE - SENSOR_THRESHOLD) of it is used for sensors.
|
Definition at line 149 of file addb2.c.
◆ anonymous enum
Trace bytecodes.
Bytecodes are used to encode operations, by tagging high bytes of identifiers. See the top level comment in this file.
Enumerator |
---|
PUSH | Push operation. Lowest 4 bits are number of 64-bit values in payload.
|
POP | Pop of the top-most context label.
|
DATA | Add operation. Lowest 4 bits are number of 64-bit values in payload.
|
SENSOR | Sensor operation. Lowest 4 bits are number of 64-bit values in payload.
|
Definition at line 369 of file addb2.c.
◆ anonymous enum
Enumerator |
---|
ADDB2_CONSUME | |
ADDB2_DONE | |
ADDB2_SUBMIT | |
Definition at line 135 of file service.c.
◆ anonymous enum
Enumerator |
---|
MAX_INFLIGHT | Maximal number of frames storage engine will submit to write concurrently.
|
IO_FRAG | Number of fragments in frame IO.
Each frame IO update storage header at the beginning of the stob and also writes the frame itself in the stob.
|
Definition at line 85 of file storage.c.
◆ anonymous enum
Enumerator |
---|
M0_ADDB2_STOB_KEY | |
Definition at line 266 of file storage.c.
◆ anonymous enum
Custom addb2 records identifier ranges. These ranges must be used in external projects (S3, NFS) and addb2dump utility plugins
Enumerator |
---|
M0_ADDB2__EXT_RANGE_1 | |
M0_ADDB2__EXT_RANGE_2 | |
M0_ADDB2__EXT_RANGE_3 | |
M0_ADDB2__EXT_RANGE_4 | |
Definition at line 43 of file addb2_internal.h.
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
Enumerator |
---|
M0_ADDB2_LABEL_MAX | Maximal number of labels in addb2 context.
|
Definition at line 91 of file consumer.h.
◆ anonymous enum
Enumerator |
---|
M0_ADDB2_COUNTER_VALS | |
Definition at line 49 of file counter.h.
◆ anonymous enum
Enumerator |
---|
BUF_SIZE | |
PLUGINS_MAX | |
Definition at line 98 of file dump.c.
◆ anonymous enum
Enumerator |
---|
M0_ADDB2_HIST_BUCKETS | Addb2 sensor can produce a maximum of VALUE_MAX_NR 64-bit values.
The counter, embedded in each histogram produces M0_ADDB2_COUNTER_VALS values. Two more are needed to record minimum and maximum. The rest can be used for 32-bit buckets.
|
Definition at line 91 of file histogram.h.
◆ anonymous enum
Enumerator |
---|
VALUE_MAX_NR | Maximal number of 64-bit values in a payload.
- Note
- this constant cannot really be increased. Trace buffer format assumes that this is less than 0x10.
|
FRAME_TRACE_MAX | |
FRAME_SIZE_MAX | |
Definition at line 44 of file internal.h.
◆ anonymous enum
Enumerator |
---|
M0_ADDB2_GLOBAL_PHILTERS | Maximal number of global philters. Arbitrary.
|
Definition at line 88 of file internal.h.
◆ m0_addb2_frame_header_format_version
Enumerator |
---|
M0_ADDB2_FRAME_HEADER_FORMAT_VERSION_1 | |
M0_ADDB2_FRAME_HEADER_FORMAT_VERSION | Current version, should point to the latest version present
|
Definition at line 145 of file storage.h.
◆ m0_addb2_value_id
Enumerator |
---|
M0_AVI_NULL | |
M0_AVI_GENERAL_RANGE_START | |
M0_AVI_NODE | Label: node fid.
|
M0_AVI_PID | Label: process fid.
|
M0_AVI_CLOCK | Measurement: current clock reading (m0_time_now()).
|
M0_AVI_FOM_RANGE_START | |
M0_AVI_LOCALITY | Label: locality number.
|
M0_AVI_THREAD | Label: thread handle.
|
M0_AVI_SERVICE | Label: service fid.
|
M0_AVI_FOM | Label: fom address.
|
M0_AVI_PHASE | Measurement: fom phase transition.
|
M0_AVI_STATE | Measurement: fom state transition.
|
M0_AVI_STATE_COUNTER | |
M0_AVI_STATE_COUNTER_END | |
M0_AVI_FOM_DESCR | Measurement: fom description.
|
M0_AVI_FOM_ACTIVE | Measurement: active foms in locality counter.
|
M0_AVI_FOM_TO_BULK | Measurement: fom SM to bulk id
|
M0_AVI_FOM_TO_TX | Measurement: fom SM to tx SM.
|
M0_AVI_FOM_TO_STIO | Measurement: fom SM to stob_io SM.
|
M0_AVI_RUNQ | Measurement: run queue length.
|
M0_AVI_WAIL | Measurement: wait list length.
|
M0_AVI_AST | Label: ast context.
|
M0_AVI_FOM_CB | Label: fom call-back context.
|
M0_AVI_CHORE | Label: locality chore.
|
M0_AVI_LOCALITY_FORQ_DURATION | Measurement: duration of asts posted to locality fork-queue.
|
M0_AVI_LOCALITY_FORQ | Counter: asts posted to locality fork-queue.
|
M0_AVI_LOCALITY_CHAN_WAIT | Counter: wait times on locality runrun channel.
|
M0_AVI_LOCALITY_CHAN_CB | Counter: call-back times on locality runrun channel.
|
M0_AVI_LOCALITY_CHAN_QUEUE | Counter: queue-length of locality runrun channel.
|
M0_AVI_LONG_LOCK | Counter for FOM long lock.
|
M0_AVI_ATTR | Measurement: generic attribute.
|
M0_AVI_LIB_RANGE_START | |
M0_AVI_ALLOC | Measurement: memory allocation.
|
M0_AVI_RM_RANGE_START | |
M0_AVI_M0T1FS_RANGE_START | |
M0_AVI_IOS_RANGE_START | |
M0_AVI_STOB_RANGE_START | |
M0_AVI_RPC_RANGE_START | |
M0_AVI_ADDB2_RANGE_START | |
M0_AVI_BE_RANGE_START | |
M0_AVI_NET_RANGE_START | |
M0_AVI_CAS_RANGE_START | |
M0_AVI_CLIENT_RANGE_START | |
M0_AVI_DIX_RANGE_START | |
M0_AVI_KEM_RANGE_START | |
M0_AVI_DTM0_RANGE_START | |
M0_AVI_EXTERNAL_RANGE_1 | Ranges reserved for using in external projects (S3, NFS) and m0addb2dump plugins
|
M0_AVI_EXTERNAL_RANGE_2 | |
M0_AVI_EXTERNAL_RANGE_3 | |
M0_AVI_EXTERNAL_RANGE_4 | |
M0_AVI_FOP_TYPES_RANGE_START | Reserve a range of identifiers for per-fop-type per-locality counters. Identifier bits in this range are interpreted as following:
* 1 FFFF FFFF FFFF CCCC TTTT TTTT
* Where
FFFF FFFF FFFF: fop type identifier (rpc item opcode) CCCC: counter identifier TTTT TTTT: transition identifier.
- See also
- m0_fop_type_addb2_instrument().
|
M0_AVI_FOP_TYPES_RANGE_END | |
M0_AVI_SIT | |
M0_AVI_LAST | |
M0_AVI_NODATA | No data.
|
Definition at line 42 of file identifier.h.
◆ storage_constants
Enumerator |
---|
BSHIFT | Use logical block size 2^16 independently of stob block size. This simplifies IO and makes format more portable.
|
BSIZE | |
Definition at line 72 of file internal.h.
◆ _add()
◆ _clock()
static void _clock |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ add()
static void add |
( |
struct m0_addb2_mach * |
mach, |
|
|
uint64_t |
id, |
|
|
int |
n, |
|
|
const uint64_t * |
value |
|
) |
| |
|
static |
Adds a value (identifier and payload) to the current trace buffer.
New buffer is allocated if there is no enough space in the current one.
Definition at line 934 of file addb2.c.
◆ add_loop()
◆ addb2_done()
◆ addb2_fom_create()
static int addb2_fom_create |
( |
struct m0_fop * |
fop, |
|
|
struct m0_fom ** |
out, |
|
|
struct m0_reqh * |
reqh |
|
) |
| |
|
static |
◆ addb2_fom_fini()
static void addb2_fom_fini |
( |
struct m0_fom * |
fom0 | ) |
|
|
static |
◆ addb2_fom_home_locality()
static size_t addb2_fom_home_locality |
( |
const struct m0_fom * |
fom | ) |
|
|
static |
◆ addb2_fom_tick()
static int addb2_fom_tick |
( |
struct m0_fom * |
fom0 | ) |
|
|
static |
◆ addb2_force_loc()
static void addb2_force_loc |
( |
struct m0_locality * |
loc | ) |
|
|
static |
◆ addb2_force_loc_cb()
static int addb2_force_loc_cb |
( |
void * |
unused | ) |
|
|
static |
◆ addb2_service_fini()
◆ addb2_service_start()
◆ addb2_service_stop()
◆ addb2_service_type_allocate()
◆ ast_trap()
◆ asymbol_cmp()
static int asymbol_cmp |
( |
const void * |
a0, |
|
|
const void * |
a1 |
|
) |
| |
|
static |
◆ attr()
v[0] - attr name v[1] - attr val
Definition at line 949 of file dump.c.
◆ beop_state_counter()
◆ bol()
◆ buffer_add()
static void buffer_add |
( |
struct buffer * |
buf, |
|
|
uint64_t |
datum |
|
) |
| |
|
static |
Adds a 64-bit value to a trace buffer.
The buffer is assumed to have enough free space.
Definition at line 955 of file addb2.c.
◆ buffer_alloc()
Allocates new trace buffer.
Definition at line 1014 of file addb2.c.
◆ buffer_fini()
static void buffer_fini |
( |
struct buffer * |
buffer | ) |
|
|
static |
◆ buffer_space()
Returns the number of free bytes in the buffer.
Definition at line 1003 of file addb2.c.
◆ bulk_op_state()
static void bulk_op_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ cas_op_state()
static void cas_op_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ cas_state_counter()
◆ clock_counter_snapshot()
static void clock_counter_snapshot |
( |
struct m0_addb2_sensor * |
s, |
|
|
uint64_t * |
area |
|
) |
| |
|
static |
◆ cob_req_state()
static void cob_req_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ context_fill()
◆ count_nonempty_vals()
static unsigned int count_nonempty_vals |
( |
const struct m0_addb2_value * |
val | ) |
|
|
static |
◆ counter()
static void counter |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ counter_ctor()
static int counter_ctor |
( |
void * |
area, |
|
|
void * |
datum |
|
) |
| |
|
static |
◆ counter_dtor()
static void counter_dtor |
( |
void * |
area, |
|
|
void * |
datum |
|
) |
| |
|
static |
◆ counter_fini()
◆ counter_warn()
◆ cur()
Returns current buffer with at least "space" bytes free.
Definition at line 791 of file addb2.c.
◆ dec()
◆ deflate()
static void deflate |
( |
void |
| ) |
|
|
static |
◆ dix_op_state()
static void dix_op_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ dix_state_counter()
◆ dtx0_state()
static void dtx0_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ dtx0_state_counter()
◆ duration()
static void duration |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ fid()
◆ file_dump()
static void file_dump |
( |
struct m0_stob_domain * |
dom, |
|
|
const char * |
fname, |
|
|
const uint64_t |
start_time, |
|
|
const uint64_t |
stop_time |
|
) |
| |
|
static |
◆ fill_one()
◆ flate()
static void flate |
( |
void |
| ) |
|
|
static |
◆ fom_phase()
static void fom_phase |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ fom_state()
static void fom_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ fom_state_counter()
◆ fom_type()
static void fom_type |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ fop_counter()
◆ frame_clear()
static void frame_clear |
( |
struct frame * |
frame | ) |
|
|
static |
Re-initialises the frame.
Definition at line 762 of file storage.c.
◆ frame_cur()
Returns current frame.
Definition at line 742 of file storage.c.
◆ frame_done()
static void frame_done |
( |
struct frame * |
frame | ) |
|
|
static |
Invokes frame completion call-backs.
Definition at line 833 of file storage.c.
◆ frame_endio()
static bool frame_endio |
( |
struct m0_clink * |
link | ) |
|
|
static |
Write completion handler.
Invokes call-backs and moves the frame to the idle list. Submits more frames if possible.
Definition at line 781 of file storage.c.
◆ frame_fini()
static void frame_fini |
( |
struct frame * |
frame | ) |
|
|
static |
◆ frame_idle()
static void frame_idle |
( |
struct frame * |
frame | ) |
|
|
static |
◆ frame_init()
Initialises a frame.
Definition at line 580 of file storage.c.
◆ frame_invariant()
static bool frame_invariant |
( |
const struct frame * |
frame | ) |
|
|
static |
◆ frame_io_open()
static void frame_io_open |
( |
struct frame * |
frame | ) |
|
|
static |
Unpacks the frame after io completion or io submission failure.
Definition at line 818 of file storage.c.
◆ frame_io_pack()
static void frame_io_pack |
( |
struct frame * |
frame | ) |
|
|
static |
Prepares the frame for stob io submission.
Definition at line 803 of file storage.c.
◆ frame_submit()
static void frame_submit |
( |
struct frame * |
frame | ) |
|
|
static |
"Submits" the frame, by moving it to the pending list.
Definition at line 637 of file storage.c.
◆ frame_try()
static int frame_try |
( |
struct frame * |
frame | ) |
|
|
static |
Attempts to submit the frame for write.
Copy the frame into frame->f_area, first header, then traces one by one. Submit stob_io.
This function releases and re-acquired storage lock.
Definition at line 689 of file storage.c.
◆ hbar()
static void hbar |
( |
char * |
buf, |
|
|
uint32_t |
val, |
|
|
uint32_t |
m |
|
) |
| |
|
static |
◆ header_is_valid()
◆ header_next()
Returns offset of the next header.
Definition at line 388 of file sit.c.
◆ header_read()
Reads the header at the given offset.
Definition at line 264 of file sit.c.
◆ hex()
◆ hex0x()
◆ hist()
◆ hist_fini()
◆ hist_snapshot()
◆ id_fini()
static void id_fini |
( |
void |
| ) |
|
|
static |
◆ id_get()
◆ id_init()
static void id_init |
( |
void |
| ) |
|
|
static |
◆ id_matches()
◆ id_set()
◆ id_set_nr()
◆ init_fini()
static void init_fini |
( |
void |
| ) |
|
|
static |
Definition at line 59 of file sys.c.
◆ intrps_equal()
◆ ioo_req_state()
static void ioo_req_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ ioo_state_counter()
◆ it_alloc()
◆ it_free()
◆ it_init()
If starting offset is given, loads the header at this offset, otherwise scans frames backward from the last frame recorded in the stob header.
Definition at line 198 of file sit.c.
◆ it_invariant()
◆ it_is_in()
◆ it_load()
Loads a frame.
Definition at line 362 of file sit.c.
◆ it_next()
Moves the iterator to the next record once the current trace buffer has been exhausted.
Definition at line 292 of file sit.c.
◆ it_read()
Reads given stob extent in the buffer.
Definition at line 439 of file sit.c.
◆ it_rec()
Produces a surrogate addb record indicating internal boundary in the storage stream.
Definition at line 332 of file sit.c.
◆ it_rounded()
◆ it_trace_set()
Initialises internal trace buffer.
Definition at line 462 of file sit.c.
◆ libbfd_fini()
static void libbfd_fini |
( |
void |
| ) |
|
|
static |
◆ libbfd_init()
static void libbfd_init |
( |
const char * |
libpath | ) |
|
|
static |
Initialises bfd.
Definition at line 1518 of file dump.c.
◆ libbfd_resolve()
static void libbfd_resolve |
( |
uint64_t |
delta, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ list_counter_snapshot()
static void list_counter_snapshot |
( |
struct m0_addb2_sensor * |
s, |
|
|
uint64_t * |
area |
|
) |
| |
|
static |
◆ m0_addb2__counter_data_init()
◆ m0_addb2__counter_snapshot()
M0_INTERNAL void m0_addb2__counter_snapshot |
( |
struct m0_addb2_sensor * |
s, |
|
|
uint64_t * |
area |
|
) |
| |
◆ m0_addb2__mach_print()
M0_INTERNAL void m0_addb2__mach_print |
( |
const struct m0_addb2_mach * |
m | ) |
|
◆ m0_addb2_add()
void m0_addb2_add |
( |
uint64_t |
id, |
|
|
int |
n, |
|
|
const uint64_t * |
value |
|
) |
| |
Adds one-time measurement in the current context.
- Parameters
-
id | - measurement identifier |
n | - number of 64-bit values in measurement payload |
value | - payload |
- Precondition
- (id & 0xff00000000000000ull) == 0
Definition at line 466 of file addb2.c.
◆ m0_addb2_callback_add()
◆ m0_addb2_callback_del()
◆ m0_addb2_callback_fini()
◆ m0_addb2_callback_init()
◆ m0_addb2_clock_add()
void m0_addb2_clock_add |
( |
struct m0_addb2_sensor * |
clock, |
|
|
uint64_t |
label, |
|
|
int |
idx |
|
) |
| |
◆ m0_addb2_clock_del()
◆ m0_addb2_consume()
Delivers a record to the CONSUMERS.
Scans through the list of philters attached to the source. If a philter matches, its call-backs are invoked.
Definition at line 143 of file consumer.c.
◆ m0_addb2_counter_add()
void m0_addb2_counter_add |
( |
struct m0_addb2_counter * |
counter, |
|
|
uint64_t |
label, |
|
|
int |
idx |
|
) |
| |
◆ m0_addb2_counter_del()
◆ m0_addb2_counter_mod()
◆ m0_addb2_counter_mod_with()
void m0_addb2_counter_mod_with |
( |
struct m0_addb2_counter * |
counter, |
|
|
int64_t |
val, |
|
|
uint64_t |
datum |
|
) |
| |
◆ m0_addb2_cursor_fini()
◆ m0_addb2_cursor_init()
◆ m0_addb2_cursor_next()
Moves the trace cursor to the next record.
Returns +ve when cursor was successfully moved to the next record. The record is in m0_addb2_cursor::cu_rec.
Returns 0 when the end of the trace has been reached.
Returns -EPROTO when the trace is ill-formed.
Definition at line 704 of file addb2.c.
◆ m0_addb2_cursor_source()
◆ m0_addb2_force()
Forces current addb2 machine to send its collection of records for processing (to storage or network), iff it was last sent packing more than given delay ago.
Definition at line 589 of file addb2.c.
◆ m0_addb2_force_all()
void m0_addb2_force_all |
( |
void |
| ) |
|
◆ m0_addb2_global_fini()
M0_INTERNAL void m0_addb2_global_fini |
( |
void |
| ) |
|
◆ m0_addb2_global_get()
M0_INTERNAL struct m0_addb2_sys * m0_addb2_global_get |
( |
void |
| ) |
|
◆ m0_addb2_global_init()
M0_INTERNAL int m0_addb2_global_init |
( |
void |
| ) |
|
◆ m0_addb2_global_thread_enter()
M0_INTERNAL void m0_addb2_global_thread_enter |
( |
void |
| ) |
|
◆ m0_addb2_global_thread_leave()
M0_INTERNAL void m0_addb2_global_thread_leave |
( |
void |
| ) |
|
◆ m0_addb2_hist_add()
void m0_addb2_hist_add |
( |
struct m0_addb2_hist * |
hist, |
|
|
int64_t |
min, |
|
|
int64_t |
max, |
|
|
uint64_t |
label, |
|
|
int |
idx |
|
) |
| |
◆ m0_addb2_hist_add_auto()
void m0_addb2_hist_add_auto |
( |
struct m0_addb2_hist * |
hist, |
|
|
int |
skip, |
|
|
uint64_t |
label, |
|
|
int |
idx |
|
) |
| |
◆ m0_addb2_hist_bucket()
int m0_addb2_hist_bucket |
( |
const struct m0_addb2_hist * |
hist, |
|
|
int64_t |
val |
|
) |
| |
◆ m0_addb2_hist_del()
◆ m0_addb2_hist_mod()
void m0_addb2_hist_mod |
( |
struct m0_addb2_hist * |
hist, |
|
|
int64_t |
val |
|
) |
| |
◆ m0_addb2_hist_mod_with()
void m0_addb2_hist_mod_with |
( |
struct m0_addb2_hist * |
hist, |
|
|
int64_t |
val, |
|
|
uint64_t |
datum |
|
) |
| |
◆ m0_addb2_list_counter_add()
◆ m0_addb2_list_counter_del()
◆ m0_addb2_load_interps()
This function is called by the m0addb2dump utility. It should return an array of interpreters in the intrp parameter. The last terminating element of the array must have zero-struct { 0 }.
Definition at line 51 of file dump_plugin_test.c.
◆ m0_addb2_local_counter_init()
◆ m0_addb2_local_counter_mod()
◆ m0_addb2_mach_cookie()
Returns cookie passed to m0_addb2_mach_init().
This can be used to associate a machine with some ambient SYSTEM object.
Definition at line 645 of file addb2.c.
◆ m0_addb2_mach_fini()
Finalises a machine.
- Precondition
- The machine must be idle.
Definition at line 560 of file addb2.c.
◆ m0_addb2_mach_init()
Allocates and initialises an addb2 machine.
The machine initially has an empty context stack and is immediately ready to accept m0_addb2_push() and m0_addb2_add() calls. Whenever new record is added to the machine it is immediately delivered to online CONSUMERS.
The machine accumulates context state and records internally. When amount of accumulated data reaches some threshold, the machine invokes m0_addb2_mach_ops::apo_submit() to submit record data to network or storage (as defined by SYSTEM).
- Parameters
-
Definition at line 521 of file addb2.c.
◆ m0_addb2_mach_source()
◆ m0_addb2_mach_stop()
Notifies IMPLEMENTATION that SYSTEM wants to shut the machine down.
Once stopped, the machine stops accepting new records and context changes (appropriate functions become no-ops) and submits all pending record data.
When all pending record data have been processed, the machine becomes idle and m0_addb2_mach_ops::apo_idle() is invoked. An idle machine can be finalised.
Definition at line 630 of file addb2.c.
◆ m0_addb2_mach_wait()
Waits until stopped machine becomes idle.
Definition at line 639 of file addb2.c.
◆ m0_addb2_module_fini()
void m0_addb2_module_fini |
( |
void |
| ) |
|
◆ m0_addb2_module_get()
◆ m0_addb2_module_init()
int m0_addb2_module_init |
( |
void |
| ) |
|
◆ m0_addb2_net__is_not_locked()
M0_INTERNAL bool m0_addb2_net__is_not_locked |
( |
const struct m0_addb2_net * |
net | ) |
|
◆ m0_addb2_net_add()
Adds the connection to the engine.
Pending traces, submitted to the engine, will be piggy-backed to the packets outgoing through this connection, when the packets have enough free space.
Typically, this function will be called when configuration in confc is scanned during initialisation or after configuration change.
- See also
- m0_addb2_net_del().
Definition at line 166 of file net.c.
◆ m0_addb2_net_del()
◆ m0_addb2_net_fini()
M0_INTERNAL void m0_addb2_net_fini |
( |
struct m0_addb2_net * |
net | ) |
|
◆ m0_addb2_net_init()
M0_INTERNAL struct m0_addb2_net * m0_addb2_net_init |
( |
void |
| ) |
|
Allocates and initialises a network engine.
Definition at line 128 of file net.c.
◆ m0_addb2_net_module_fini()
M0_INTERNAL void m0_addb2_net_module_fini |
( |
void |
| ) |
|
◆ m0_addb2_net_module_init()
M0_INTERNAL int m0_addb2_net_module_init |
( |
void |
| ) |
|
◆ m0_addb2_net_stop()
M0_INTERNAL void m0_addb2_net_stop |
( |
struct m0_addb2_net * |
net, |
|
|
void(*)(struct m0_addb2_net *, void *) |
callback, |
|
|
void * |
datum |
|
) |
| |
Initiates the network machine stopping.
When there are no more pending traces, the provided call-back is invoked.
Definition at line 225 of file net.c.
◆ m0_addb2_net_submit()
Submits a trace for network.
The trace will be opportunistically send over any connection added to the network machine.
Definition at line 204 of file net.c.
◆ m0_addb2_net_tick()
M0_INTERNAL void m0_addb2_net_tick |
( |
struct m0_addb2_net * |
net | ) |
|
If necessary, triggers an attempt to send some pending traces.
This function should be called periodically to guarantee that traces are sent out even if there is no other outgoing message to which the traces can be piggy-backed.
Caller must guarantee that connections are neither added nor deleted, while this call is in progress.
Definition at line 214 of file net.c.
◆ m0_addb2_philter_add()
Adds a philter to a source.
Definition at line 86 of file consumer.c.
◆ m0_addb2_philter_del()
Removes a philter from the source.
Definition at line 92 of file consumer.c.
◆ m0_addb2_philter_fini()
◆ m0_addb2_philter_global_add()
Adds a global philter that will be matched with every records produced by any addb2 machine.
Definition at line 182 of file consumer.c.
◆ m0_addb2_philter_global_del()
Removes a global philter.
Definition at line 196 of file consumer.c.
◆ m0_addb2_philter_id_init()
Sets up a philter matching records with a given measurement identifier.
Definition at line 165 of file consumer.c.
◆ m0_addb2_philter_init()
◆ m0_addb2_philter_true_init()
Sets up a philter which identically true predicate function.
This philter matches all records.
Definition at line 160 of file consumer.c.
◆ m0_addb2_pop()
void m0_addb2_pop |
( |
uint64_t |
id | ) |
|
Removes the top-most label in the current context stack.
- Parameters
-
- Precondition
- "id" must the identifier of the top-most label.
-
(id & 0xff00000000000000ull) == 0
Definition at line 440 of file addb2.c.
◆ m0_addb2_push()
void m0_addb2_push |
( |
uint64_t |
id, |
|
|
int |
n, |
|
|
const uint64_t * |
value |
|
) |
| |
Adds a label to the current context.
- Parameters
-
id | - label identifier |
n | - number of 64-bit values in label payload |
value | - payload |
Possible uses:
- Precondition
- (id & 0xff00000000000000ull) == 0
Definition at line 412 of file addb2.c.
◆ m0_addb2_sensor_add()
Adds a sensor to the current context. This sensor will be periodically queried (at the IMPLEMENTATION discretion) until it goes out of context.
"idx" is used to specify to which label in the context to add the sensor. -1 means the topmost label, otherwise it is the level of label in the context (starting from 0).
- Precondition
- context stack must be non-empty.
Definition at line 480 of file addb2.c.
◆ m0_addb2_sensor_del()
Deletes a sensor.
Definition at line 504 of file addb2.c.
◆ m0_addb2_service_module_fini()
M0_INTERNAL void m0_addb2_service_module_fini |
( |
void |
| ) |
|
◆ m0_addb2_service_module_init()
M0_INTERNAL int m0_addb2_service_module_init |
( |
void |
| ) |
|
◆ m0_addb2_sit_fini()
◆ m0_addb2_sit_init()
Allocates and initialises storage trace iterator.
Definition at line 108 of file sit.c.
◆ m0_addb2_sit_next()
Returns the next record from the storage iterator.
Returns +ve value on success, 0 for "no more records", -ve on error.
Definition at line 148 of file sit.c.
◆ m0_addb2_sit_source()
Returns the record source embedded in the iterator.
Definition at line 173 of file sit.c.
◆ m0_addb2_source_fini()
◆ m0_addb2_source_init()
◆ m0_addb2_storage__is_not_locked()
M0_INTERNAL bool m0_addb2_storage__is_not_locked |
( |
const struct m0_addb2_storage * |
stor | ) |
|
◆ m0_addb2_storage_cookie()
M0_INTERNAL void * m0_addb2_storage_cookie |
( |
const struct m0_addb2_storage * |
stor | ) |
|
◆ m0_addb2_storage_fini()
Finalises an idle storage machine.
Definition at line 63 of file kaddb2.c.
◆ m0_addb2_storage_header()
Returns the header of the latest frame recorded on the stob.
Definition at line 179 of file sit.c.
◆ m0_addb2_storage_init()
Allocates and initialises the storage machine.
- Parameters
-
location | - the stob domain's location. |
key | - the stob domain's key. |
mkfs | - if true, creates the stob domain. |
force | - if true, overwrites the existing stob domain. |
size | - the size of the storage object. |
cookie | - an arbitrary cookie returned by m0_addb2_storage_cookie(). |
- Precondition
- size is a multiple of stob block size.
Definition at line 42 of file kaddb2.c.
◆ m0_addb2_storage_stop()
◆ m0_addb2_storage_submit()
Submits a trace to storage.
Definition at line 50 of file kaddb2.c.
◆ m0_addb2_sys_attach()
Sets "sys" to use the same back-ends as "src".
Definition at line 408 of file sys.c.
◆ m0_addb2_sys_counter_add()
Registers an addb2 counter with the sys object.
On the next occasion (i.e., sys AST execution), the counter will be added to some locality. This function is useful to distribute global counters (not logically bound to any locality) aming localities.
Definition at line 425 of file sys.c.
◆ m0_addb2_sys_detach()
Resets "sys" back-ends to NULL.
Definition at line 416 of file sys.c.
◆ m0_addb2_sys_fini()
◆ m0_addb2_sys_get()
Gets addb2 machine.
Either return cached addb2 machine or create new one, when the cache is empty.
Definition at line 272 of file sys.c.
◆ m0_addb2_sys_init()
◆ m0_addb2_sys_net_start()
Enables network back-end processing.
Definition at line 312 of file sys.c.
◆ m0_addb2_sys_net_start_with()
Enables network processing and initialises the list of outgoing services.
"head" should contain a list of services (pools_common_svc_ctx_tlist).
- See also
- m0t1fs_setup().
Definition at line 329 of file sys.c.
◆ m0_addb2_sys_net_stop()
Disables network back-end processing.
Definition at line 322 of file sys.c.
◆ m0_addb2_sys_put()
Returns the machine.
The caller should not use the returned machine any longer. The machine is either returned to the cache or destroyed. All context labels pushed by the called on a machine obtained via m0_addb2_sys_get() should be popped before the machine is returned.
Definition at line 295 of file sys.c.
◆ m0_addb2_sys_sm_start()
Enables ASTs for back-end processing.
Definition at line 377 of file sys.c.
◆ m0_addb2_sys_sm_stop()
Disables ASTs for back-end processing.
While processing is disabled, addb2 traces are accumulated in the sys object queue (m0_addb2_sys:sy_queue). Once the queue overflows, further traces are dropped on the floor.
Definition at line 384 of file sys.c.
◆ m0_addb2_sys_stor_start()
int m0_addb2_sys_stor_start |
( |
struct m0_addb2_sys * |
sys, |
|
|
const char * |
location, |
|
|
uint64_t |
key, |
|
|
bool |
mkfs, |
|
|
bool |
force, |
|
|
m0_bcount_t |
size |
|
) |
| |
Starts storage back-end processing.
Location and key define the ADDB stob domain; mkfs and force rule the domain's initialization process. Size is the size of stob that stores traces.
Definition at line 357 of file sys.c.
◆ m0_addb2_sys_stor_stop()
Disables storage back-end processing.
Definition at line 370 of file sys.c.
◆ m0_addb2_sys_submit()
◆ m0_addb2_trace_done()
Notifies the IMPLEMENTATION that the trace has been processed (i.e., sent across network or stored on storage).
This is invoked internally from addb2 network and storage components.
Definition at line 650 of file addb2.c.
◆ m0_addb2_trace_size()
◆ M0_BASSERT() [1/2]
◆ M0_BASSERT() [2/2]
Check that buffer still have free space after all labels are pushed.
Arbitrary assume that a label has 2 payload elements on average.
◆ m0_dix_cm_rebalance_cpx_fini()
void m0_dix_cm_rebalance_cpx_fini |
( |
void |
| ) |
|
◆ m0_dix_cm_rebalance_cpx_init()
void m0_dix_cm_rebalance_cpx_init |
( |
void |
| ) |
|
◆ m0_dix_cm_repair_cpx_fini()
void m0_dix_cm_repair_cpx_fini |
( |
void |
| ) |
|
◆ m0_dix_cm_repair_cpx_init()
void m0_dix_cm_repair_cpx_init |
( |
void |
| ) |
|
◆ M0_TL_DECLARE() [1/2]
◆ M0_TL_DECLARE() [2/2]
◆ M0_TL_DEFINE() [1/8]
◆ M0_TL_DEFINE() [2/8]
◆ M0_TL_DEFINE() [3/8]
M0_TL_DEFINE |
( |
src |
, |
|
|
static |
, |
|
|
struct source |
|
|
) |
| |
◆ M0_TL_DEFINE() [4/8]
◆ M0_TL_DEFINE() [5/8]
◆ M0_TL_DEFINE() [6/8]
M0_TL_DEFINE |
( |
buf |
, |
|
|
static |
, |
|
|
struct buffer |
|
|
) |
| |
◆ M0_TL_DEFINE() [7/8]
◆ M0_TL_DEFINE() [8/8]
◆ M0_TL_DESCR_DECLARE() [1/2]
M0_TL_DESCR_DECLARE |
( |
tr |
, |
|
|
M0_EXTERN |
|
|
) |
| |
◆ M0_TL_DESCR_DECLARE() [2/2]
M0_TL_DESCR_DECLARE |
( |
mach |
, |
|
|
M0_EXTERN |
|
|
) |
| |
◆ M0_TL_DESCR_DEFINE() [1/8]
◆ M0_TL_DESCR_DEFINE() [2/8]
◆ M0_TL_DESCR_DEFINE() [3/8]
◆ M0_TL_DESCR_DEFINE() [4/8]
◆ M0_TL_DESCR_DEFINE() [5/8]
List of traces. This is used by the network and storage components of addb2 to link traces into their internal queues.
◆ M0_TL_DESCR_DEFINE() [6/8]
◆ M0_TL_DESCR_DEFINE() [7/8]
List of sensors, associated with a label.
◆ M0_TL_DESCR_DEFINE() [8/8]
List of addb2 machines, used to implement machine pool in addb2/sys.c
◆ M0_XCA_DOMAIN()
◆ mach()
◆ mach_1()
static void mach_1 |
( |
void |
| ) |
|
|
static |
Definition at line 70 of file sys.c.
◆ mach_buffer()
Gets a trace buffer.
If there is no current buffer, tries to use an idle buffer, if any. Allocates a new buffer if there are no idle buffers.
Definition at line 808 of file addb2.c.
◆ mach_cache()
static void mach_cache |
( |
void |
| ) |
|
|
static |
◆ mach_cache_N()
static void mach_cache_N |
( |
void |
| ) |
|
|
static |
◆ mach_fini()
◆ mach_idle()
Checks and signals if the machine is idle.
Definition at line 920 of file addb2.c.
◆ mach_put()
Decreases the nesting counter of the machine, returned previously by mach().
Definition at line 911 of file addb2.c.
◆ mach_set()
◆ mach_toomany()
static void mach_toomany |
( |
void |
| ) |
|
|
static |
Definition at line 85 of file sys.c.
◆ mach_top()
Returns the top-most label in the context.
Definition at line 1056 of file addb2.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Test server for m0console.
Definition at line 195 of file dump.c.
◆ misc_fini()
static void misc_fini |
( |
void |
| ) |
|
|
static |
◆ misc_init()
static void misc_init |
( |
void |
| ) |
|
|
static |
◆ net_fop_init()
Helper to initialise an outgoing one-way fop.
Definition at line 367 of file net.c.
◆ net_force()
◆ net_idle()
static void net_idle |
( |
struct m0_addb2_net * |
net, |
|
|
void * |
datum |
|
) |
| |
|
static |
◆ net_invariant()
static bool net_invariant |
( |
const struct m0_addb2_net * |
net | ) |
|
|
static |
◆ net_lock()
◆ net_sent()
◆ net_stop()
◆ net_unlock()
◆ noqueue_add()
static void noqueue_add |
( |
void |
| ) |
|
|
static |
◆ oct()
◆ op_state()
static void op_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ pack()
Ships the current trace buffer off to processing.
Definition at line 966 of file addb2.c.
◆ pad()
static int pad |
( |
int |
indent | ) |
|
|
static |
◆ philter_consume()
◆ plugin_add()
static int plugin_add |
( |
const char * |
path | ) |
|
|
static |
◆ plugin_load()
static int plugin_load |
( |
struct plugin * |
plugin | ) |
|
|
static |
◆ plugin_unload()
static void plugin_unload |
( |
struct plugin * |
plugin | ) |
|
|
static |
◆ plugins_load()
static int plugins_load |
( |
void |
| ) |
|
|
static |
◆ plugins_unload()
static void plugins_unload |
( |
void |
| ) |
|
|
static |
◆ ptr()
◆ queue_add()
static void queue_add |
( |
void |
| ) |
|
|
static |
◆ rec_dump()
◆ receq()
◆ record_consume()
static void record_consume |
( |
struct m0_addb2_mach * |
m, |
|
|
uint64_t |
id, |
|
|
int |
n, |
|
|
const uint64_t * |
value |
|
) |
| |
|
static |
Delivers a record (identifier, payload and the current context) to the online CONSUMERS.
Definition at line 1085 of file addb2.c.
◆ rpc_in()
static void rpc_in |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ rpc_out()
static void rpc_out |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ rpcop()
◆ sensor_place()
Reads the sensor measurement and adds it to the current trace buffer.
Definition at line 1065 of file addb2.c.
◆ skip()
◆ sm_add()
static void sm_add |
( |
void |
| ) |
|
|
static |
◆ sm_state()
◆ sm_trans()
◆ src_conn_terminating()
◆ src_fini()
static void src_fini |
( |
struct source * |
s | ) |
|
|
static |
◆ src_get_item()
◆ src_has_item()
◆ state_counter()
◆ stob_io_req_state()
static void stob_io_req_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ stor_balance()
Attempts to append some traces into a frames and to submit full frames.
"delta" parameter is 1 when called from frame_endio() and 0 otherwise.
Definition at line 499 of file storage.c.
◆ stor_dom_fini()
◆ stor_dom_init()
static int stor_dom_init |
( |
struct m0_addb2_storage * |
stor, |
|
|
const char * |
location, |
|
|
uint64_t |
key, |
|
|
bool |
mkfs, |
|
|
bool |
force |
|
) |
| |
|
static |
◆ stor_drain()
Submits pending frames.
Definition at line 653 of file storage.c.
◆ stor_fini()
◆ stor_idle()
◆ stor_invariant()
◆ stor_round()
◆ stor_rounded()
◆ stor_stob_fini()
◆ stor_stob_init()
◆ stor_stop()
◆ stor_update()
Updates the current position after the frame with the given header has been written.
Definition at line 671 of file storage.c.
◆ submit_trap()
◆ sym()
◆ sys_ast()
Sys AST call-back.
Definition at line 550 of file sys.c.
◆ sys_balance()
Main back-end processing function.
This is called in the AST context (but also directly by m0_addb2_sys_fini()).
Submits queued traces and finalises stopped machines.
Definition at line 442 of file sys.c.
◆ sys_idle()
Implementation of m0_addb2_mach_ops::apo_idle().
Called by IMPLEMENTATION when the machine is stopped. Moves the machine from moribund and deathrow lists and post an AST to finalise the machine.
- See also
- sys_mach_ops
Definition at line 502 of file sys.c.
◆ sys_invariant()
static bool sys_invariant |
( |
const struct m0_addb2_sys * |
sys | ) |
|
|
static |
◆ sys_lock()
◆ sys_post()
◆ sys_qlock()
◆ sys_queue_invariant()
static bool sys_queue_invariant |
( |
const struct m0_addb2_sys * |
sys | ) |
|
|
static |
◆ sys_qunlock()
◆ sys_size()
◆ sys_submit()
◆ sys_unlock()
◆ tag()
static uint64_t tag |
( |
uint8_t |
code, |
|
|
uint64_t |
id |
|
) |
| |
|
static |
Places the tag in the high 8-bits of the identifier.
Definition at line 1047 of file addb2.c.
◆ trace_add()
Adds the trace to the frame.
Definition at line 569 of file storage.c.
◆ trace_fits()
True iff the frame has enough space for the trace.
Definition at line 558 of file storage.c.
◆ trace_invariant()
◆ trace_tryadd()
If there is enough space, adds the trace to the current frame. If the frame becomes full, submits it to write.
Definition at line 537 of file storage.c.
◆ true_matches()
◆ tx_state()
static void tx_state |
( |
struct m0_addb2__context * |
ctx, |
|
|
const uint64_t * |
v, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ tx_state_counter()
◆ val_dump()
◆ val_dump_json()
◆ val_dump_plaintext()
◆ valeq()
◆ abfd
◆ addb2_fom_ops
Initial value:= {
}
static int addb2_fom_tick(struct m0_fom *fom0)
static void addb2_fom_fini(struct m0_fom *fom0)
static size_t addb2_fom_home_locality(const struct m0_fom *fom)
Definition at line 70 of file service.c.
◆ addb2_fom_phases
Initial value:= {
.sd_name = "consume",
},
.sd_name = "submit",
},
.sd_name = "done",
}
}
Definition at line 212 of file service.c.
◆ addb2_service_ops
Initial value:= {
}
static void addb2_service_stop(struct m0_reqh_service *service)
static int addb2_service_start(struct m0_reqh_service *service)
int m0_reqh_service_async_start_simple(struct m0_reqh_service_start_async_ctx *asc)
static void addb2_service_fini(struct m0_reqh_service *service)
Definition at line 68 of file service.c.
◆ addb2_service_type_ops
Initial value:= {
}
static int addb2_service_type_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition at line 69 of file service.c.
◆ addb2_sys_ut
Initial value:= {
.ts_name = "addb2-sys",
.ts_tests = {
{
"mach-1", &
mach_1,
"Nikita" },
{
"sm-add", &
sm_add,
"Nikita" },
}
}
static void mach_cache(void)
static void queue_add(void)
static void mach_toomany(void)
static void init_fini(void)
static void noqueue_add(void)
static void mach_cache_N(void)
Definition at line 271 of file sys.c.
◆ ast_wait
◆ base
◆ be_tx_sm_conf
Definition at line 176 of file tx.c.
◆ cas_req_sm_conf
◆ clock_sensor_ops
Initial value:= {
}
static void counter_fini(struct m0_addb2_sensor *s)
static void clock_counter_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition at line 43 of file counter.c.
◆ deflatten
◆ delay
◆ dix_req_sm_conf
◆ flatten
◆ fom_states_conf
Initial value:= {
.scf_name = "FOM states",
}
static struct m0_sm_trans_descr fom_trans[M0_FOS_TRANS_NR]
static struct m0_sm_state_descr fom_states[]
Definition at line 1652 of file fom.c.
◆ frame_tag
Initial value:= {
}
#define offsetof(typ, memb)
Definition at line 264 of file storage.c.
◆ hist_ops
Initial value:= {
}
static void hist_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
static void hist_fini(struct m0_addb2_sensor *s)
Definition at line 34 of file histogram.c.
◆ idle
◆ IDLE_THRESHOLD
◆ ids
◆ io_sm_conf
IO request state machine config
Definition at line 141 of file io_req.c.
◆ json_extra_data
const char* json_extra_data = NULL |
|
static |
◆ json_output
◆ list_sensor_ops
Initial value:= {
}
static void counter_fini(struct m0_addb2_sensor *s)
static void list_counter_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition at line 42 of file counter.c.
◆ m0_addb2__dummy_payload [1/2]
M0_EXTERN uint64_t m0_addb2__dummy_payload[] |
◆ m0_addb2__dummy_payload [2/2]
M0_INTERNAL uint64_t m0_addb2__dummy_payload[1] = {} |
◆ m0_addb2__dummy_payload_size [1/2]
M0_EXTERN uint64_t m0_addb2__dummy_payload_size |
◆ m0_addb2__dummy_payload_size [2/2]
M0_INTERNAL uint64_t m0_addb2__dummy_payload_size |
Initial value:=
M0_INTERNAL uint64_t m0_addb2__dummy_payload[1]
Definition at line 1098 of file addb2.c.
◆ m0_addb2__fom_type_ops [1/2]
◆ m0_addb2__fom_type_ops [2/2]
Initial value:= {
}
static int addb2_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition at line 208 of file service.c.
◆ m0_addb2__mach
"Surrogate" current machine call-back used by UT.
Definition at line 873 of file addb2.c.
◆ m0_addb2__sm_conf [1/2]
M0_EXTERN const struct m0_sm_conf m0_addb2__sm_conf |
◆ m0_addb2__sm_conf [2/2]
M0_INTERNAL const struct m0_sm_conf m0_addb2__sm_conf |
Initial value:= {
.scf_name = "addb2 fom",
}
static struct m0_sm_state_descr addb2_fom_phases[]
Definition at line 228 of file service.c.
◆ m0_addb2__sys_ast_trap [1/2]
◆ m0_addb2__sys_ast_trap [2/2]
◆ m0_addb2__sys_submit_trap [1/2]
◆ m0_addb2__sys_submit_trap [2/2]
◆ m0_addb2_service_type [1/2]
◆ m0_addb2_service_type [2/2]
Initial value:= {
.rst_name = "M0_CST_ADDB2",
.rst_typecode = M0_CST_ADDB2
}
static const struct m0_reqh_service_type_ops addb2_service_type_ops
Definition at line 245 of file service.c.
◆ m0_addb2_stob_key
◆ m0_dtx_sm_conf
Definition at line 82 of file dtx.c.
◆ m0_fom__types
◆ m0_op_conf
Configuration structure for the client operation state machine.
Definition at line 145 of file client.c.
◆ M0_XCA_DOMAIN
◆ net_fopt
◆ net_rpc_ops
Initial value:= {
}
static void net_sent(struct m0_rpc_item *item)
Definition at line 124 of file net.c.
◆ noqueue
Initial value:= {
.co_buffer_size = 4096,
.co_buffer_min = 0,
.co_buffer_max = 1,
.co_queue_max = 0,
.co_pool_min = 1,
.co_pool_max = 1
}
Definition at line 41 of file sys.c.
◆ nr
◆ offset
◆ op_states_conf
Definition at line 66 of file op.c.
◆ optind
◆ plugins
◆ plugins_nr
◆ queue
Initial value:= {
.co_buffer_size = 4096,
.co_buffer_min = 0,
.co_buffer_max = 1,
.co_queue_max = 100,
.co_pool_min = 1,
.co_pool_max = 1
}
Definition at line 50 of file sys.c.
◆ sensor_finalised
◆ SENSOR_MARKER
const uint64_t SENSOR_MARKER |
◆ sensor_ops [1/2]
◆ sensor_ops [2/2]
Initial value:= {
}
static void counter_fini(struct m0_addb2_sensor *s)
M0_INTERNAL void m0_addb2__counter_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition at line 41 of file counter.c.
◆ seq
◆ src_ops
Initial value:= {
}
static void src_conn_terminating(struct m0_rpc_item_source *ris)
static bool src_has_item(const struct m0_rpc_item_source *ris)
static struct m0_rpc_item * src_get_item(struct m0_rpc_item_source *ris, m0_bcount_t size)
Definition at line 122 of file net.c.
◆ submit
◆ submitted
◆ syms
◆ sys_mach_ops
Initial value:= {
}
static void sys_idle(struct m0_addb2_mach *mach)
static int sys_submit(struct m0_addb2_mach *mach, struct m0_addb2_trace_obj *obj)
Definition at line 173 of file sys.c.
◆ sys_stor_ops
Initial value:= {
}
static void stor_idle(struct m0_addb2_storage *stor)
Definition at line 174 of file sys.c.
◆ sys_submitted
◆ value_id