- bool kernel_log = log_sched || log_stack || log_workq || log_irq || log_sync;
- bool app_log = (tag == 0);
-
- /*
- * There are ~80 services. Too expensive to poke all of them. Just include
- * service that may help high CPU ANR analysis.
- */
- if (app_log) {
- targets.push_back(String16("activity"));
- targets.push_back(String16("alarm"));
- targets.push_back(String16("appops"));
- targets.push_back(String16("cpuinfo"));
- targets.push_back(String16("meminfo"));
- targets.push_back(String16("procstats"));
- targets.push_back(String16("input"));
- targets.push_back(String16("lancherapps"));
- targets.push_back(String16("bluetooth_manager"));
- targets.push_back(String16("SurfaceFlinger"));
- targets.push_back(String16("ClockworkProxyNativeService"));
- }
- if (!kernel_log && !app_log) {
- tag |= ATRACE_TAG_ACTIVITY_MANAGER;
- targets.push_back(String16("activity"));
+ /* If nothing is enabled, don't run */
+ if (!tag && !log_sched && !log_stack && !log_workq && !log_irq && !log_sync) {
+ ALOGE("Specify at least one category to trace.");
+ return 1;