6#define MON_MSGLEN_MAX 128
36 printf(
"create log fail...\n");
43 printf(
"mmap fail\n");
54static inline int time2str(
char *buf,
int len)
61 localtime_r(&tv.tv_sec, &tm_buf);
62 tm_strlen = strftime(buf,
len,
"%F|%T:", &tm_buf);
80 printf(
"stack empty ...\n");
84 stat = stk_curnt(stk)->name();
86 memset(tmp,
' ',
sizeof(tmp));
87 statl = snprintf(tmp,
sizeof(tmp),
"Pid %d|State[%s]\n",
92 printf(
"%s len <= 1\n", __func__);
101 memset(tmp,
' ',
sizeof(tmp));
113 dbgl = time2str(&tmp[msglen],
sizeof(tmp) -msglen);
116 dbgl = snprintf(&tmp[msglen],
sizeof(tmp)- msglen,
"%s%s\n",
CUTTER, dbg);
121 printf(
"%s len <= 1\n", __func__);
132 memcpy(
ptr, tmp, msglen);
137 msync(mem,
MSIZE, MS_SYNC);
140 msync(mem,
MSIZE, MS_ASYNC);
148 mon_update(a, b, 0); \
152#define muc3(a, b, c) \
154 mon_update(a, b, c); \
157#define muc_ovrld(_1, _2, _3, func, ...) func
158#define mon_update_check(args...) muc_ovrld(args, muc3, muc2,...)(args)
Definition vcom_monitor.h:8
char fname[FNAME_LEN]
Definition vcom_monitor.h:13
int fd
Definition vcom_monitor.h:10
int dbg_first
Definition vcom_monitor_dbg.h:15
void * addr
Definition vcom_monitor.h:9
int max_statl
Definition vcom_monitor_dbg.h:14
int pid
Definition vcom_monitor.h:11
#define mon_init(a)
Definition vcom.h:97
#define stk_empty(a)
Definition vcom.h:23
#define mon_update(...)
Definition vcom.h:96
struct vc_monitor vc_mon
Definition vcom_monitor.h:15
#define FNAME_LEN
Definition vcom_monitor_dbg.h:4
#define MON_MSGLEN_MAX
Definition vcom_monitor_dbg.h:6
#define CUTTER
Definition vcom_monitor_dbg.h:5
#define MSIZE
Definition vcom_monitor_dbg.h:3
void * stk_mon
Definition vcom_client.c:33
#define FNAME_LEN
Definition vcom_monitor_pre_stat.h:4
unsigned short len
Definition vcom_proto.h:3
char ptr[4]
Definition vcom_proto.h:2