summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2013-03-28 18:14:14 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-28 18:14:14 +0000
commit9794f90368550dba8693a30c61c4bea5c4fb2993 (patch)
treed92d3adbe93dfd30fcf074b637ee90cbdf2fbd7a /cmds
parentcaa81f0ed8a4471c210956d0343458b3bca922de (diff)
parent6f6f3f710b4dec2952298ae65d5f1674535c63f0 (diff)
downloadframeworks_native-9794f90368550dba8693a30c61c4bea5c4fb2993.zip
frameworks_native-9794f90368550dba8693a30c61c4bea5c4fb2993.tar.gz
frameworks_native-9794f90368550dba8693a30c61c4bea5c4fb2993.tar.bz2
Merge "atrace: fix tracing on user builds" into jb-mr2-dev
Diffstat (limited to 'cmds')
-rw-r--r--cmds/atrace/atrace.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index d85a1d7..b417383 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -433,8 +433,10 @@ static bool setKernelTraceFuncs(const char* funcs)
if (funcs == NULL || funcs[0] == '\0') {
// Disable kernel function tracing.
- ok &= writeStr(k_currentTracerPath, "nop");
- if (fileExists(k_ftraceFilterPath)) {
+ if (fileIsWritable(k_currentTracerPath)) {
+ ok &= writeStr(k_currentTracerPath, "nop");
+ }
+ if (fileIsWritable(k_ftraceFilterPath)) {
ok &= truncateFile(k_ftraceFilterPath);
}
} else {
@@ -761,11 +763,11 @@ int main(int argc, char **argv)
case 'k':
g_kernelTraceFuncs = optarg;
- break;
+ break;
case 'n':
g_nohup = true;
- break;
+ break;
case 's':
g_initialSleepSecs = atoi(optarg);
@@ -796,7 +798,7 @@ int main(int argc, char **argv)
listSupportedCategories();
exit(0);
}
- break;
+ break;
default:
fprintf(stderr, "\n");