fix the return error-message from gstrace_start/dump/stop() when non-existing port is specified.
This commit is contained in:
@ -565,6 +565,11 @@ trace_msg_code gstrace_start(int key, const char* mask, uint64_t bufferSize, con
|
||||
bufferSize = gsAlign(((bufferSize > MIN_BUF_SIZE) ? bufferSize : MIN_BUF_SIZE), SLOT_SIZE);
|
||||
bufferSize = bTrcToFile ? MIN_BUF_SIZE : roundToNearestPowerOfTwo(bufferSize);
|
||||
|
||||
/* check if database process exist. */
|
||||
if (!checkProcess(key)) {
|
||||
return TRACE_PROCESS_NOT_EXIST;
|
||||
}
|
||||
|
||||
if (attachTraceCfgSharedMem(key) != TRACE_OK) {
|
||||
/* Failed to attached to shared memory. */
|
||||
return TRACE_ATTACH_CFG_SHARE_MEMORY_ERR;
|
||||
@ -574,11 +579,6 @@ trace_msg_code gstrace_start(int key, const char* mask, uint64_t bufferSize, con
|
||||
return TRACE_ALREADY_START;
|
||||
}
|
||||
|
||||
/* check if database process exist. */
|
||||
if (!checkProcess(key)) {
|
||||
return TRACE_PROCESS_NOT_EXIST;
|
||||
}
|
||||
|
||||
/* set the mask if it's passed in */
|
||||
if (mask != NULL) {
|
||||
trace_mask st_mask = {0};
|
||||
@ -614,6 +614,11 @@ trace_msg_code gstrace_stop(int key)
|
||||
char sBufMemName[TRC_SHARED_MEM_NAME_MAX] = {0};
|
||||
trace_context* pTrcCxt = getTraceContext();
|
||||
|
||||
/* check if database process exist. */
|
||||
if (!checkProcess(key)) {
|
||||
return TRACE_PROCESS_NOT_EXIST;
|
||||
}
|
||||
|
||||
if (attachTraceCfgSharedMem(key) != TRACE_OK) {
|
||||
return TRACE_ATTACH_CFG_SHARE_MEMORY_ERR;
|
||||
}
|
||||
@ -1014,6 +1019,11 @@ trace_msg_code gstrace_dump(int key, const char* outPath)
|
||||
trace_context* pTrcCxt = getTraceContext();
|
||||
trace_msg_code ret;
|
||||
|
||||
/* check if database process exist. */
|
||||
if (!checkProcess(key)) {
|
||||
return TRACE_PROCESS_NOT_EXIST;
|
||||
}
|
||||
|
||||
if (attachTraceCfgSharedMem(key) != TRACE_OK) {
|
||||
return TRACE_ATTACH_CFG_SHARE_MEMORY_ERR;
|
||||
}
|
||||
|
@ -1468,7 +1468,7 @@ trace_msg_t trace_message[] = {
|
||||
{TRACE_SEQ_ERR, "Trace sequence check failed."},
|
||||
{TRACE_VERSION_ERR, "trace version not match."},
|
||||
{TRACE_CONFIG_SIZE_ERR, "invalid config size in trace file."},
|
||||
{TRACE_PROCESS_NOT_EXIST, "Trace process is not exists."},
|
||||
{TRACE_PROCESS_NOT_EXIST, "Trace process does not exist."},
|
||||
{TRACE_MSG_MAX, "Failed!"},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user