Motr  M0
iem.c File Reference
#include "motr/iem.h"
#include "lib/trace.h"
Include dependency graph for iem.c:

Go to the source code of this file.

Data Structures

struct  m0_iem_retrigger
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_M0D
 

Enumerations

enum  { INTERVAL = 60, THRESHOLD = 10 }
 

Functions

void m0_iem (const char *file, const char *function, int line, const enum m0_motr_iem_severity sev_id, const enum m0_motr_iem_module mod_id, const enum m0_motr_iem_event evt_id, const char *msg,...)
 

Variables

const char M0_MOTR_IEM_SOURCE_ID = 'S'
 
const int M0_MOTR_IEM_COMPONENT_ID_MOTR = 2
 
const char * m0_motr_iem_severity = "TAXEWNCIDB"
 
static struct m0_iem_retrigger iem_re [M0_IEM_EVENT_NR]
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_M0D

Definition at line 23 of file iem.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
INTERVAL 

Time interval (seconds) to throttle messages.

THRESHOLD 

How many messages during INTERVAL.

Definition at line 51 of file iem.c.

Function Documentation

◆ m0_iem()

void m0_iem ( const char *  file,
const char *  function,
int  line,
const enum m0_motr_iem_severity  sev_id,
const enum m0_motr_iem_module  mod_id,
const enum m0_motr_iem_event  evt_id,
const char *  desc,
  ... 
)

The function must be called with appropriate parameters using the macros M0_MOTR_IEM() & M0_MOTR_IEM_DESC() to send an IEM alert. This IEM is throttled by a simple throttling scheme. The throttling scheme is the maximum number of IEM alerts for the defined interval.

Parameters
filefrom where m0_iem is called, use FILE
functionfrom where m0_iem is called, use FUNCTION
linefrom where m0_iem is called, use LINE
sev_ida valid value from enum m0_motr_iem_severity
mod_ida valid value from enum m0_motr_iem_module
evt_ida valid value from enum m0_motr_iem_event
desca string description with variable args. Can be NULL, max (512-1) bytes in length.

Definition at line 58 of file iem.c.

Here is the call graph for this function:

Variable Documentation

◆ iem_re

struct m0_iem_retrigger iem_re[M0_IEM_EVENT_NR]
static

Definition at line 49 of file iem.c.

◆ M0_MOTR_IEM_COMPONENT_ID_MOTR

const int M0_MOTR_IEM_COMPONENT_ID_MOTR = 2

Definition at line 34 of file iem.c.

◆ m0_motr_iem_severity

const char* m0_motr_iem_severity = "TAXEWNCIDB"

Definition at line 36 of file iem.c.

◆ M0_MOTR_IEM_SOURCE_ID

const char M0_MOTR_IEM_SOURCE_ID = 'S'

Definition at line 31 of file iem.c.