Merge "Allow to target atrace apps by glob." am: 83eae36647

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1584933

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I85b1610dd1c64e9881a6adca0eb05b2874f108b6
This commit is contained in:
Florian Mayer 2021-02-15 12:25:18 +00:00 committed by Automerger Merge Worker
commit 29109ea457
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <limits.h>
#include <pthread.h>
#include <stdatomic.h>
@ -116,7 +117,7 @@ static bool atrace_is_cmdline_match(const char* cmdline)
for (int i = 0; i < count; i++) {
snprintf(buf, sizeof(buf), "debug.atrace.app_%d", i);
property_get(buf, value, "");
if (strcmp(value, "*") == 0 || strcmp(value, cmdline) == 0) {
if (fnmatch(value, cmdline, FNM_NOESCAPE) == 0) {
return true;
}
}