日志中输出线程ID,方便调试。
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
|
||||
const char* maat_redis_monitor="MAAT_REDIS_MONITOR";
|
||||
#define maat_redis_monitor (module_name_str("MAAT_REDIS_MONITOR"))
|
||||
const char* maat_redis_command="MAAT_REDIS_COMMAND";
|
||||
|
||||
const char* rm_key_prefix[2]={"OBSOLETE_RULE","EFFECTIVE_RULE"};
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#include <MESA/MESA_htable.h>
|
||||
#include <MESA/MESA_list_queue.h>
|
||||
#include <MESA/MESA_handle_logger.h>
|
||||
@@ -28,11 +30,21 @@
|
||||
#include "stream_fuzzy_hash.h"
|
||||
#include "gram_index_engine.h"
|
||||
|
||||
int MAAT_FRAME_VERSION_2_0_20170831=1;
|
||||
const char *maat_module="MAAT Frame";
|
||||
int MAAT_FRAME_VERSION_2_0_20170910=1;
|
||||
|
||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
||||
"unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};
|
||||
pid_t gettid()
|
||||
{
|
||||
return syscall(SYS_gettid);
|
||||
}
|
||||
const char* module_name_str(const char*name)
|
||||
{
|
||||
static __thread char module[64];
|
||||
snprintf(module,sizeof(module),"%s(%d)", name, gettid());
|
||||
return module;
|
||||
}
|
||||
|
||||
int converHextoint(char srctmp)
|
||||
{
|
||||
if(isdigit(srctmp))
|
||||
|
||||
@@ -463,6 +463,9 @@ void redis_monitor_traverse(unsigned int version,redisContext *c,
|
||||
void* u_para,
|
||||
const unsigned char* dec_key,
|
||||
_Maat_feather_t* feather);
|
||||
const char* module_name_str(const char*name);
|
||||
#define maat_module (module_name_str("MAAT_Frame"))
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#include "MESA_handle_logger.h"
|
||||
#include "config_monitor.h"
|
||||
#include "Maat_rule_internal.h"
|
||||
#include <dirent.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <openssl/evp.h>
|
||||
const char* module_config_monitor="CONFIG_MONITOR";
|
||||
|
||||
#define module_config_monitor (module_name_str("CONFIG_MONITOR"))
|
||||
|
||||
|
||||
#define CM_UPDATE_TYPE_ERR -1
|
||||
#define CM_UPDATE_TYPE_NONE 0
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
#include "cJSON.h"
|
||||
#include "map_str2int.h"
|
||||
#include "Maat_rule_internal.h"
|
||||
const char* maat_json="MAAT JSON";
|
||||
#define maat_json (module_name_str("MAAT_JSON"))
|
||||
|
||||
const char* untitled_group_name="Untitled";
|
||||
const int json_version=1;
|
||||
#define MAX_PATH_LINE 256
|
||||
|
||||
Reference in New Issue
Block a user