提交 1aaf1704 编写于 作者: S Shengliang Guan

enh(cluster): enable tsim to support valgrind startup

上级 688f2584
......@@ -125,8 +125,8 @@ ulimit -c unlimited
if [ -n "$FILE_NAME" ]; then
echo "------------------------------------------------------------------------"
if [ $VALGRIND -eq 1 ]; then
echo valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME
valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME
echo valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME -v
valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME -v
else
if [[ $MULTIPROCESS -eq 1 ]];then
echo "ExcuteCmd(multiprocess):" $PROGRAM -m -c $CFG_DIR -f $FILE_NAME
......
......@@ -156,6 +156,7 @@ extern int32_t simDebugFlag;
extern char simScriptDir[];
extern bool abortExecution;
extern bool useMultiProcess;
extern bool useValgrind;
SScript *simParseScript(char *fileName);
SScript *simProcessCallOver(SScript *script);
......
......@@ -340,6 +340,10 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
simReplaceStr(buf, "deploy.sh", "deploy.sh -m");
}
if (useValgrind) {
simReplaceStr(buf, "exec.sh", "exec.sh -v");
}
simLogSql(buf, true);
int32_t code = system(buf);
int32_t repeatTimes = 0;
......
......@@ -19,6 +19,7 @@
bool simExecSuccess = false;
bool abortExecution = false;
bool useMultiProcess = false;
bool useValgrind = false;
void simHandleSignal(int32_t signo, void *sigInfo, void *context) {
simSystemCleanUp();
......@@ -35,6 +36,8 @@ int32_t main(int32_t argc, char *argv[]) {
strcpy(scriptFile, argv[++i]);
} else if (strcmp(argv[i], "-m") == 0) {
useMultiProcess = true;
} else if (strcmp(argv[i], "-v") == 0) {
useValgrind = true;
} else {
printf("usage: %s [options] \n", argv[0]);
printf(" [-c config]: config directory, default is: %s\n", configDir);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册