Merge branch 'feature-kni2a-keepalive' into 'kni2a'

Feature kni2a keepalive

See merge request tango/kni!16
This commit is contained in:
崔一鸣
2019-06-22 17:56:55 +08:00
4 changed files with 1317 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5)
project(kni)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
#include(Version)
include(Version)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)

1268
autorevision.sh Normal file

File diff suppressed because it is too large Load Diff

42
cmake/Version.cmake Normal file
View File

@@ -0,0 +1,42 @@
# Using autorevision.sh to generate version information
set(__SOURCE_AUTORESIVISION ${CMAKE_SOURCE_DIR}/autorevision.sh)
set(__AUTORESIVISION ${CMAKE_BINARY_DIR}/autorevision.sh)
set(__VERSION_CACHE ${CMAKE_SOURCE_DIR}/version.txt)
set(__VERSION_CONFIG ${CMAKE_BINARY_DIR}/version.cmake)
file(COPY ${__SOURCE_AUTORESIVISION} DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
# execute autorevision.sh to generate version information
execute_process(COMMAND ${__AUTORESIVISION} -t cmake -o ${__VERSION_CACHE} OUTPUT_FILE ${__VERSION_CONFIG})
include(${__VERSION_CONFIG})
# extract major, minor, patch version from git tag
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" KNI_VERSION_MAJOR "${VCS_TAG}")
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" KNI_VERSION_MINOR "${VCS_TAG}")
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" KNI_VERSION_PATCH "${VCS_TAG}")
if(NOT KNI_VERSION_MAJOR)
set(KNI_VERSION_MAJOR 3)
endif()
if(NOT KNI_VERSION_MINOR)
set(KNI_VERSION_MINOR 0)
endif()
if(NOT KNI_VERSION_PATCH)
set(KNI_VERSION_PATCH 0)
endif()
set(KNI_VERSION "${KNI_VERSION_MAJOR}.${KNI_VERSION_MINOR}.${KNI_VERSION_PATCH}")
set(KNI_DESCRIBE "${VCS_SHORT_HASH}")
set(KNI_GIT_VERSION "${KNI_VERSION_MAJOR}.${KNI_VERSION_MINOR}.${KNI_VERSION_PATCH}-${KNI_DESCRIBE}")
set(KNI_VAR_VERSION "${KNI_VERSION_MAJOR}_${KNI_VERSION_MINOR}_${KNI_VERSION_PATCH}_${KNI_DESCRIBE}")
# print information
message(STATUS "Welcome to KNI, Version: ${KNI_GIT_VERSION}")
add_definitions(-DKNI_GIT_VERSION=\"${KNI_GIT_VERSION}\")
add_definitions(-DKNI_VAR_VERSION=${KNI_VAR_VERSION})

View File

@@ -462,7 +462,7 @@ static void judge_pme_destroy(struct pme_info *pmeinfo, int caller){
KNI_LOG_ERROR(logger, "Failed at log_generate, stream traceid is %s", pmeinfo->stream_traceid);
}
else{
KNI_LOG_INFO(logger, "Succeed at log_generate, stream traceid is %s", pmeinfo->stream_traceid);
KNI_LOG_DEBUG(logger, "Succeed at log_generate, stream traceid is %s", pmeinfo->stream_traceid);
}
}
//only intercetp stream need del htable
@@ -1415,7 +1415,7 @@ static long traceid2pme_htable_search_cb(void *data, const uchar *key, uint size
wrapped_kni_cmsg_get(pmeinfo, cmsg, TFE_CMSG_SSL_CERT_VERIFY, sizeof(pmeinfo->ssl_cert_verify), logger);
wrapped_kni_cmsg_get(pmeinfo, cmsg, TFE_CMSG_SSL_ERROR, sizeof(pmeinfo->ssl_error), logger);
clock_gettime(CLOCK_REALTIME, &(pmeinfo->end_time));
KNI_LOG_INFO(logger, "recv cmsg from tfe, stream traceid is %s", pmeinfo->stream_traceid);
KNI_LOG_DEBUG(logger, "recv cmsg from tfe, stream traceid is %s", pmeinfo->stream_traceid);
judge_pme_destroy(pmeinfo, CALLER_TFE);
}
kni_cmsg_destroy(cmsg);
@@ -1752,8 +1752,8 @@ static void keepalive_replay_data_free_cb(void *data)
FREE(&data);
}
extern "C" int kni_init(){
char *kni_git_verison = (char*)KNI_GIT_VERSION;
const char *profile = "./conf/kni/kni.conf";
const char *section = "global";
//init logger
@@ -1786,6 +1786,9 @@ extern "C" int kni_init(){
printf("Failed at create logger: %s", log_path);
goto error_out;
}
//kni_git_log
KNI_LOG_ERROR(local_logger, "----------kni version is %s-----------", kni_git_verison);
ret = MESA_load_profile_int_nodef(profile, section, "tfe_node_count", &tfe_node_count);
if(ret < 0){
KNI_LOG_ERROR(local_logger, "MESA_prof_load: tfe_node_count not set, profile is %s, section is %s", profile, section);