diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-05 17:38:10 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-11 14:45:09 +0300 |
commit | dadafc315ded31a36cb4899bc85ef4050f0332a7 (patch) | |
tree | 5b96f73609d56aefc02d3984c1fcbf87b52825bc /tools/perf/util | |
parent | 9df9078ef2086652647248ee6e82ca8f661cb3f5 (diff) | |
download | linux-dadafc315ded31a36cb4899bc85ef4050f0332a7.tar.xz |
perf callchains: Switch from strtok() to strtok_r() when parsing options
Trying to keep everything reentrant.
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-rdce0p2k9e1b4qnrb8ki9mtf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/callchain.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 3cea1fb5404b..2e5eff5abef0 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -116,7 +116,7 @@ static int __parse_callchain_report_opt(const char *arg, bool allow_record_opt) { char *tok; - char *endptr; + char *endptr, *saveptr = NULL; bool minpcnt_set = false; bool record_opt_set = false; bool try_stack_size = false; @@ -127,7 +127,7 @@ __parse_callchain_report_opt(const char *arg, bool allow_record_opt) if (!arg) return 0; - while ((tok = strtok((char *)arg, ",")) != NULL) { + while ((tok = strtok_r((char *)arg, ",", &saveptr)) != NULL) { if (!strncmp(tok, "none", strlen(tok))) { callchain_param.mode = CHAIN_NONE; callchain_param.enabled = false; |