summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/atrace/atrace.cpp14
-rwxr-xr-xsrc/trace.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/atrace/atrace.cpp b/src/atrace/atrace.cpp
index 99176bb..324d4da 100755
--- a/src/atrace/atrace.cpp
+++ b/src/atrace/atrace.cpp
@@ -365,12 +365,8 @@ static bool setTagsProperty(uint64_t tags)
uint64_t *sm_for_enabled_tag = NULL;
int fd = -1;
-//atrace "--init_exec" mode
+ // atrace "--init_exec" mode
if(g_init_exec) {
- size_t bufSize = DEF_GR_SIZE;
- char buf[DEF_GR_SIZE];
- int ret = 0;
-
if(fileExists(ENABLED_TAG_FILE)) {
fprintf(stderr, "[Info] T-trace has been already initailized\n");
return false; //atrace has been already initailized.
@@ -424,7 +420,7 @@ static bool setTagsProperty(uint64_t tags)
}
}
}
-//atrace normal mode
+ // atrace normal mode
else {
fd = open(ENABLED_TAG_FILE, O_RDWR | O_CLOEXEC, 0666);
if(fd < 0){
@@ -440,7 +436,7 @@ static bool setTagsProperty(uint64_t tags)
*sm_for_enabled_tag = tags;
}
// For debug
- //fprintf(stderr, "Enabled TAGs: %u\n", (uint32_t)*sm_for_enabled_tag);
+ // fprintf(stderr, "Enabled TAGs: %u\n", (uint32_t)*sm_for_enabled_tag);
//
munmap(sm_for_enabled_tag, sizeof(uint64_t));
close(fd);
@@ -542,7 +538,7 @@ static bool setUpTrace()
excludedTags |= TTRACE_TAG_ALWAYS;
tags &= ~excludedTags;
}
- printf("Tags: 0x%llx, excludedTags: 0x%llx\n", tags, excludedTags);
+ printf("Tags: 0x%lx, excludedTags: 0x%lx\n", tags, excludedTags);
}
ok &= startTrace();
@@ -818,6 +814,8 @@ int main(int argc, char **argv)
bool traceStart = true;
bool traceStop = true;
bool traceDump = true;
+
+ // Global Variable Initialization
excludedTags = 0ULL;
if (argc == 2 && 0 == strcmp(argv[1], "--help")) {
diff --git a/src/trace.c b/src/trace.c
index 59826ef..a4f8fcd 100755
--- a/src/trace.c
+++ b/src/trace.c
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+#include <stdio.h>
+
#include "ttrace.h"
#include "stdarg.h"