4 Commits

Author SHA1 Message Date
yangwei
f76af2f036 feat(printf): 使用fprintf输出屏显至stderr,替换printf 2021-06-08 15:34:03 +08:00
杨威
31bd3fed9c Update .gitlab-ci.yml testing源仅debug版开启asan 2020-10-30 23:05:32 +08:00
杨威
9ecf746f0f Update .gitlab-ci.yml 2020-10-15 09:47:55 +08:00
杨威
040ce55a1b Update travis.sh, ASAN using devtoolset-7 2020-10-14 15:02:23 +08:00
3 changed files with 21 additions and 47 deletions

View File

@@ -3,7 +3,7 @@ variables:
GIT_STRATEGY: "clone"
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
INSTALL_PREFIX: "/opt/MESA/lib/"
INSTALL_DEPENDENCY_LIBRARY: libasan
INSTALL_DEPENDENCY_LIBRARY: ""
stages:
- build
@@ -50,6 +50,10 @@ develop_build_debug:
variables:
BUILD_TYPE: Debug
PACKAGE: 1
UPLOAD_RPM: 1
ASAN_OPTION: ADDRESS
PULP3_REPO_NAME: framework-testing-x86_64.el7
PULP3_DIST_NAME: framework-testing-x86_64.el7
artifacts:
name: "MESA_handle_logger-$CI_COMMIT_REF_NAME-debug"
paths:
@@ -65,6 +69,10 @@ develop_build_release:
variables:
BUILD_TYPE: RelWithDebInfo
PACKAGE: 1
UPLOAD_RPM: 1
ASAN_OPTION: "OFF"
PULP3_REPO_NAME: framework-testing-x86_64.el7
PULP3_DIST_NAME: framework-testing-x86_64.el7
artifacts:
name: "MESA_handle_logger-$CI_COMMIT_REF_NAME-release"
paths:
@@ -90,8 +98,6 @@ release_build_debug:
- build/*.rpm
only:
- tags
except:
- /^v[0-9].*-testing$/i
release_build_release:
stage: build
@@ -109,40 +115,4 @@ release_build_release:
paths:
- build/*.rpm
only:
- tags
except:
- /^v[0-9].*-testing$/i
testing_build_debug:
stage: build
variables:
BUILD_TYPE: Debug
PACKAGE: 1
UPLOAD_RPM: 1
ASAN_OPTION: ADDRESS
PULP3_REPO_NAME: framework-testing-x86_64.el7
PULP3_DIST_NAME: framework-testing-x86_64.el7
extends: .build_by_travis
artifacts:
name: "MESA_handle_logger-$CI_COMMIT_REF_NAME-release"
paths:
- build/*.rpm
only:
- /^v[0-9].*-testing$/i
testing_build_release:
stage: build
variables:
BUILD_TYPE: RelWithDebInfo
PACKAGE: 1
UPLOAD_RPM: 1
ASAN_OPTION: ADDRESS
PULP3_REPO_NAME: framework-testing-x86_64.el7
PULP3_DIST_NAME: framework-testing-x86_64.el7
extends: .build_by_travis
artifacts:
name: "MESA_handle_logger-$CI_COMMIT_REF_NAME-release"
paths:
- build/*.rpm
only:
- /^v[0-9].*-testing$/i
- tags

View File

@@ -37,6 +37,10 @@ if [ -n "${INSTALL_DEPENDENCY_LIBRARY}" ]; then
yum install -y $INSTALL_DEPENDENCY_LIBRARY
fi
if [ $ASAN_OPTION ];then
source /opt/rh/devtoolset-7/enable
fi
mkdir build || true
cd build

View File

@@ -156,7 +156,7 @@ static void snapshot_handle_info(const char *handle_name, const char *log_path,
if(g_zlog_inited == 0)
{
printf("[snapshot_handle_info], Nobody call MESA_handle_runtime_log_creation before, Using (%s) to init zlog, handle_name(%s), log_path(%s), log_level(%d)!!!\n", tmp_conf_filepath, handle_name, log_path, level);
fprintf(stderr,"[snapshot_handle_info], Nobody call MESA_handle_runtime_log_creation before, Using (%s) to init zlog, handle_name(%s), log_path(%s), log_level(%d)!!!\n", tmp_conf_filepath, handle_name, log_path, level);
zlog_init(tmp_conf_filepath);
zlog_reload(NULL);
}
@@ -193,7 +193,7 @@ void *MESA_create_runtime_log_handle(const char *file_path, int level)
zc = zlog_get_category(p_name);
if (!zc)
{
printf("[MESA_create_runtime_log_handle], get zlog category (%s) in global_conf_filepath(%s) fail\n", p_name, global_conf_filepath);
fprintf(stderr,"[MESA_create_runtime_log_handle], get zlog category (%s) in global_conf_filepath(%s) fail\n", p_name, global_conf_filepath);
}
p_handle = (log_handle_t *)calloc(sizeof(log_handle_t), 1);
strncpy(p_handle->runtime_log_file, file_path, sizeof(p_handle->runtime_log_file) - 1);
@@ -237,11 +237,11 @@ int MESA_handle_runtime_log_creation(const char *conf_path)
int rc = 0;
if (conf_path == NULL || (access(conf_path, R_OK) != 0))
{
printf("[MESA_handle_runtime_log_creation], PATH (%s) unable to access, will output log to STDOUT or Using ZLOG_CONF_PATH (%s) !\n", conf_path, env);
fprintf(stderr,"[MESA_handle_runtime_log_creation], PATH (%s) unable to access, will output log to STDOUT or Using ZLOG_CONF_PATH (%s) !\n", conf_path, env);
rc = zlog_init(NULL);
if (rc)
{
printf("[MESA_handle_runtime_log_creation], INIT zlog by (NULL) or (%s) failed !!! \n", env);
fprintf(stderr,"[MESA_handle_runtime_log_creation], INIT zlog by (NULL) or (%s) failed !!! \n", env);
return -1;
}
else
@@ -257,11 +257,11 @@ int MESA_handle_runtime_log_creation(const char *conf_path)
rc = zlog_init(conf_path);
if (rc)
{
printf("[MESA_handle_runtime_log_creation], INIT zlog by (%s) failed , using [NULL] retry !\n", conf_path);
fprintf(stderr,"[MESA_handle_runtime_log_creation], INIT zlog by (%s) failed , using [NULL] retry !\n", conf_path);
rc = zlog_init(NULL);
if (rc)
{
printf("[MESA_handle_runtime_log_creation], INIT zlog by (NULL) or (%s) failed \n", env);
fprintf(stderr,"[MESA_handle_runtime_log_creation], INIT zlog by (NULL) or (%s) failed \n", env);
return -1;
}
else
@@ -279,7 +279,7 @@ int MESA_handle_runtime_log_creation(const char *conf_path)
}
}
printf("[MESA_handle_runtime_log_creation], INIT zlog finish, Using (%s). \n", global_conf_filepath);
fprintf(stderr,"[MESA_handle_runtime_log_creation], INIT zlog finish, Using (%s). \n", global_conf_filepath);
g_zlog_inited = 1;
zlog_profile();