diff options
| author | guo_peixu <[email protected]> | 2022-07-08 10:07:30 +0800 |
|---|---|---|
| committer | guo_peixu <[email protected]> | 2022-07-08 10:07:30 +0800 |
| commit | 451af3b92955b4d0a3d658fd38577301659c245c (patch) | |
| tree | 8bf24de7a5a0cb23f4c410d49f0f990d995a4461 /inc | |
| parent | 3d6d7b909a7e6cb8082dc41947253d00be1a03f8 (diff) | |
支持过滤模块名,支持匹配通配符"*"shm_ring_queue
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/MESA_shm_ring_queue.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/inc/MESA_shm_ring_queue.h b/inc/MESA_shm_ring_queue.h index 7d82d8d..7b7c3df 100644 --- a/inc/MESA_shm_ring_queue.h +++ b/inc/MESA_shm_ring_queue.h @@ -15,15 +15,19 @@ #define MESA_CONSUMER_RUNNING 1 #define MESA_CONSUMER_NOT_RUNNING 0 -#define MESA_CONSUMER_CARE_PID_NUM 128 +#define MESA_SHM_PID_NUM 128 #define MESA_MATCH_CONSUMER_RULE_SUCCESS 0 #define MESA_MATCH_CONSUMER_RULE_FAIL -1 #define MESA_MATCH_CONSUMER_RULE_FAIL_STATUS -2 #define MESA_MATCH_CONSUMER_RULE_FAIL_LEVEL -3 #define MESA_MATCH_CONSUMER_RULE_FAIL_PID -4 +#define MESA_MATCH_CONSUMER_RULE_FAIL_MODULE -5 +#define MESA_SHM_MODULE_NUM 32 +#define MESA_SHM_MODULE_NAME_LEN 128 + #define MESA_CONSUMER_LEVEL_ALL 0 #define MESA_CONSUMER_LEVEL_DEBUG (1 << 0) @@ -49,14 +53,15 @@ struct MESA_shm_queue_head{ int ovw_idx; }; -struct MESA_consumer{ +struct MESA_shm_consumer{ int status; int log_level; unsigned long long reload_age; - int care_pid[MESA_CONSUMER_CARE_PID_NUM]; + int pid[MESA_SHM_PID_NUM]; + char module[MESA_SHM_MODULE_NUM][sizeof(int) + MESA_SHM_MODULE_NAME_LEN]; }; -struct MESA_log_buf{ +struct MESA_shm_log_buf{ char *buf; char *log_file; char *module; @@ -66,18 +71,18 @@ struct MESA_log_buf{ int level; }; -int MESA_shm_alloc_overview(struct MESA_shm_overview **ovw, int *ovw_id, struct MESA_consumer **consumer_status); +int MESA_shm_alloc_overview(struct MESA_shm_overview **ovw, int *ovw_id, struct MESA_shm_consumer **consumer_status); struct MESA_shm_queue_head *MESA_shm_get_ring_queue(); void MESA_shm_init(); void MESA_shm_recycle_ring_queue(struct MESA_shm_queue_head *ring_queue_head); -int MESA_shm_copy_buf_to_ring_queue(struct MESA_shm_queue_head *head, struct MESA_log_buf *lbuf); +int MESA_shm_copy_buf_to_ring_queue(struct MESA_shm_queue_head *head, struct MESA_shm_log_buf *lbuf); int MESA_shm_ring_queue_is_empty(struct MESA_shm_queue_head *head); int MESA_shm_ring_queue_is_full(struct MESA_shm_queue_head *head); void *MESA_shm_ring_queue_get_read_pos(struct MESA_shm_queue_head *head); void *MESA_shm_ring_queue_get_write_pos(struct MESA_shm_queue_head *head); void MESA_shm_ring_queue_push_read_pos(struct MESA_shm_queue_head *head); void MESA_shm_ring_queue_push_write_pos(struct MESA_shm_queue_head *head); -int MESA_shm_match_consumer_rule(int level, int pid); +int MESA_shm_match_consumer_rule(int level, int pid, const char *module); void MESA_shm_unlink(struct MESA_shm_overview *ovw, int ovw_shmid); const char *loglevel_to_name(int level); |
