diff options
author | Gihun Chang <gihun.chang@samsung.com> | 2016-11-22 14:50:20 +0900 |
---|---|---|
committer | Gihun Chang <gihun.chang@samsung.com> | 2016-11-23 12:37:49 +0900 |
commit | 9f7f29b349f68efecca849d96b27c481b201d1e6 (patch) | |
tree | 89d379349ec6fcc5dffb527ad85cde233fcc6629 | |
parent | 8cf99e1cb9cdfff64da46c7adf994905fd5ebe1b (diff) | |
download | ttrace-9f7f29b349f68efecca849d96b27c481b201d1e6.tar.gz ttrace-9f7f29b349f68efecca849d96b27c481b201d1e6.tar.bz2 ttrace-9f7f29b349f68efecca849d96b27c481b201d1e6.zip |
Skip the initialization of kernel event when atrace run with --append option.
Change-Id: I49fcc426b831cb28b951d0133d2bd61f6c478a8f
Signed-off-by: Gihun Chang <gihun.chang@samsung.com>
-rwxr-xr-x | src/atrace/atrace.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/atrace/atrace.cpp b/src/atrace/atrace.cpp index c51825d..6293b06 100755 --- a/src/atrace/atrace.cpp +++ b/src/atrace/atrace.cpp @@ -407,7 +407,7 @@ static bool setTracingEnabled(bool enable) } // Clear the contents of the kernel trace. -static bool clearTrace() +static bool clearKernelTrace() { return truncateFile(k_tracePath); } @@ -671,18 +671,17 @@ static bool setUpTrace() } printf("Tags: 0x%llx, excludedTags: 0x%llx\n", tags, excludedTags); } + ok &= startTrace(); - if(!g_append_trace) { - // For debug - // printf("\nclear the trace\n"); - // - ok &= clearTrace(); - } - ok &= setTagsProperty(tags); + if(!g_append_trace) { + // Clear Kernel Trace + ok &= clearKernelTrace(); - // Disable all the sysfs enables. This is done as a separate loop from - // the enables to allow the same enable to exist in multiple categories. - ok &= disableKernelTraceEvents(); + // Disable all the sysfs enables. This is done as a separate loop from + // the enables to allow the same enable to exist in multiple categories. + ok &= disableKernelTraceEvents(); + } + ok &= setTagsProperty(tags); // Enable all the sysfs enables that are in an enabled category. for (int i = 0; i < NELEM(k_categories); i++) { @@ -932,7 +931,7 @@ static void showHelp(const char *cmd) " --async_dump dump the current contents of circular trace buffer\n" " --async_stop stop tracing and dump the current contents of circular\n" " trace buffer\n" - " --append append traces to the existing traces. do not clear the trace buffer\n" + " --append append traces to the existing traces. do not clear the trace buffer\n and kernel trace events set" " --backup back up the existing traces to /tmp/trace.backup and then clear the trace buffer\n" " --list_categories\n" " list the available tracing categories\n" @@ -1113,7 +1112,7 @@ int main(int argc, char **argv) printf("\ntrace aborted.\n"); fflush(stdout); } - clearTrace(); + clearKernelTrace(); } else if (!ok) { fprintf(stderr, "unable to start tracing\n"); } |