summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfumingwei <[email protected]>2020-10-14 18:07:26 +0800
committerfumingwei <[email protected]>2020-10-14 18:07:26 +0800
commit6d458ba380d2476f2ff5933a50521857e9946734 (patch)
tree5f9318f2c3833865702caf113ed0d392061285e7
parent5eb42db2751eaebcc328afd6cceb00168a3267cb (diff)
1、增加ansn 部署选项 2、增加fs write out 格式配置v20.10.20201014
-rw-r--r--CMakeLists.txt19
-rw-r--r--ci/travis.sh2
-rw-r--r--conf/kni/kni.conf1
-rw-r--r--entry/src/kni_entry.cpp5
4 files changed, 24 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2110eba..bd5894e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,25 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set (CMAKE_CXX_FLAGS "-Wall")
#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)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
diff --git a/ci/travis.sh b/ci/travis.sh
index 03c0ff4..533cf96 100644
--- a/ci/travis.sh
+++ b/ci/travis.sh
@@ -34,7 +34,7 @@ env | sort
: "${COMPILER_IS_GNUCXX:=OFF}"
# 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
cd build
diff --git a/conf/kni/kni.conf b/conf/kni/kni.conf
index 124b985..a32dbbb 100644
--- a/conf/kni/kni.conf
+++ b/conf/kni/kni.conf
@@ -73,6 +73,7 @@ stat_cycle = 1
print_mode = 1
# 1:FS_OUTPUT_STATSD; 2:FS_OUTPUT_INFLUX_LINE
statsd_format = 2
+APP_NAME = fs2_kni
#self test Shunt rules security policy id
[tsg_diagnose]
diff --git a/entry/src/kni_entry.cpp b/entry/src/kni_entry.cpp
index cd18f73..524e74a 100644
--- a/entry/src/kni_entry.cpp
+++ b/entry/src/kni_entry.cpp
@@ -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 ++)
{
- 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];
struct kni_field_stat_handle *fs_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 remote_switch = 0;
char remote_ip[INET_ADDRSTRLEN];
int remote_port;
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_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);