summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-02-06 00:11:38 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-02-06 00:11:38 +0000
commitfda23631b978bec793b67037dc2841a6a15531fb (patch)
tree943ebfb5cd6b8ccfa28d2c224e9c807467d640e2
parent088e7586ea7d0103d1b5395172a4594eddbf5b4a (diff)
parenta2c228770ea1cadc1d06406baad899b8c500389a (diff)
downloadnative-fda23631b978bec793b67037dc2841a6a15531fb.tar.gz
Merge "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 81c8967c84..6549dde29d 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -545,17 +545,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, ",");
}