Merge "atrace: fix tracing on user builds" into jb-mr2-dev

This commit is contained in:
Jamie Gennis 2013-03-28 18:14:14 +00:00 committed by Android (Google) Code Review
commit 9794f90368

View File

@ -433,8 +433,10 @@ static bool setKernelTraceFuncs(const char* funcs)
if (funcs == NULL || funcs[0] == '\0') { if (funcs == NULL || funcs[0] == '\0') {
// Disable kernel function tracing. // Disable kernel function tracing.
ok &= writeStr(k_currentTracerPath, "nop"); if (fileIsWritable(k_currentTracerPath)) {
if (fileExists(k_ftraceFilterPath)) { ok &= writeStr(k_currentTracerPath, "nop");
}
if (fileIsWritable(k_ftraceFilterPath)) {
ok &= truncateFile(k_ftraceFilterPath); ok &= truncateFile(k_ftraceFilterPath);
} }
} else { } else {
@ -761,11 +763,11 @@ int main(int argc, char **argv)
case 'k': case 'k':
g_kernelTraceFuncs = optarg; g_kernelTraceFuncs = optarg;
break; break;
case 'n': case 'n':
g_nohup = true; g_nohup = true;
break; break;
case 's': case 's':
g_initialSleepSecs = atoi(optarg); g_initialSleepSecs = atoi(optarg);
@ -796,7 +798,7 @@ int main(int argc, char **argv)
listSupportedCategories(); listSupportedCategories();
exit(0); exit(0);
} }
break; break;
default: default:
fprintf(stderr, "\n"); fprintf(stderr, "\n");