summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-02-06 00:20:01 +0000
committer android-build-merger <android-build-merger@google.com> 2016-02-06 00:20:01 +0000
commit775415bf55aa602822c98ec46446c65cc54d4a35 (patch)
treed1d752ce8cf417a7565c4104f75657053a76871f
parent010f15bb6dadc92e25cae52142ee13036adc5a73 (diff)
parent2b71580ff6b444f53b9c24f86ad436696720b896 (diff)
Merge "Enable wildcard in the list of kernel functions" am: fda23631b9 am: ec3ae45d30
am: 2b71580ff6 * commit '2b71580ff6b444f53b9c24f86ad436696720b896': Enable wildcard in the list of kernel functions
-rw-r--r--cmds/atrace/atrace.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index 4d4e0cefba..87f637ca3d 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -550,17 +550,19 @@ static bool verifyKernelTraceFuncs(const char* funcs)
String8 funcList = String8::format("\n%s", buf);
// Make sure that every function listed in funcs is in the list we just
- // read from the kernel.
+ // read from the kernel, except for wildcard inputs.
bool ok = true;
char* myFuncs = strdup(funcs);
char* func = strtok(myFuncs, ",");
while (func) {
- String8 fancyFunc = String8::format("\n%s\n", func);
- bool found = funcList.find(fancyFunc.string(), 0) >= 0;
- if (!found || func[0] == '\0') {
- fprintf(stderr, "error: \"%s\" is not a valid kernel function "
- "to trace.\n", func);
- ok = false;
+ if (!strchr(func, '*')) {
+ String8 fancyFunc = String8::format("\n%s\n", func);
+ bool found = funcList.find(fancyFunc.string(), 0) >= 0;
+ if (!found || func[0] == '\0') {
+ fprintf(stderr, "error: \"%s\" is not a valid kernel function "
+ "to trace.\n", func);
+ ok = false;
+ }
}
func = strtok(NULL, ",");
}