1、增加ansn 部署选项 2、增加fs write out 格式配置

This commit is contained in:
fumingwei
2020-10-14 18:07:26 +08:00
parent 5eb42db275
commit 6d458ba380
4 changed files with 24 additions and 3 deletions

View File

@@ -11,6 +11,25 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set (CMAKE_CXX_FLAGS "-Wall") set (CMAKE_CXX_FLAGS "-Wall")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lasan -fsanitize-recover=address -fsanitize=address -fno-omit-frame-pointer") #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lasan -fsanitize-recover=address -fsanitize=address -fno-omit-frame-pointer")
#for ASAN
set(ASAN_OPTION "OFF" CACHE STRING " set asan type chosen by the user, using OFF as default")
set_property(CACHE ASAN_OPTION PROPERTY STRINGS OFF ADDRESS THREAD)
message(STATUS "ASAN_OPTION='${ASAN_OPTION}'")
if(ASAN_OPTION MATCHES "ADDRESS")
set(CMAKE_C_FLAGS "${CMAKADDRESS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
elseif(ASAN_OPTION MATCHES "THREAD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=thread -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=thread -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
endif()
# end of for ASAN
add_definitions(-D_GNU_SOURCE) add_definitions(-D_GNU_SOURCE)
if (CMAKE_BUILD_TYPE STREQUAL Debug) if (CMAKE_BUILD_TYPE STREQUAL Debug)

View File

@@ -34,7 +34,7 @@ env | sort
: "${COMPILER_IS_GNUCXX:=OFF}" : "${COMPILER_IS_GNUCXX:=OFF}"
# Install dependency from YUM # Install dependency from YUM
yum install -y mrzcpd numactl-devel zlib-devel librdkafka-devel systemd-devel libMESA_handle_logger-devel libMESA_htable-devel libcjson-devel libMESA_field_stat2-devel sapp-devel framework_env libMESA_prof_load-devel libmaatframe-devel tsg_master-devel yum install -y mrzcpd numactl-devel zlib-devel librdkafka-devel systemd-devel libMESA_handle_logger-devel libMESA_htable-devel libcjson-devel libMESA_field_stat2-devel sapp-devel framework_env libMESA_prof_load-devel libmaatframe-devel tsg_master-devel libasan
mkdir build || true mkdir build || true
cd build cd build

View File

@@ -73,6 +73,7 @@ stat_cycle = 1
print_mode = 1 print_mode = 1
# 1:FS_OUTPUT_STATSD; 2:FS_OUTPUT_INFLUX_LINE # 1:FS_OUTPUT_STATSD; 2:FS_OUTPUT_INFLUX_LINE
statsd_format = 2 statsd_format = 2
APP_NAME = fs2_kni
#self test Shunt rules security policy id #self test Shunt rules security policy id
[tsg_diagnose] [tsg_diagnose]

View File

@@ -1021,7 +1021,7 @@ static struct _session_attribute_label_t * kni_pull_session_attribute_results(st
{ {
for(int i= 0; i < session_attribute_label->fqdn_category_id_num; i ++) for(int i= 0; i < session_attribute_label->fqdn_category_id_num; i ++)
{ {
KNI_LOG_DEBUG(logger, "share-session-attribute: fqdn_category_id[%d] = %u,stream traceid = %s",i,session_attribute_label->fqdn_category_id[i]); KNI_LOG_DEBUG(logger, "share-session-attribute: fqdn_category_id[%d] = %u,stream traceid = %s",i,session_attribute_label->fqdn_category_id[i],pmeinfo->stream_traceid);
} }
} }
@@ -2025,12 +2025,13 @@ static struct kni_field_stat_handle * fs_init(const char *profile){
char local_path[KNI_PATH_MAX]; char local_path[KNI_PATH_MAX];
struct kni_field_stat_handle *fs_handle = NULL; struct kni_field_stat_handle *fs_handle = NULL;
screen_stat_handle_t handle = NULL; screen_stat_handle_t handle = NULL;
const char *app_name = "fs2_kni"; char app_name[MAX_STRING_LEN]={0};
int value = 0, ret, stat_cycle, print_mode; int value = 0, ret, stat_cycle, print_mode;
int remote_switch = 0; int remote_switch = 0;
char remote_ip[INET_ADDRSTRLEN]; char remote_ip[INET_ADDRSTRLEN];
int remote_port; int remote_port;
int statsd_format = FS_OUTPUT_STATSD; int statsd_format = FS_OUTPUT_STATSD;
MESA_load_profile_string_def(profile, section, "APP_NAME", app_name, sizeof(app_name), "fs2_kni");
MESA_load_profile_int_def(profile, section, "remote_switch", &remote_switch, 0); MESA_load_profile_int_def(profile, section, "remote_switch", &remote_switch, 0);
MESA_load_profile_string_def(profile, section, "local_path", local_path, sizeof(local_path), "./fs2_kni.status"); MESA_load_profile_string_def(profile, section, "local_path", local_path, sizeof(local_path), "./fs2_kni.status");
KNI_LOG_ERROR(logger, "MESA_prof_load, [%s]:\n remote_switch: %d\n local_path: %s", section, remote_switch, local_path); KNI_LOG_ERROR(logger, "MESA_prof_load, [%s]:\n remote_switch: %d\n local_path: %s", section, remote_switch, local_path);