Motr  M0
ADDB.2

Data Structures

struct  buffer
 
struct  tentry
 
struct  m0_addb2_mach
 
struct  m0_addb2_sensor_ops
 
struct  m0_addb2_sensor
 
struct  m0_addb2_mach_ops
 
struct  m0_addb2_trace
 
struct  m0_addb2_trace_obj
 
struct  m0_addb2__id_intrp
 
struct  m0_addb2_value
 
struct  m0_addb2_record
 
struct  m0_addb2_source
 
struct  m0_addb2_philter
 
struct  m0_addb2_callback
 
struct  m0_addb2_cursor
 
struct  m0_addb2_counter_data
 
struct  m0_addb2_counter
 
struct  m0_addb2_list_counter
 
struct  m0_addb2_local_counter
 
struct  fom
 
struct  m0_addb2__context
 
struct  plugin
 
struct  m0_addb2_hist_data
 
struct  m0_addb2_hist
 
struct  m0_addb2_module
 
struct  m0_addb2_net
 
struct  source
 
struct  addb2_service
 
struct  addb2_fom
 
struct  m0_addb2_sit
 
struct  frame
 
struct  m0_addb2_storage
 
struct  m0_addb2_storage_ops
 
struct  m0_addb2_frame_header
 
struct  m0_addb2_sys
 
struct  m0_addb2_config
 
struct  small_record
 

Macros

#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
 

Typedefs

typedef int(* m0_addb2__intrp_load_t) (uint64_t flags, struct m0_addb2__id_intrp **intrp)
 

Enumerations

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 }
 

Functions

 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 buffermach_buffer (struct m0_addb2_mach *mach)
 
static struct tentrymach_top (struct m0_addb2_mach *m)
 
static struct buffercur (struct m0_addb2_mach *mach, m0_bcount_t space)
 
static struct m0_addb2_machmach (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_machm0_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_sourcem0_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_modulem0_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_sourcem0_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_intrpid_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_sysm0_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_storagem0_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_itemsrc_get_item (struct m0_rpc_item_source *ris, m0_bcount_t size)
 
M0_INTERNAL struct m0_addb2_netm0_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_sourcem0_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 frameframe_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_machm0_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_machmach_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)
 

Variables

struct m0_addb2_mach *(* m0_addb2__mach )(void) = NULL
 
M0_INTERNAL uint64_t m0_addb2__dummy_payload [1] = {}
 
M0_INTERNAL uint64_t m0_addb2__dummy_payload_size
 
struct m0_addb2_trace_obj M0_XCA_DOMAIN
 
static const struct m0_addb2_sensor_ops sensor_ops
 
static const struct m0_addb2_sensor_ops list_sensor_ops
 
static const struct m0_addb2_sensor_ops clock_sensor_ops
 
static struct plugin plugins [PLUGINS_MAX]
 
static size_t plugins_nr
 
static struct m0_varr value_id
 
int optind
 
static bool flatten = false
 
static bool deflatten = false
 
static bool json_output = false
 
static const char * json_extra_data = NULL
 
static m0_bindex_t offset = 0
 
static int delay = 0
 
struct m0_sm_conf fom_states_conf
 
struct m0_sm_conf be_tx_sm_conf
 
struct m0_sm_conf m0_dtx_sm_conf
 
struct m0_sm_conf op_states_conf
 
struct m0_sm_conf m0_op_conf
 
struct m0_sm_conf dix_req_sm_conf
 
struct m0_sm_conf cas_req_sm_conf
 
struct m0_sm_conf io_sm_conf
 
struct m0_addb2__id_intrp ids []
 
struct m0_fom_typem0_fom__types [M0_OPCODES_NR]
 
static bfd * abfd
 
static asymbol ** syms
 
static uint64_t base
 
static size_t nr
 
static const struct m0_addb2_sensor_ops hist_ops
 
M0_EXTERN uint64_t m0_addb2__dummy_payload []
 
M0_EXTERN uint64_t m0_addb2__dummy_payload_size
 
M0_EXTERN const struct m0_fom_type_ops m0_addb2__fom_type_ops
 
M0_EXTERN const struct m0_sm_conf m0_addb2__sm_conf
 
static const struct m0_rpc_item_source_ops src_ops
 
static struct m0_fop_type net_fopt
 
static const struct m0_rpc_item_ops net_rpc_ops
 
static const m0_time_t IDLE_THRESHOLD = M0_MKTIME(10, 0)
 
static const struct m0_reqh_service_ops addb2_service_ops
 
static const struct m0_reqh_service_type_ops addb2_service_type_ops
 
static const struct m0_fom_ops addb2_fom_ops
 
M0_INTERNAL const struct m0_fom_type_ops m0_addb2__fom_type_ops
 
static struct m0_sm_state_descr addb2_fom_phases []
 
M0_INTERNAL const struct m0_sm_conf m0_addb2__sm_conf
 
M0_INTERNAL struct m0_reqh_service_type m0_addb2_service_type
 
M0_EXTERN struct m0_reqh_service_type m0_addb2_service_type
 
static const struct m0_format_tag frame_tag
 
M0_INTERNAL const uint64_t m0_addb2_stob_key = M0_ADDB2_STOB_KEY
 
static const struct m0_addb2_mach_ops sys_mach_ops
 
static const struct m0_addb2_storage_ops sys_stor_ops
 
void(* m0_addb2__sys_submit_trap )(struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj) = NULL
 
void(* m0_addb2__sys_ast_trap )(struct m0_addb2_sys *sys) = NULL
 
int submitted
 
int(* submit )(const struct m0_addb2_mach *mach, struct m0_addb2_trace *trace)
 
void(* idle )(const struct m0_addb2_mach *mach)
 
const struct m0_addb2_sensor_ops sensor_ops
 
const uint64_t SENSOR_MARKER
 
uint64_t seq
 
bool sensor_finalised
 
static const struct m0_addb2_config noqueue
 
static const struct m0_addb2_config queue
 
void(* m0_addb2__sys_submit_trap )(struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj)
 
void(* m0_addb2__sys_ast_trap )(struct m0_addb2_sys *sys)
 
static unsigned sys_submitted
 
static struct m0_semaphore ast_wait
 
struct m0_ut_suite addb2_sys_ut
 

Detailed Description

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().

Macro Definition Documentation

◆ COUNTER

#define COUNTER   &counter, &skip, &skip, &skip, &skip, &skip, &skip

Definition at line 1067 of file dump.c.

◆ 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"

Definition at line 165 of file dump.c.

◆ FID

#define FID   &fid, &skip

Definition at line 1068 of file dump.c.

◆ HEADER_XO

#define HEADER_XO (   h)
Value:
&(struct m0_xcode_obj) { \
.xo_type = m0_addb2_frame_header_xc, \
.xo_ptr = (h) \
}

Definition at line 34 of file internal.h.

◆ HIST

#define HIST
Value:
&hist, &skip, &skip, &skip, &skip, &skip, &skip, &skip, &skip, \
&skip, &skip, &skip, &skip, &skip, &skip
static void hist(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:729
static void skip(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:465

Definition at line 1070 of file dump.c.

◆ M0_ADDB2__PLUGIN_FUNC_NAME

#define M0_ADDB2__PLUGIN_FUNC_NAME   "m0_addb2_load_interps"

addb2dump plugin function name

Definition at line 71 of file addb2_internal.h.

◆ M0_ADDB2_ADD

#define M0_ADDB2_ADD (   id,
  ... 
)
Value:
m0_addb2_add(id, ARRAY_SIZE(((uint64_t[]){ __VA_ARGS__ })), \
(const uint64_t[]){ __VA_ARGS__ })
void m0_addb2_add(uint64_t id, int n, const uint64_t *value)
Definition: addb2.c:466
#define ARRAY_SIZE(a)
Definition: misc.h:45

Helper macro for m0_addb2_add().

Possible uses:

M0_ADDB2_ADD(IO_COMPLETION, io->i_byte_count, io->i_rc, m0_time_now());
M0_ADDB2_ADD(RARE_BRANCH_TAKEN);

Definition at line 252 of file addb2.h.

◆ M0_ADDB2_HIST

#define M0_ADDB2_HIST (   id,
  hist,
  datum,
  ... 
)
Value:
do { \
struct m0_addb2_hist *__hist = (hist); \
M0_ADDB2_TIMED_0((id), (datum), __VA_ARGS__); \
if (__hist != NULL) \
m0_addb2_hist_mod_with(__hist, __duration, __datum); \
} while (0)
#define NULL
Definition: misc.h:38
static void hist(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:729

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:
m0_addb2_push(id, ARRAY_SIZE(((uint64_t[]){ __VA_ARGS__ })), \
(const uint64_t[]){ __VA_ARGS__ })
void m0_addb2_push(uint64_t id, int n, const uint64_t *value)
Definition: addb2.c:412
#define ARRAY_SIZE(a)
Definition: misc.h:45

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 { \
struct m0_addb2_counter *__counter = (counter); \
M0_ADDB2_TIMED_0((id), (datum), __VA_ARGS__); \
if (__counter != NULL) \
m0_addb2_counter_mod_with(__counter, __duration, __datum); \
} while (0)
#define NULL
Definition: misc.h:38
static int counter
Definition: mutex.c:32

Definition at line 91 of file counter.h.

◆ M0_ADDB2_TIMED_0

#define M0_ADDB2_TIMED_0 (   id,
  datum,
  ... 
)
Value:
m0_time_t __start = m0_time_now(); \
m0_time_t __end; \
m0_time_t __duration; \
uint64_t __datum = (datum); \
uint64_t __id = (id); \
__VA_ARGS__; \
__end = m0_time_now(); \
__duration = (__end - __start) >> 10; \
if (__id != 0) \
M0_ADDB2_ADD(__id, __duration, __datum); \
uint64_t id
Definition: cob.h:2380
uint64_t m0_time_t
Definition: time.h:37
m0_time_t m0_time_now(void)
Definition: time.c:134

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

Definition at line 29 of file service.c.

◆ M0_TRACE_SUBSYSTEM [2/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 29 of file global.c.

◆ M0_TRACE_SUBSYSTEM [3/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 29 of file histogram.c.

◆ 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

Definition at line 30 of file consumer.c.

◆ M0_TRACE_SUBSYSTEM [6/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 208 of file counter.c.

◆ M0_TRACE_SUBSYSTEM [7/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 30 of file kaddb2.c.

◆ M0_TRACE_SUBSYSTEM [8/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 32 of file uaddb2.c.

◆ 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

Definition at line 63 of file storage.c.

◆ M0_TRACE_SUBSYSTEM [13/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 126 of file addb2.c.

◆ M0_TRACE_SUBSYSTEM [14/14]

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB

Definition at line 208 of file counter.c.

◆ 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

#define SKIP2   &skip, &skip

Definition at line 1072 of file dump.c.

◆ SYS

#define SYS ( )    (m0_addb2_module_get()->am_sys)

Definition at line 41 of file global.c.

◆ TIMED

#define TIMED   &duration, &sym

Definition at line 1069 of file dump.c.

◆ TRACE_XO

#define TRACE_XO (   t)
Value:
&(struct m0_xcode_obj) { \
.xo_type = m0_addb2_trace_xc, \
.xo_ptr = (t) \
}
static struct m0_thread t[8]
Definition: service_ut.c:1230

Definition at line 39 of file internal.h.

◆ U64

#define U64   "%16"PRIx64

Definition at line 1311 of file dump.c.

◆ VAL

#define VAL (   id,
  ... 
)
Value:
{ \
.va_id = (id), \
.va_nr = ARRAY_SIZE(((const uint64_t[]) { __VA_ARGS__ })), \
.va_data = ((const uint64_t[]) { __VA_ARGS__ } ) \
}
uint64_t id
Definition: cob.h:2380
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 62 of file common.h.

Typedef Documentation

◆ m0_addb2__intrp_load_t

typedef int(* m0_addb2__intrp_load_t) (uint64_t flags, struct m0_addb2__id_intrp **intrp)

Definition at line 73 of file addb2_internal.h.

Enumeration Type Documentation

◆ anonymous enum

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

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

anonymous enum
Enumerator
ADDB2_CONSUME 
ADDB2_DONE 
ADDB2_SUBMIT 

Definition at line 135 of file service.c.

◆ anonymous enum

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

anonymous enum
Enumerator
M0_ADDB2_STOB_KEY 

Definition at line 266 of file storage.c.

◆ anonymous enum

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
Enumerator

Definition at line 122 of file sys.c.

◆ anonymous enum

anonymous enum
Enumerator
M0_ADDB2__FIELD_MAX 

Definition at line 50 of file addb2_internal.h.

◆ 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

anonymous enum
Enumerator
M0_ADDB2_COUNTER_VALS 

Definition at line 49 of file counter.h.

◆ anonymous enum

anonymous enum
Enumerator
BUF_SIZE 
PLUGINS_MAX 

Definition at line 98 of file dump.c.

◆ anonymous enum

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

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

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.

Function Documentation

◆ _add()

static void _add ( const struct m0_addb2_config conf,
unsigned  nr 
)
static

Definition at line 172 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _clock()

static void _clock ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 481 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_loop()

static void add_loop ( const struct m0_addb2_config conf)
static

Definition at line 195 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addb2_done()

static void addb2_done ( struct m0_addb2_trace_obj obj)
static

Definition at line 190 of file service.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addb2_fom_create()

static int addb2_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)
static

Definition at line 120 of file service.c.

Here is the call graph for this function:

◆ addb2_fom_fini()

static void addb2_fom_fini ( struct m0_fom fom0)
static

Definition at line 182 of file service.c.

Here is the call graph for this function:

◆ addb2_fom_home_locality()

static size_t addb2_fom_home_locality ( const struct m0_fom fom)
static

Definition at line 196 of file service.c.

◆ addb2_fom_tick()

static int addb2_fom_tick ( struct m0_fom fom0)
static

Definition at line 141 of file service.c.

Here is the call graph for this function:

◆ addb2_force_loc()

static void addb2_force_loc ( struct m0_locality loc)
static

Definition at line 608 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addb2_force_loc_cb()

static int addb2_force_loc_cb ( void *  unused)
static

Definition at line 602 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addb2_service_fini()

static void addb2_service_fini ( struct m0_reqh_service service)
static

Definition at line 95 of file service.c.

Here is the call graph for this function:

◆ addb2_service_start()

static int addb2_service_start ( struct m0_reqh_service service)
static

Definition at line 82 of file service.c.

Here is the call graph for this function:

◆ addb2_service_stop()

static void addb2_service_stop ( struct m0_reqh_service service)
static

Definition at line 88 of file service.c.

Here is the call graph for this function:

◆ addb2_service_type_allocate()

static int addb2_service_type_allocate ( struct m0_reqh_service **  service,
const struct m0_reqh_service_type stype 
)
static

Definition at line 104 of file service.c.

Here is the call graph for this function:

◆ ast_trap()

static void ast_trap ( struct m0_addb2_sys sys)
static

Definition at line 225 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asymbol_cmp()

static int asymbol_cmp ( const void *  a0,
const void *  a1 
)
static

Definition at line 1507 of file dump.c.

Here is the caller graph for this function:

◆ attr()

static void attr ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

v[0] - attr name v[1] - attr val

Definition at line 949 of file dump.c.

Here is the call graph for this function:

◆ beop_state_counter()

static void beop_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 866 of file dump.c.

Here is the call graph for this function:

◆ bol()

static void bol ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 449 of file dump.c.

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_alloc()

static int buffer_alloc ( struct m0_addb2_mach mach)
static

Allocates new trace buffer.

Definition at line 1014 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_fini()

static void buffer_fini ( struct buffer buffer)
static

Definition at line 1036 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_space()

static m0_bcount_t buffer_space ( const struct buffer buffer)
static

Returns the number of free bytes in the buffer.

Definition at line 1003 of file addb2.c.

Here is the caller graph for this function:

◆ bulk_op_state()

static void bulk_op_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 930 of file dump.c.

Here is the call graph for this function:

◆ cas_op_state()

static void cas_op_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 896 of file dump.c.

Here is the call graph for this function:

◆ cas_state_counter()

static void cas_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 902 of file dump.c.

Here is the call graph for this function:

◆ clock_counter_snapshot()

static void clock_counter_snapshot ( struct m0_addb2_sensor s,
uint64_t *  area 
)
static

Definition at line 185 of file counter.c.

◆ cob_req_state()

static void cob_req_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 919 of file dump.c.

◆ context_fill()

static void context_fill ( struct m0_addb2__context ctx,
const struct m0_addb2_value val 
)
static

Definition at line 1489 of file dump.c.

Here is the caller graph for this function:

◆ count_nonempty_vals()

static unsigned int count_nonempty_vals ( const struct m0_addb2_value val)
static

Definition at line 1348 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counter()

static void counter ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 683 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counter_ctor()

static int counter_ctor ( void *  area,
void *  datum 
)
static

Definition at line 195 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counter_dtor()

static void counter_dtor ( void *  area,
void *  datum 
)
static

Definition at line 202 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counter_fini()

static void counter_fini ( struct m0_addb2_sensor s)
static

Definition at line 145 of file counter.c.

◆ counter_warn()

static void counter_warn ( struct m0_addb2_counter c,
uint64_t  val 
)
static

Definition at line 153 of file counter.c.

Here is the caller graph for this function:

◆ cur()

static struct buffer * cur ( struct m0_addb2_mach mach,
m0_bcount_t  space 
)
static

Returns current buffer with at least "space" bytes free.

Definition at line 791 of file addb2.c.

Here is the call graph for this function:

◆ dec()

static void dec ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 408 of file dump.c.

Here is the caller graph for this function:

◆ deflate()

static void deflate ( void  )
static

Definition at line 1585 of file dump.c.

Here is the caller graph for this function:

◆ dix_op_state()

static void dix_op_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 884 of file dump.c.

Here is the call graph for this function:

◆ dix_state_counter()

static void dix_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 890 of file dump.c.

Here is the call graph for this function:

◆ dtx0_state()

static void dtx0_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 848 of file dump.c.

Here is the call graph for this function:

◆ dtx0_state_counter()

static void dtx0_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 859 of file dump.c.

Here is the call graph for this function:

◆ duration()

static void duration ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 503 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fid()

static void fid ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 454 of file dump.c.

Here is the caller graph for this function:

◆ 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

Definition at line 356 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_one()

int fill_one ( struct m0_addb2_mach m)

Definition at line 117 of file common.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flate()

static void flate ( void  )
static

Definition at line 1596 of file dump.c.

Here is the caller graph for this function:

◆ fom_phase()

static void fom_phase ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 590 of file dump.c.

Here is the call graph for this function:

◆ fom_state()

static void fom_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 584 of file dump.c.

Here is the call graph for this function:

◆ fom_state_counter()

static void fom_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 786 of file dump.c.

Here is the call graph for this function:

◆ fom_type()

static void fom_type ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 516 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fop_counter()

static void fop_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 791 of file dump.c.

Here is the call graph for this function:

◆ frame_clear()

static void frame_clear ( struct frame frame)
static

Re-initialises the frame.

Definition at line 762 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frame_cur()

static struct frame * frame_cur ( const struct m0_addb2_storage stor)
static

Returns current frame.

Definition at line 742 of file storage.c.

Here is the caller graph for this function:

◆ frame_done()

static void frame_done ( struct frame frame)
static

Invokes frame completion call-backs.

Definition at line 833 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frame_fini()

static void frame_fini ( struct frame frame)
static

Definition at line 622 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frame_idle()

static void frame_idle ( struct frame frame)
static

Moves the frame to the idle list.

This is done after IO completes (frame_endio()) or fails to start (frame_submit()).

Definition at line 753 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ frame_init()

static int frame_init ( struct frame frame,
struct m0_addb2_storage stor 
)
static

Initialises a frame.

Definition at line 580 of file storage.c.

Here is the call graph for this function:

◆ frame_invariant()

static bool frame_invariant ( const struct frame frame)
static

Definition at line 863 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hbar()

static void hbar ( char *  buf,
uint32_t  val,
uint32_t  m 
)
static

Definition at line 718 of file dump.c.

Here is the caller graph for this function:

◆ header_is_valid()

static bool header_is_valid ( const struct m0_addb2_sit it,
const struct m0_addb2_frame_header h 
)
static

Definition at line 409 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ header_next()

static m0_bindex_t header_next ( const struct m0_addb2_sit it,
const struct m0_addb2_frame_header h 
)
static

Returns offset of the next header.

Definition at line 388 of file sit.c.

Here is the caller graph for this function:

◆ header_read()

static int header_read ( struct m0_addb2_sit it,
struct m0_addb2_frame_header h,
m0_bindex_t  offset 
)
static

Reads the header at the given offset.

Definition at line 264 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hex()

static void hex ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 413 of file dump.c.

Here is the caller graph for this function:

◆ hex0x()

static void hex0x ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 422 of file dump.c.

◆ hist()

static void hist ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 729 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hist_fini()

static void hist_fini ( struct m0_addb2_sensor s)
static

Definition at line 116 of file histogram.c.

◆ hist_snapshot()

static void hist_snapshot ( struct m0_addb2_sensor s,
uint64_t *  area 
)
static

Definition at line 103 of file histogram.c.

Here is the call graph for this function:

◆ id_fini()

static void id_fini ( void  )
static

Definition at line 1267 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id_get()

static struct m0_addb2__id_intrp * id_get ( uint64_t  id)
static

Definition at line 1298 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id_init()

static void id_init ( void  )
static

Definition at line 1245 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id_matches()

static bool id_matches ( struct m0_addb2_philter philter,
const struct m0_addb2_record rec 
)
static

Definition at line 176 of file consumer.c.

Here is the caller graph for this function:

◆ id_set()

static void id_set ( struct m0_addb2__id_intrp intrp)
static

Definition at line 1272 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id_set_nr()

static void id_set_nr ( struct m0_addb2__id_intrp intrp,
int  nr 
)
static

Definition at line 1284 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_fini()

static void init_fini ( void  )
static

Definition at line 59 of file sys.c.

Here is the call graph for this function:

◆ intrps_equal()

static bool intrps_equal ( const struct m0_addb2__id_intrp intrp0,
const struct m0_addb2__id_intrp intrp1 
)
static

Definition at line 350 of file dump.c.

Here is the caller graph for this function:

◆ ioo_req_state()

static void ioo_req_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 908 of file dump.c.

Here is the call graph for this function:

◆ ioo_state_counter()

static void ioo_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 914 of file dump.c.

Here is the call graph for this function:

◆ it_alloc()

static int it_alloc ( struct m0_addb2_sit it,
struct m0_stob stob 
)
static

Definition at line 236 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_free()

static void it_free ( struct m0_addb2_sit it)
static

Definition at line 255 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_init()

static int it_init ( struct m0_addb2_sit it,
struct m0_addb2_frame_header h,
m0_bindex_t  start 
)
static

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_invariant()

static bool it_invariant ( const struct m0_addb2_sit it)
static

Definition at line 425 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_is_in()

static bool it_is_in ( const struct m0_addb2_sit it,
m0_bindex_t  index 
)
static

Definition at line 404 of file sit.c.

Here is the caller graph for this function:

◆ it_load()

static int it_load ( struct m0_addb2_sit it)
static

Loads a frame.

Definition at line 362 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_next()

static int it_next ( struct m0_addb2_sit it,
struct m0_addb2_record **  out 
)
static

Moves the iterator to the next record once the current trace buffer has been exhausted.

Definition at line 292 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_read()

static int it_read ( const struct m0_addb2_sit it,
void *  buf,
m0_bindex_t  offset,
m0_bcount_t  count 
)
static

Reads given stob extent in the buffer.

Definition at line 439 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_rec()

static void it_rec ( struct m0_addb2_sit it,
struct m0_addb2_record **  out 
)
static

Produces a surrogate addb record indicating internal boundary in the storage stream.

Definition at line 332 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_rounded()

static bool it_rounded ( const struct m0_addb2_sit it,
m0_bindex_t  index 
)
static

Definition at line 399 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ it_trace_set()

static void it_trace_set ( struct m0_addb2_sit it)
static

Initialises internal trace buffer.

Definition at line 462 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ libbfd_fini()

static void libbfd_fini ( void  )
static

Definition at line 1544 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ libbfd_init()

static void libbfd_init ( const char *  libpath)
static

Initialises bfd.

Definition at line 1518 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ libbfd_resolve()

static void libbfd_resolve ( uint64_t  delta,
char *  buf 
)
static

Definition at line 1549 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ list_counter_snapshot()

static void list_counter_snapshot ( struct m0_addb2_sensor s,
uint64_t *  area 
)
static

Definition at line 173 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2__counter_data_init()

M0_INTERNAL void m0_addb2__counter_data_init ( struct m0_addb2_counter_data d)

Definition at line 167 of file counter.c.

Here is the caller graph for this function:

◆ m0_addb2__counter_snapshot()

M0_INTERNAL void m0_addb2__counter_snapshot ( struct m0_addb2_sensor s,
uint64_t *  area 
)

Definition at line 135 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2__mach_print()

M0_INTERNAL void m0_addb2__mach_print ( const struct m0_addb2_mach m)

Definition at line 1139 of file addb2.c.

Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_callback_add()

void m0_addb2_callback_add ( struct m0_addb2_philter ph,
struct m0_addb2_callback callback 
)

Definition at line 114 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_callback_del()

void m0_addb2_callback_del ( struct m0_addb2_callback callback)

Definition at line 120 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_callback_fini()

void m0_addb2_callback_fini ( struct m0_addb2_callback callback)

Definition at line 109 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_callback_init()

void m0_addb2_callback_init ( struct m0_addb2_callback callback,
void(*)(const struct m0_addb2_source *, const struct m0_addb2_philter *, const struct m0_addb2_callback *, const struct m0_addb2_record *)  fire,
void *  datum 
)

Definition at line 97 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_clock_add()

void m0_addb2_clock_add ( struct m0_addb2_sensor clock,
uint64_t  label,
int  idx 
)

Definition at line 109 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_clock_del()

void m0_addb2_clock_del ( struct m0_addb2_sensor clock)

Definition at line 114 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2_consume()

void m0_addb2_consume ( struct m0_addb2_source src,
const struct m0_addb2_record rec 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_counter_add()

void m0_addb2_counter_add ( struct m0_addb2_counter counter,
uint64_t  label,
int  idx 
)

Definition at line 48 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_counter_del()

void m0_addb2_counter_del ( struct m0_addb2_counter counter)

Definition at line 61 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_counter_mod()

void m0_addb2_counter_mod ( struct m0_addb2_counter counter,
int64_t  val 
)

Definition at line 66 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2_counter_mod_with()

void m0_addb2_counter_mod_with ( struct m0_addb2_counter counter,
int64_t  val,
uint64_t  datum 
)

Definition at line 71 of file counter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_cursor_fini()

void m0_addb2_cursor_fini ( struct m0_addb2_cursor cur)

Definition at line 699 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_cursor_init()

void m0_addb2_cursor_init ( struct m0_addb2_cursor cur,
const struct m0_addb2_trace trace 
)

Definition at line 690 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_cursor_next()

int m0_addb2_cursor_next ( struct m0_addb2_cursor cur)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_cursor_source()

struct m0_addb2_source * m0_addb2_cursor_source ( struct m0_addb2_cursor c)

Definition at line 125 of file consumer.c.

◆ m0_addb2_force()

void m0_addb2_force ( m0_time_t  delay)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_force_all()

void m0_addb2_force_all ( void  )

Definition at line 613 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_global_fini()

M0_INTERNAL void m0_addb2_global_fini ( void  )

Definition at line 90 of file global.c.

Here is the call graph for this function:

◆ m0_addb2_global_get()

M0_INTERNAL struct m0_addb2_sys * m0_addb2_global_get ( void  )

Definition at line 99 of file global.c.

Here is the caller graph for this function:

◆ m0_addb2_global_init()

M0_INTERNAL int m0_addb2_global_init ( void  )

Definition at line 75 of file global.c.

Here is the call graph for this function:

◆ m0_addb2_global_thread_enter()

M0_INTERNAL void m0_addb2_global_thread_enter ( void  )

Definition at line 43 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_global_thread_leave()

M0_INTERNAL void m0_addb2_global_thread_leave ( void  )

Definition at line 58 of file global.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 
)

Definition at line 36 of file histogram.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_hist_add_auto()

void m0_addb2_hist_add_auto ( struct m0_addb2_hist hist,
int  skip,
uint64_t  label,
int  idx 
)

Definition at line 50 of file histogram.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_hist_bucket()

int m0_addb2_hist_bucket ( const struct m0_addb2_hist hist,
int64_t  val 
)

Definition at line 87 of file histogram.c.

Here is the caller graph for this function:

◆ m0_addb2_hist_del()

void m0_addb2_hist_del ( struct m0_addb2_hist hist)

Definition at line 63 of file histogram.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_hist_mod()

void m0_addb2_hist_mod ( struct m0_addb2_hist hist,
int64_t  val 
)

Definition at line 68 of file histogram.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_hist_mod_with()

void m0_addb2_hist_mod_with ( struct m0_addb2_hist hist,
int64_t  val,
uint64_t  datum 
)

Definition at line 73 of file histogram.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_list_counter_add()

void m0_addb2_list_counter_add ( struct m0_addb2_list_counter counter,
struct m0_tl list,
uint64_t  label,
int  idx 
)

Definition at line 96 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2_list_counter_del()

void m0_addb2_list_counter_del ( struct m0_addb2_list_counter counter)

Definition at line 104 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2_load_interps()

int m0_addb2_load_interps ( uint64_t  flags,
struct m0_addb2__id_intrp **  intrp 
)

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()

int m0_addb2_local_counter_init ( struct m0_addb2_local_counter lc,
uint64_t  id,
uint64_t  counter 
)

Definition at line 119 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2_local_counter_mod()

void m0_addb2_local_counter_mod ( struct m0_addb2_local_counter lc,
uint64_t  val,
uint64_t  datum 
)

Definition at line 129 of file counter.c.

Here is the call graph for this function:

◆ m0_addb2_mach_cookie()

void * m0_addb2_mach_cookie ( const struct m0_addb2_mach mach)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_mach_fini()

void m0_addb2_mach_fini ( struct m0_addb2_mach mach)

Finalises a machine.

Precondition
The machine must be idle.

Definition at line 560 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_mach_init()

struct m0_addb2_mach * m0_addb2_mach_init ( const struct m0_addb2_mach_ops ops,
void *  cookie 
)

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
cookie- an opaque pointer, returned by m0_addb2_mach_cookie().

Definition at line 521 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_mach_source()

struct m0_addb2_source * m0_addb2_mach_source ( struct m0_addb2_mach m)

Definition at line 678 of file addb2.c.

Here is the caller graph for this function:

◆ m0_addb2_mach_stop()

void m0_addb2_mach_stop ( struct m0_addb2_mach mach)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_mach_wait()

void m0_addb2_mach_wait ( struct m0_addb2_mach mach)

Waits until stopped machine becomes idle.

Definition at line 639 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_module_fini()

void m0_addb2_module_fini ( void  )

Definition at line 783 of file addb2.c.

Here is the call graph for this function:

◆ m0_addb2_module_get()

M0_INTERNAL struct m0_addb2_module * m0_addb2_module_get ( void  )

Definition at line 765 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_module_init()

int m0_addb2_module_init ( void  )

Definition at line 770 of file addb2.c.

Here is the call graph for this function:

◆ m0_addb2_net__is_not_locked()

M0_INTERNAL bool m0_addb2_net__is_not_locked ( const struct m0_addb2_net net)

Definition at line 266 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_net_add()

M0_INTERNAL int m0_addb2_net_add ( struct m0_addb2_net net,
struct m0_rpc_conn conn 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_net_del()

M0_INTERNAL void m0_addb2_net_del ( struct m0_addb2_net net,
struct m0_rpc_conn conn 
)

Deletes the connection.

See also
m0_addb2_net_add().

Definition at line 192 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_net_fini()

M0_INTERNAL void m0_addb2_net_fini ( struct m0_addb2_net net)

Definition at line 142 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_net_module_fini()

M0_INTERNAL void m0_addb2_net_module_fini ( void  )

Definition at line 284 of file net.c.

Here is the call graph for this function:

◆ m0_addb2_net_module_init()

M0_INTERNAL int m0_addb2_net_module_init ( void  )

Definition at line 271 of file net.c.

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_net_submit()

M0_INTERNAL int m0_addb2_net_submit ( struct m0_addb2_net net,
struct m0_addb2_trace_obj obj 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_philter_add()

void m0_addb2_philter_add ( struct m0_addb2_source src,
struct m0_addb2_philter ph 
)

Adds a philter to a source.

Definition at line 86 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_philter_del()

void m0_addb2_philter_del ( struct m0_addb2_philter ph)

Removes a philter from the source.

Definition at line 92 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_philter_fini()

void m0_addb2_philter_fini ( struct m0_addb2_philter philter)

Definition at line 78 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_philter_global_add()

void m0_addb2_philter_global_add ( struct m0_addb2_philter ph)

Adds a global philter that will be matched with every records produced by any addb2 machine.

Definition at line 182 of file consumer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_philter_global_del()

void m0_addb2_philter_global_del ( struct m0_addb2_philter ph)

Removes a global philter.

Definition at line 196 of file consumer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_philter_id_init()

void m0_addb2_philter_id_init ( struct m0_addb2_philter ph,
uint64_t  id 
)

Sets up a philter matching records with a given measurement identifier.

Definition at line 165 of file consumer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_philter_init()

void m0_addb2_philter_init ( struct m0_addb2_philter philter,
bool(*)(struct m0_addb2_philter *, const struct m0_addb2_record *)  matches,
void *  datum 
)

Definition at line 67 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_philter_true_init()

void m0_addb2_philter_true_init ( struct m0_addb2_philter ph)

Sets up a philter which identically true predicate function.

This philter matches all records.

Definition at line 160 of file consumer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_pop()

void m0_addb2_pop ( uint64_t  id)

Removes the top-most label in the current context stack.

Parameters
id- label identifier
Precondition
"id" must the identifier of the top-most label.
(id & 0xff00000000000000ull) == 0

Definition at line 440 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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:

m0_addb2_add(FOP_FID, 2, fid);
Precondition
(id & 0xff00000000000000ull) == 0

Definition at line 412 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sensor_add()

void m0_addb2_sensor_add ( struct m0_addb2_sensor s,
uint64_t  id,
unsigned  nr,
int  idx,
const struct m0_addb2_sensor_ops ops 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sensor_del()

void m0_addb2_sensor_del ( struct m0_addb2_sensor s)

Deletes a sensor.

Definition at line 504 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_service_module_fini()

M0_INTERNAL void m0_addb2_service_module_fini ( void  )

Definition at line 77 of file service.c.

Here is the call graph for this function:

◆ m0_addb2_service_module_init()

M0_INTERNAL int m0_addb2_service_module_init ( void  )

Definition at line 72 of file service.c.

Here is the call graph for this function:

◆ m0_addb2_sit_fini()

void m0_addb2_sit_fini ( struct m0_addb2_sit it)

Definition at line 139 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sit_init()

int m0_addb2_sit_init ( struct m0_addb2_sit **  out,
struct m0_stob stob,
m0_bindex_t  start 
)

Allocates and initialises storage trace iterator.

Definition at line 108 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sit_next()

int m0_addb2_sit_next ( struct m0_addb2_sit it,
struct m0_addb2_record **  out 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sit_source()

struct m0_addb2_source * m0_addb2_sit_source ( struct m0_addb2_sit it)

Returns the record source embedded in the iterator.

Definition at line 173 of file sit.c.

Here is the call graph for this function:

◆ m0_addb2_source_fini()

void m0_addb2_source_fini ( struct m0_addb2_source src)

Definition at line 60 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_source_init()

void m0_addb2_source_init ( struct m0_addb2_source src)

Definition at line 55 of file consumer.c.

Here is the caller graph for this function:

◆ m0_addb2_storage__is_not_locked()

M0_INTERNAL bool m0_addb2_storage__is_not_locked ( const struct m0_addb2_storage stor)

Definition at line 70 of file kaddb2.c.

Here is the caller graph for this function:

◆ m0_addb2_storage_cookie()

M0_INTERNAL void * m0_addb2_storage_cookie ( const struct m0_addb2_storage stor)

Returns the cookie passed to m0_addb2_storage_init().

Definition at line 57 of file kaddb2.c.

Here is the caller graph for this function:

◆ m0_addb2_storage_fini()

M0_INTERNAL void m0_addb2_storage_fini ( struct m0_addb2_storage stor)

Finalises an idle storage machine.

Definition at line 63 of file kaddb2.c.

Here is the caller graph for this function:

◆ m0_addb2_storage_header()

M0_INTERNAL int m0_addb2_storage_header ( struct m0_stob stob,
struct m0_addb2_frame_header h 
)

Returns the header of the latest frame recorded on the stob.

Definition at line 179 of file sit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_storage_init()

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 
)

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.

Here is the caller graph for this function:

◆ m0_addb2_storage_stop()

M0_INTERNAL void m0_addb2_storage_stop ( struct m0_addb2_storage stor)

Initiates storage machine stopping.

New traces are not accepted any more. Once the last trace is processed, m0_addb2_storage_ops::sto_idle() is invoked.

Definition at line 66 of file kaddb2.c.

Here is the caller graph for this function:

◆ m0_addb2_storage_submit()

M0_INTERNAL int m0_addb2_storage_submit ( struct m0_addb2_storage stor,
struct m0_addb2_trace_obj obj 
)

Submits a trace to storage.

Definition at line 50 of file kaddb2.c.

Here is the caller graph for this function:

◆ m0_addb2_sys_attach()

void m0_addb2_sys_attach ( struct m0_addb2_sys sys,
struct m0_addb2_sys src 
)

Sets "sys" to use the same back-ends as "src".

Definition at line 408 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_counter_add()

void m0_addb2_sys_counter_add ( struct m0_addb2_sys sys,
struct m0_addb2_counter counter,
uint64_t  id 
)

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.

Here is the call graph for this function:

◆ m0_addb2_sys_detach()

void m0_addb2_sys_detach ( struct m0_addb2_sys sys)

Resets "sys" back-ends to NULL.

Definition at line 416 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_fini()

void m0_addb2_sys_fini ( struct m0_addb2_sys sys)

Definition at line 214 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_get()

struct m0_addb2_mach * m0_addb2_sys_get ( struct m0_addb2_sys sys)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_init()

int m0_addb2_sys_init ( struct m0_addb2_sys **  sys,
const struct m0_addb2_config conf 
)

Initalises a sys object.

The sys object will produce (m0_addb2_sys_get()) addb2 machines matching the given configuration.

‘addb2’ subsystem is initialised before locales are. Disable posting of ASTs until m0_addb2_sys_sm_start() is called.

See also
m0_sm_ast_wait_post(), m0_addb2_sys_sm_start()

Definition at line 176 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_net_start()

int m0_addb2_sys_net_start ( struct m0_addb2_sys sys)

Enables network back-end processing.

Definition at line 312 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_net_start_with()

int m0_addb2_sys_net_start_with ( struct m0_addb2_sys sys,
struct m0_tl head 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_net_stop()

void m0_addb2_sys_net_stop ( struct m0_addb2_sys sys)

Disables network back-end processing.

Definition at line 322 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_put()

void m0_addb2_sys_put ( struct m0_addb2_sys sys,
struct m0_addb2_mach mach 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_sm_start()

void m0_addb2_sys_sm_start ( struct m0_addb2_sys sys)

Enables ASTs for back-end processing.

Definition at line 377 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_sm_stop()

void m0_addb2_sys_sm_stop ( struct m0_addb2_sys sys)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_stor_stop()

void m0_addb2_sys_stor_stop ( struct m0_addb2_sys sys)

Disables storage back-end processing.

Definition at line 370 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_sys_submit()

int m0_addb2_sys_submit ( struct m0_addb2_sys sys,
struct m0_addb2_trace_obj obj 
)

A function usable as m0_addb2_mach_ops::apo_submit() call-back.

Definition at line 392 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_trace_done()

void m0_addb2_trace_done ( const struct m0_addb2_trace trace)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_addb2_trace_size()

M0_INTERNAL m0_bcount_t m0_addb2_trace_size ( const struct m0_addb2_trace trace)

Definition at line 683 of file addb2.c.

Here is the caller graph for this function:

◆ M0_BASSERT() [1/2]

M0_BASSERT ( M0_ADDB2_HIST_BUCKETS >=  2)

◆ M0_BASSERT() [2/2]

M0_BASSERT ( BUFFER_SIZE  ,
M0_ADDB2_LABEL_MAX *3 *  sizeofuint64_t 
)

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  )

Finalises DIX re-balance FOP and reply FOP types.

See also
m0_dix_cpx_fini()

Definition at line 84 of file rebalance_cp_onwire.c.

Here is the caller graph for this function:

◆ m0_dix_cm_rebalance_cpx_init()

void m0_dix_cm_rebalance_cpx_init ( void  )

Initialises DIX re-balance FOP and reply FOP types.

See also
m0_dix_cpx_init()

Definition at line 63 of file rebalance_cp_onwire.c.

Here is the caller graph for this function:

◆ m0_dix_cm_repair_cpx_fini()

void m0_dix_cm_repair_cpx_fini ( void  )

Finalises DIX repair FOP and reply FOP types.

See also
m0_dix_cpx_fini()

Definition at line 83 of file repair_cp_onwire.c.

Here is the caller graph for this function:

◆ m0_dix_cm_repair_cpx_init()

void m0_dix_cm_repair_cpx_init ( void  )

Initialises DIX rerepair FOP and reply FOP types.

See also
m0_dix_cpx_init()

Definition at line 62 of file repair_cp_onwire.c.

Here is the caller graph for this function:

◆ M0_TL_DECLARE() [1/2]

M0_TL_DECLARE ( tr  ,
M0_INTERNAL  ,
struct m0_addb2_trace_obj   
)

◆ M0_TL_DECLARE() [2/2]

M0_TL_DECLARE ( mach  ,
M0_INTERNAL  ,
struct m0_addb2_mach   
)

◆ M0_TL_DEFINE() [1/8]

M0_TL_DEFINE ( philter  ,
static  ,
struct m0_addb2_philter   
)

◆ M0_TL_DEFINE() [2/8]

M0_TL_DEFINE ( callback  ,
static  ,
struct m0_addb2_callback   
)

◆ M0_TL_DEFINE() [3/8]

M0_TL_DEFINE ( src  ,
static  ,
struct source   
)

◆ M0_TL_DEFINE() [4/8]

M0_TL_DEFINE ( frame  ,
static  ,
struct frame   
)

◆ M0_TL_DEFINE() [5/8]

M0_TL_DEFINE ( tr  ,
M0_INTERNAL  ,
struct m0_addb2_trace_obj   
)

◆ M0_TL_DEFINE() [6/8]

M0_TL_DEFINE ( buf  ,
static  ,
struct buffer   
)

◆ M0_TL_DEFINE() [7/8]

M0_TL_DEFINE ( sensor  ,
static  ,
struct m0_addb2_sensor   
)

◆ M0_TL_DEFINE() [8/8]

M0_TL_DEFINE ( mach  ,
M0_INTERNAL  ,
struct m0_addb2_mach   
)

◆ 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 ( philter  ,
"addb2 source philters"  ,
static  ,
struct m0_addb2_philter  ,
ph_linkage  ,
ph_magix  ,
M0_ADDB2_PHILTER_MAGIC  ,
M0_ADDB2_PHILTER_HEAD_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [2/8]

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_DESCR_DEFINE() [3/8]

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_DESCR_DEFINE() [4/8]

M0_TL_DESCR_DEFINE ( frame  ,
"addb2 frames"  ,
static  ,
struct frame  ,
f_linkage  ,
f_magix  ,
M0_ADDB2_FRAME_MAGIC  ,
M0_ADDB2_FRAME_HEAD_MAGIC   
)

List of frames in storage machine. A frame is either in idle (m0_addb2_storage::as_idle) or in-flight (m0_addb2_storage::as_inflight).

◆ M0_TL_DESCR_DEFINE() [5/8]

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   
)

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 ( buf  ,
"addb2 buffers"  ,
static  ,
struct buffer  ,
b_linkage  ,
b_magix  ,
M0_ADDB2_BUF_MAGIC  ,
M0_ADDB2_BUF_HEAD_MAGIC   
)

List of buffers. Used to link traces into m0_addb2_mach lists.

◆ M0_TL_DESCR_DEFINE() [7/8]

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   
)

List of sensors, associated with a label.

◆ M0_TL_DESCR_DEFINE() [8/8]

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   
)

List of addb2 machines, used to implement machine pool in addb2/sys.c

◆ M0_XCA_DOMAIN()

struct m0_addb2_trace M0_XCA_DOMAIN ( rpc  )

◆ mach()

static struct m0_addb2_mach * mach ( void  )
static

Returns current addb2 machine.

Returned machine has m0_addb2_mach::ma_nesting elevated. mach_put() should be called to release the machine.

Definition at line 881 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mach_1()

static void mach_1 ( void  )
static

Definition at line 70 of file sys.c.

Here is the call graph for this function:

◆ mach_buffer()

static struct buffer * mach_buffer ( struct m0_addb2_mach mach)
static

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mach_cache()

static void mach_cache ( void  )
static

Definition at line 103 of file sys.c.

Here is the call graph for this function:

◆ mach_cache_N()

static void mach_cache_N ( void  )
static

Definition at line 124 of file sys.c.

Here is the call graph for this function:

◆ mach_fini()

void mach_fini ( struct m0_addb2_mach m)

Definition at line 78 of file common.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mach_idle()

static void mach_idle ( struct m0_addb2_mach m)
static

Checks and signals if the machine is idle.

Definition at line 920 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mach_put()

static void mach_put ( struct m0_addb2_mach m)
static

Decreases the nesting counter of the machine, returned previously by mach().

Definition at line 911 of file addb2.c.

Here is the caller graph for this function:

◆ mach_set()

struct m0_addb2_mach* mach_set ( int(*)(const struct m0_addb2_mach *, struct m0_addb2_trace *)  s)

Definition at line 65 of file common.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mach_toomany()

static void mach_toomany ( void  )
static

Definition at line 85 of file sys.c.

Here is the call graph for this function:

◆ mach_top()

static struct tentry * mach_top ( struct m0_addb2_mach m)
static

Returns the top-most label in the context.

Definition at line 1056 of file addb2.c.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Test server for m0console.

Definition at line 195 of file dump.c.

Here is the call graph for this function:

◆ misc_fini()

static void misc_fini ( void  )
static

Definition at line 1621 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ misc_init()

static void misc_init ( void  )
static

Definition at line 1611 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_fop_init()

static void net_fop_init ( struct m0_fop fop,
struct m0_addb2_net net,
struct m0_addb2_trace trace 
)
static

Helper to initialise an outgoing one-way fop.

Definition at line 367 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_force()

static void net_force ( struct m0_addb2_net net)
static

Definition at line 316 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_idle()

static void net_idle ( struct m0_addb2_net net,
void *  datum 
)
static

Definition at line 648 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_invariant()

static bool net_invariant ( const struct m0_addb2_net net)
static

Definition at line 310 of file net.c.

Here is the caller graph for this function:

◆ net_lock()

static void net_lock ( struct m0_addb2_net net)
static

Definition at line 298 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_sent()

static void net_sent ( struct m0_rpc_item item)
static

An implementation of m0_rpc_item_ops::rio_sent() for one-way trace fops.

This is called by rpc after the fop has been placed on wire.

Definition at line 437 of file net.c.

Here is the call graph for this function:

◆ net_stop()

static void net_stop ( struct m0_addb2_sys sys)
static

Definition at line 515 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_unlock()

static void net_unlock ( struct m0_addb2_net net)
static

Definition at line 304 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ noqueue_add()

static void noqueue_add ( void  )
static

Definition at line 203 of file sys.c.

Here is the call graph for this function:

◆ oct()

static void oct ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 431 of file dump.c.

◆ op_state()

static void op_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 872 of file dump.c.

Here is the call graph for this function:

◆ pack()

static void pack ( struct m0_addb2_mach m)
static

Ships the current trace buffer off to processing.

Definition at line 966 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pad()

static int pad ( int  indent)
static

Definition at line 1342 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ philter_consume()

static void philter_consume ( struct m0_addb2_source src,
struct m0_addb2_philter ph,
const struct m0_addb2_record rec 
)
static

Definition at line 130 of file consumer.c.

Here is the caller graph for this function:

◆ plugin_add()

static int plugin_add ( const char *  path)
static

Definition at line 182 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plugin_load()

static int plugin_load ( struct plugin plugin)
static

Definition at line 289 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plugin_unload()

static void plugin_unload ( struct plugin plugin)
static

Definition at line 311 of file dump.c.

Here is the caller graph for this function:

◆ plugins_load()

static int plugins_load ( void  )
static

Definition at line 320 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plugins_unload()

static void plugins_unload ( void  )
static

Definition at line 337 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ptr()

static void ptr ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 440 of file dump.c.

Here is the caller graph for this function:

◆ queue_add()

static void queue_add ( void  )
static

Definition at line 208 of file sys.c.

Here is the call graph for this function:

◆ rec_dump()

static void rec_dump ( struct m0_addb2__context ctx,
const struct m0_addb2_record rec 
)
static

Definition at line 1313 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receq()

bool receq ( const struct m0_addb2_record r0,
const struct small_record r1 
)

Definition at line 134 of file common.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpc_in()

static void rpc_in ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 828 of file dump.c.

Here is the call graph for this function:

◆ rpc_out()

static void rpc_out ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 834 of file dump.c.

Here is the call graph for this function:

◆ rpcop()

static void rpcop ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 639 of file dump.c.

Here is the call graph for this function:

◆ sensor_place()

static void sensor_place ( struct m0_addb2_mach m,
struct m0_addb2_sensor s 
)
static

Reads the sensor measurement and adds it to the current trace buffer.

Definition at line 1065 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip()

static void skip ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 465 of file dump.c.

Here is the caller graph for this function:

◆ sm_add()

static void sm_add ( void  )
static

Definition at line 230 of file sys.c.

Here is the call graph for this function:

◆ sm_state()

static void sm_state ( const struct m0_sm_conf conf,
struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 541 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sm_trans()

static void sm_trans ( const struct m0_sm_conf conf,
const char *  name,
struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 762 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ src_conn_terminating()

static void src_conn_terminating ( struct m0_rpc_item_source ris)
static

An implementation of m0_rpc_item_source_ops::riso_conn_terminating().

This is called by rpc when a connection is terminated.

Definition at line 425 of file net.c.

Here is the call graph for this function:

◆ src_fini()

static void src_fini ( struct source s)
static

Definition at line 290 of file net.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ src_get_item()

static struct m0_rpc_item * src_get_item ( struct m0_rpc_item_source ris,
m0_bcount_t  size 
)
static

An implementation of m0_rpc_item_source_ops::riso_get_item().

Allocates and initialises a fop with a trace of suitable size (not exceeding the given "size").

This is called by rpc after an rpc packet is formed to fill remaining space (frm_fill_packet_from_item_sources()).

Definition at line 384 of file net.c.

Here is the call graph for this function:

◆ src_has_item()

static bool src_has_item ( const struct m0_rpc_item_source ris)
static

Implementation of m0_rpc_item_source_ops::riso_has_item().

Returns true iff the machine has any items to send out.

This is called by rpc after an rpc packet (m0_rpc_packet) is formed.

Definition at line 352 of file net.c.

Here is the call graph for this function:

◆ state_counter()

static void state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 878 of file dump.c.

Here is the call graph for this function:

◆ stob_io_req_state()

static void stob_io_req_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 940 of file dump.c.

Here is the call graph for this function:

◆ stor_balance()

static void stor_balance ( struct m0_addb2_storage stor,
int  delta 
)
static

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_dom_fini()

static void stor_dom_fini ( struct m0_addb2_storage stor)
static

Definition at line 309 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_dom_init()

static int stor_dom_init ( struct m0_addb2_storage stor,
const char *  location,
uint64_t  key,
bool  mkfs,
bool  force 
)
static

Definition at line 272 of file storage.c.

Here is the call graph for this function:

◆ stor_drain()

static void stor_drain ( struct m0_addb2_storage stor)
static

Submits pending frames.

Definition at line 653 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_fini()

static void stor_fini ( struct m0_addb2_storage stor)
static

Definition at line 467 of file storage.c.

Here is the call graph for this function:

◆ stor_idle()

static void stor_idle ( struct m0_addb2_storage stor)
static

Definition at line 654 of file sys.c.

Here is the call graph for this function:

◆ stor_invariant()

static bool stor_invariant ( const struct m0_addb2_storage stor)
static

Definition at line 884 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_round()

static m0_bindex_t stor_round ( const struct m0_addb2_storage stor,
m0_bindex_t  index 
)
static

Definition at line 852 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_rounded()

static bool stor_rounded ( const struct m0_addb2_storage stor,
m0_bindex_t  index 
)
static

Definition at line 858 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_stob_fini()

static void stor_stob_fini ( struct m0_addb2_storage stor)
static

Definition at line 338 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_stob_init()

static int stor_stob_init ( struct m0_addb2_storage stor,
uint64_t  key 
)
static

Definition at line 314 of file storage.c.

Here is the call graph for this function:

◆ stor_stop()

static void stor_stop ( struct m0_addb2_sys sys)
static

Definition at line 529 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stor_update()

static void stor_update ( struct m0_addb2_storage stor,
const struct m0_addb2_frame_header header 
)
static

Updates the current position after the frame with the given header has been written.

Definition at line 671 of file storage.c.

Here is the caller graph for this function:

◆ submit_trap()

static void submit_trap ( struct m0_addb2_sys sys,
struct m0_addb2_trace_obj obj 
)
static

Definition at line 218 of file sys.c.

Here is the caller graph for this function:

◆ sym()

static void sym ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 655 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_ast()

static void sys_ast ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)
static

Sys AST call-back.

Definition at line 550 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_balance()

static void sys_balance ( struct m0_addb2_sys sys)
static

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_idle()

static void sys_idle ( struct m0_addb2_mach m)
static

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.

Here is the call graph for this function:

◆ sys_invariant()

static bool sys_invariant ( const struct m0_addb2_sys sys)
static

Definition at line 677 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_lock()

static void sys_lock ( struct m0_addb2_sys sys)
static

Locks the sys object.

See also
sys_unlock.

Definition at line 587 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_post()

static void sys_post ( struct m0_addb2_sys sys)
static

Definition at line 481 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_qlock()

static void sys_qlock ( struct m0_addb2_sys sys)
static

Locks the queue.

See also
sys_qunlock.

Definition at line 631 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_queue_invariant()

static bool sys_queue_invariant ( const struct m0_addb2_sys sys)
static

Definition at line 685 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_qunlock()

static void sys_qunlock ( struct m0_addb2_sys sys)
static

Unlocks the queue.

See also
sys_qlock.

Definition at line 642 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sys_size()

static m0_bcount_t sys_size ( const struct m0_addb2_sys sys)
static

Definition at line 660 of file sys.c.

Here is the caller graph for this function:

◆ sys_submit()

static int sys_submit ( struct m0_addb2_mach mach,
struct m0_addb2_trace_obj obj 
)
static

Definition at line 472 of file sys.c.

Here is the call graph for this function:

◆ sys_unlock()

static void sys_unlock ( struct m0_addb2_sys sys)
static

Definition at line 615 of file sys.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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()

static void trace_add ( struct frame frame,
struct m0_addb2_trace trace 
)
static

Adds the trace to the frame.

Definition at line 569 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trace_fits()

static bool trace_fits ( const struct frame frame,
const struct m0_addb2_trace trace 
)
static

True iff the frame has enough space for the trace.

Definition at line 558 of file storage.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trace_invariant()

static bool trace_invariant ( const struct m0_addb2_trace tr)
static

Definition at line 1101 of file addb2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trace_tryadd()

static bool trace_tryadd ( struct m0_addb2_storage stor,
struct m0_addb2_trace trace 
)
static

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ true_matches()

static bool true_matches ( struct m0_addb2_philter philter,
const struct m0_addb2_record rec 
)
static

Definition at line 170 of file consumer.c.

Here is the caller graph for this function:

◆ tx_state()

static void tx_state ( struct m0_addb2__context ctx,
const uint64_t *  v,
char *  buf 
)
static

Definition at line 841 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tx_state_counter()

static void tx_state_counter ( struct m0_addb2__context ctx,
char *  buf 
)
static

Definition at line 854 of file dump.c.

Here is the call graph for this function:

◆ val_dump()

static void val_dump ( struct m0_addb2__context ctx,
const char *  prefix,
const struct m0_addb2_value val,
int  indent,
bool  cr 
)
static

Definition at line 1479 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_dump_json()

static void val_dump_json ( struct m0_addb2__context ctx,
const struct m0_addb2_value val,
bool  output_timestamp 
)
static

Definition at line 1359 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_dump_plaintext()

static void val_dump_plaintext ( struct m0_addb2__context ctx,
const char *  prefix,
const struct m0_addb2_value val,
int  indent,
bool  cr 
)
static

Definition at line 1429 of file dump.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valeq()

bool valeq ( const struct m0_addb2_value v0,
const struct m0_addb2_value v1 
)

Definition at line 127 of file common.c.

Here is the caller graph for this function:

Variable Documentation

◆ abfd

bfd* abfd
static

Definition at line 1502 of file dump.c.

◆ addb2_fom_ops

static const struct m0_fom_ops addb2_fom_ops
static
Initial value:
= {
.fo_tick = &addb2_fom_tick,
.fo_home_locality = &addb2_fom_home_locality,
.fo_fini = &addb2_fom_fini
}
static int addb2_fom_tick(struct m0_fom *fom0)
Definition: service.c:141
static void addb2_fom_fini(struct m0_fom *fom0)
Definition: service.c:182
static size_t addb2_fom_home_locality(const struct m0_fom *fom)
Definition: service.c:196

Definition at line 70 of file service.c.

◆ addb2_fom_phases

struct m0_sm_state_descr addb2_fom_phases[]
static
Initial value:
= {
.sd_name = "consume",
.sd_allowed = M0_BITS(ADDB2_SUBMIT),
.sd_flags = M0_SDF_INITIAL
},
.sd_name = "submit",
.sd_allowed = M0_BITS(ADDB2_DONE),
},
[ADDB2_DONE] = {
.sd_name = "done",
.sd_flags = M0_SDF_TERMINAL
}
}
#define M0_BITS(...)
Definition: misc.h:236

Definition at line 212 of file service.c.

◆ addb2_service_ops

static const struct m0_reqh_service_ops addb2_service_ops
static
Initial value:
= {
.rso_start = &addb2_service_start,
.rso_stop = &addb2_service_stop,
.rso_fini = &addb2_service_fini
}
static void addb2_service_stop(struct m0_reqh_service *service)
Definition: service.c:88
static int addb2_service_start(struct m0_reqh_service *service)
Definition: service.c:82
int m0_reqh_service_async_start_simple(struct m0_reqh_service_start_async_ctx *asc)
Definition: reqh_service.c:601
static void addb2_service_fini(struct m0_reqh_service *service)
Definition: service.c:95

Definition at line 68 of file service.c.

◆ addb2_service_type_ops

static const struct m0_reqh_service_type_ops addb2_service_type_ops
static
Initial value:
= {
.rsto_service_allocate = &addb2_service_type_allocate
}
static int addb2_service_type_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: service.c:104

Definition at line 69 of file service.c.

◆ addb2_sys_ut

struct m0_ut_suite addb2_sys_ut
Initial value:
= {
.ts_name = "addb2-sys",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "init-fini", &init_fini, "Nikita" },
{ "mach-1", &mach_1, "Nikita" },
{ "mach-toomany", &mach_toomany, "Nikita" },
{ "mach-cache", &mach_cache, "Nikita" },
{ "mach-cache-N", &mach_cache_N, "Nikita" },
{ "noqueue-add", &noqueue_add, "Nikita" },
{ "queue-add", &queue_add, "Nikita" },
{ "sm-add", &sm_add, "Nikita" },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void mach_1(void)
Definition: sys.c:70
static void mach_cache(void)
Definition: sys.c:103
static void sm_add(void)
Definition: sys.c:230
static void queue_add(void)
Definition: sys.c:208
static void mach_toomany(void)
Definition: sys.c:85
static void init_fini(void)
Definition: sys.c:59
static void noqueue_add(void)
Definition: sys.c:203
static void mach_cache_N(void)
Definition: sys.c:124

Definition at line 271 of file sys.c.

◆ ast_wait

struct m0_semaphore ast_wait
static

Definition at line 224 of file sys.c.

◆ base

uint64_t base
static

Definition at line 1504 of file dump.c.

◆ be_tx_sm_conf

struct m0_sm_conf be_tx_sm_conf

Definition at line 176 of file tx.c.

◆ cas_req_sm_conf

struct m0_sm_conf cas_req_sm_conf

Definition at line 133 of file client.c.

◆ clock_sensor_ops

static const struct m0_addb2_sensor_ops clock_sensor_ops
static
Initial value:
= {
.so_snapshot = &clock_counter_snapshot,
.so_fini = &counter_fini
}
static void counter_fini(struct m0_addb2_sensor *s)
Definition: counter.c:145
static void clock_counter_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition: counter.c:185

Definition at line 43 of file counter.c.

◆ deflatten

bool deflatten = false
static

Definition at line 170 of file dump.c.

◆ delay

int delay = 0
static

Definition at line 174 of file dump.c.

◆ dix_req_sm_conf

struct m0_sm_conf dix_req_sm_conf

Definition at line 135 of file req.c.

◆ flatten

bool flatten = false
static

Definition at line 169 of file dump.c.

◆ fom_states_conf

M0_INTERNAL struct m0_sm_conf fom_states_conf
Initial value:
= {
.scf_name = "FOM states",
.scf_nr_states = ARRAY_SIZE(fom_states),
.scf_state = fom_states,
.scf_trans_nr = ARRAY_SIZE(fom_trans),
.scf_trans = fom_trans
}
static struct m0_sm_trans_descr fom_trans[M0_FOS_TRANS_NR]
Definition: fom.c:1641
static struct m0_sm_state_descr fom_states[]
Definition: fom.c:1616
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 1652 of file fom.c.

◆ frame_tag

static const struct m0_format_tag frame_tag
static
Initial value:

Definition at line 264 of file storage.c.

◆ hist_ops

static const struct m0_addb2_sensor_ops hist_ops
static
Initial value:
= {
.so_snapshot = &hist_snapshot,
.so_fini = &hist_fini
}
static void hist_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition: histogram.c:103
static void hist_fini(struct m0_addb2_sensor *s)
Definition: histogram.c:116

Definition at line 34 of file histogram.c.

◆ idle

void(* idle) (const struct m0_addb2_mach *mach)

Definition at line 34 of file common.c.

◆ IDLE_THRESHOLD

const m0_time_t IDLE_THRESHOLD = M0_MKTIME(10, 0)
static

Definition at line 126 of file net.c.

◆ ids

struct m0_addb2__id_intrp ids[]

Definition at line 1074 of file dump.c.

◆ io_sm_conf

struct m0_sm_conf 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

Definition at line 172 of file dump.c.

◆ json_output

bool json_output = false
static

Definition at line 171 of file dump.c.

◆ list_sensor_ops

static const struct m0_addb2_sensor_ops list_sensor_ops
static
Initial value:
= {
.so_snapshot = &list_counter_snapshot,
.so_fini = &counter_fini
}
static void counter_fini(struct m0_addb2_sensor *s)
Definition: counter.c:145
static void list_counter_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition: counter.c:173

Definition at line 42 of file counter.c.

◆ m0_addb2__dummy_payload [1/2]

M0_EXTERN uint64_t m0_addb2__dummy_payload[]

Definition at line 58 of file internal.h.

◆ m0_addb2__dummy_payload [2/2]

M0_INTERNAL uint64_t m0_addb2__dummy_payload[1] = {}

Definition at line 1096 of file addb2.c.

◆ m0_addb2__dummy_payload_size [1/2]

M0_EXTERN uint64_t m0_addb2__dummy_payload_size

Definition at line 59 of file internal.h.

◆ 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: addb2.c:1096
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 1098 of file addb2.c.

◆ m0_addb2__fom_type_ops [1/2]

M0_EXTERN const struct m0_fom_type_ops m0_addb2__fom_type_ops

Definition at line 69 of file internal.h.

◆ m0_addb2__fom_type_ops [2/2]

M0_INTERNAL const struct m0_fom_type_ops m0_addb2__fom_type_ops
Initial value:
= {
.fto_create = &addb2_fom_create
}
static int addb2_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: service.c:120

Definition at line 208 of file service.c.

◆ m0_addb2__mach

struct m0_addb2_mach*(* m0_addb2__mach) (void) = NULL

"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

Definition at line 70 of file internal.h.

◆ m0_addb2__sm_conf [2/2]

M0_INTERNAL const struct m0_sm_conf m0_addb2__sm_conf
Initial value:
= {
.scf_name = "addb2 fom",
.scf_nr_states = ARRAY_SIZE(addb2_fom_phases),
.scf_state = addb2_fom_phases
}
static struct m0_sm_state_descr addb2_fom_phases[]
Definition: service.c:212
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 228 of file service.c.

◆ m0_addb2__sys_ast_trap [1/2]

void(* m0_addb2__sys_ast_trap) (struct m0_addb2_sys *sys)

Definition at line 545 of file sys.c.

◆ m0_addb2__sys_ast_trap [2/2]

void(* m0_addb2__sys_ast_trap) (struct m0_addb2_sys *sys) = NULL

Definition at line 545 of file sys.c.

◆ m0_addb2__sys_submit_trap [1/2]

void(* m0_addb2__sys_submit_trap) (struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj)

Definition at line 469 of file sys.c.

◆ m0_addb2__sys_submit_trap [2/2]

void(* m0_addb2__sys_submit_trap) (struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj) = NULL

Definition at line 469 of file sys.c.

◆ m0_addb2_service_type [1/2]

M0_EXTERN struct m0_reqh_service_type m0_addb2_service_type

Definition at line 37 of file service.h.

◆ m0_addb2_service_type [2/2]

M0_INTERNAL struct m0_reqh_service_type m0_addb2_service_type
Initial value:
= {
.rst_name = "M0_CST_ADDB2",
.rst_level = M0_RS_LEVEL_NORMAL,
.rst_typecode = M0_CST_ADDB2
}
static const struct m0_reqh_service_type_ops addb2_service_type_ops
Definition: service.c:69

Definition at line 245 of file service.c.

◆ m0_addb2_stob_key

M0_INTERNAL const uint64_t m0_addb2_stob_key = M0_ADDB2_STOB_KEY

Definition at line 270 of file storage.c.

◆ m0_dtx_sm_conf

struct m0_sm_conf m0_dtx_sm_conf

Definition at line 82 of file dtx.c.

◆ m0_fom__types

struct m0_fom_type* m0_fom__types[M0_OPCODES_NR]

Definition at line 1594 of file fom.c.

◆ m0_op_conf

struct m0_sm_conf m0_op_conf

Configuration structure for the client operation state machine.

Definition at line 145 of file client.c.

◆ M0_XCA_DOMAIN

struct cs_ds2_rep_fop M0_XCA_DOMAIN

◆ net_fopt

struct m0_fop_type net_fopt
static

Definition at line 123 of file net.c.

◆ net_rpc_ops

static const struct m0_rpc_item_ops net_rpc_ops
static
Initial value:
= {
.rio_sent = &net_sent
}
static void net_sent(struct m0_rpc_item *item)
Definition: net.c:437

Definition at line 124 of file net.c.

◆ noqueue

const struct m0_addb2_config noqueue
static
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

size_t nr
static

Definition at line 1505 of file dump.c.

◆ offset

m0_bindex_t offset = 0
static

Definition at line 173 of file dump.c.

◆ op_states_conf

struct m0_sm_conf op_states_conf

Definition at line 66 of file op.c.

◆ optind

int optind

◆ plugins

struct plugin plugins[PLUGINS_MAX]
static

Definition at line 126 of file dump.c.

◆ plugins_nr

size_t plugins_nr
static

Definition at line 127 of file dump.c.

◆ queue

const struct m0_addb2_config queue
static
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

bool sensor_finalised

Definition at line 98 of file common.c.

◆ SENSOR_MARKER

const uint64_t SENSOR_MARKER

Definition at line 96 of file common.c.

◆ sensor_ops [1/2]

const struct m0_addb2_sensor_ops sensor_ops

Definition at line 112 of file common.c.

◆ sensor_ops [2/2]

static const struct m0_addb2_sensor_ops sensor_ops
static
Initial value:
= {
.so_snapshot = &m0_addb2__counter_snapshot,
.so_fini = &counter_fini
}
static void counter_fini(struct m0_addb2_sensor *s)
Definition: counter.c:145
M0_INTERNAL void m0_addb2__counter_snapshot(struct m0_addb2_sensor *s, uint64_t *area)
Definition: counter.c:135

Definition at line 41 of file counter.c.

◆ seq

uint64_t seq

Definition at line 97 of file common.c.

◆ src_ops

static const struct m0_rpc_item_source_ops src_ops
static
Initial value:
= {
.riso_has_item = &src_has_item,
.riso_get_item = &src_get_item,
.riso_conn_terminating = &src_conn_terminating
}
static void src_conn_terminating(struct m0_rpc_item_source *ris)
Definition: net.c:425
static bool src_has_item(const struct m0_rpc_item_source *ris)
Definition: net.c:352
static struct m0_rpc_item * src_get_item(struct m0_rpc_item_source *ris, m0_bcount_t size)
Definition: net.c:384

Definition at line 122 of file net.c.

◆ submit

int(* submit) (const struct m0_addb2_mach *mach, struct m0_addb2_trace *trace)

Definition at line 32 of file common.c.

◆ submitted

int submitted

Definition at line 30 of file common.c.

◆ syms

asymbol** syms
static

Definition at line 1503 of file dump.c.

◆ sys_mach_ops

static const struct m0_addb2_mach_ops sys_mach_ops
static
Initial value:
= {
.apo_submit = &sys_submit,
.apo_idle = &sys_idle
}
static void sys_idle(struct m0_addb2_mach *mach)
Definition: sys.c:502
static int sys_submit(struct m0_addb2_mach *mach, struct m0_addb2_trace_obj *obj)
Definition: sys.c:472

Definition at line 173 of file sys.c.

◆ sys_stor_ops

static const struct m0_addb2_storage_ops sys_stor_ops
static
Initial value:
= {
.sto_idle = &stor_idle
}
static void stor_idle(struct m0_addb2_storage *stor)
Definition: sys.c:654

Definition at line 174 of file sys.c.

◆ sys_submitted

unsigned sys_submitted
static

Definition at line 217 of file sys.c.

◆ value_id

struct m0_varr value_id
static

Definition at line 129 of file dump.c.