summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/TTraceWrapper.cpp5
-rwxr-xr-xsrc/ttrace.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/TTraceWrapper.cpp b/src/TTraceWrapper.cpp
index c926095..7e535e4 100644
--- a/src/TTraceWrapper.cpp
+++ b/src/TTraceWrapper.cpp
@@ -23,11 +23,12 @@ TTraceWrapper::TTraceWrapper(uint64_t tags, const char* label, ...) {
char fmtd_label[MAX_LEN];
tag = tags;
+
va_start(ap, label);
vsnprintf(fmtd_label, MAX_LEN, label, ap);
-
- traceBegin(tag, fmtd_label);
+ traceBegin(tag, "%s", fmtd_label);
va_end(ap);
+
}
TTraceWrapper::~TTraceWrapper() {
diff --git a/src/ttrace.c b/src/ttrace.c
index a467583..c2573dc 100755
--- a/src/ttrace.c
+++ b/src/ttrace.c
@@ -155,7 +155,7 @@ void traceBegin(uint64_t tag, const char *name, ...)
TTRACE_LOG("traceBegin:: write >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
va_start(ap, name);
- snprintf(buf, MAX_LEN, "B|%5d|", getpid());
+ snprintf(buf, MAX_HEAD_LEN, "B|%5d|", getpid());
len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap);
va_end(ap);
@@ -208,6 +208,7 @@ void traceAsyncBegin(uint64_t tag, int32_t cookie, const char *name, ...)
va_list ap;
TTRACE_LOG("traceAsyncBegin:: write >> tag: %u tag_bit: %u cookie: %d", tag, *cur_enabled_tag, cookie);
+
va_start(ap, name);
snprintf(buf, MAX_LEN, "S|%5d|", getpid());
len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap);