* [PATCH 1/2] perf top: Fix top.call-graph works abnormal
@ 2018-03-12 11:25 Yisheng Xie
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Yisheng Xie @ 2018-03-12 11:25 UTC (permalink / raw)
To: acme
Cc: jolsa, namhyung, alexander.shishkin, mingo, peterz, linux-kernel,
Yisheng Xie
When try to add call-graph for top into .perfconfig file, like:
[top]
call-graph = fp
find it cannot work for perf_top_config() do not parse this option.
Fix it by call perf_default_config() when config top.call-graph.
Fixes: b8cbb349061e (perf config: Bring perf_default_config to the very beginning at main())
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
tools/perf/builtin-top.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 35ac016..fd6e238 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1224,8 +1224,10 @@ static int __cmd_top(struct perf_top *top)
static int perf_top_config(const char *var, const char *value, void *cb __maybe_unused)
{
- if (!strcmp(var, "top.call-graph"))
- var = "call-graph.record-mode"; /* fall-through */
+ if (!strcmp(var, "top.call-graph")) {
+ var = "call-graph.record-mode";
+ return perf_default_config(var, value, cb);
+ }
if (!strcmp(var, "top.children")) {
symbol_conf.cumulate_callchain = perf_config_bool(var, value);
return 0;
--
1.7.12.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config()
2018-03-12 11:25 [PATCH 1/2] perf top: Fix top.call-graph works abnormal Yisheng Xie
@ 2018-03-12 11:25 ` Yisheng Xie
2018-03-12 14:06 ` Arnaldo Carvalho de Melo
2018-03-20 6:28 ` [tip:perf/core] " tip-bot for Yisheng Xie
2018-03-12 14:11 ` [PATCH 1/2] perf top: Fix top.call-graph works abnormal Arnaldo Carvalho de Melo
2018-03-20 6:28 ` [tip:perf/core] perf top: Fix top.call-graph config option reading tip-bot for Yisheng Xie
2 siblings, 2 replies; 6+ messages in thread
From: Yisheng Xie @ 2018-03-12 11:25 UTC (permalink / raw)
To: acme
Cc: jolsa, namhyung, alexander.shishkin, mingo, peterz, linux-kernel,
Yisheng Xie
We have brought perf_default_config to the very beginning at main(), so
it no need to call perf_default_config() once more for most of config in
perf-record but only for record.call-graph.
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
tools/perf/builtin-record.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index a217623..811cfc1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1260,10 +1260,12 @@ static int perf_record_config(const char *var, const char *value, void *cb)
return -1;
return 0;
}
- if (!strcmp(var, "record.call-graph"))
- var = "call-graph.record-mode"; /* fall-through */
+ if (!strcmp(var, "record.call-graph")) {
+ var = "call-graph.record-mode";
+ return perf_default_config(var, value, cb);
+ }
- return perf_default_config(var, value, cb);
+ return 0;
}
struct clockid_map {
--
1.7.12.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config()
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
@ 2018-03-12 14:06 ` Arnaldo Carvalho de Melo
2018-03-20 6:28 ` [tip:perf/core] " tip-bot for Yisheng Xie
1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-03-12 14:06 UTC (permalink / raw)
To: Yisheng Xie
Cc: jolsa, namhyung, alexander.shishkin, mingo, peterz, linux-kernel
Em Mon, Mar 12, 2018 at 07:25:57PM +0800, Yisheng Xie escreveu:
> We have brought perf_default_config to the very beginning at main(), so
> it no need to call perf_default_config() once more for most of config in
> perf-record but only for record.call-graph.
Thanks, applied.
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
> tools/perf/builtin-record.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index a217623..811cfc1 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -1260,10 +1260,12 @@ static int perf_record_config(const char *var, const char *value, void *cb)
> return -1;
> return 0;
> }
> - if (!strcmp(var, "record.call-graph"))
> - var = "call-graph.record-mode"; /* fall-through */
> + if (!strcmp(var, "record.call-graph")) {
> + var = "call-graph.record-mode";
> + return perf_default_config(var, value, cb);
> + }
>
> - return perf_default_config(var, value, cb);
> + return 0;
> }
>
> struct clockid_map {
> --
> 1.7.12.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] perf top: Fix top.call-graph works abnormal
2018-03-12 11:25 [PATCH 1/2] perf top: Fix top.call-graph works abnormal Yisheng Xie
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
@ 2018-03-12 14:11 ` Arnaldo Carvalho de Melo
2018-03-20 6:28 ` [tip:perf/core] perf top: Fix top.call-graph config option reading tip-bot for Yisheng Xie
2 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-03-12 14:11 UTC (permalink / raw)
To: Yisheng Xie
Cc: jolsa, namhyung, alexander.shishkin, mingo, peterz, linux-kernel
Em Mon, Mar 12, 2018 at 07:25:56PM +0800, Yisheng Xie escreveu:
> When try to add call-graph for top into .perfconfig file, like:
>
> [top]
> call-graph = fp
>
> find it cannot work for perf_top_config() do not parse this option.
Thanks, applied.
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip:perf/core] perf record: Avoid duplicate call of perf_default_config()
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
2018-03-12 14:06 ` Arnaldo Carvalho de Melo
@ 2018-03-20 6:28 ` tip-bot for Yisheng Xie
1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Yisheng Xie @ 2018-03-20 6:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, tglx, hpa, alexander.shishkin, jolsa, linux-kernel,
xieyisheng1, namhyung, mingo, peterz
Commit-ID: cff17205d6bd363703034510a84d66044aff176e
Gitweb: https://git.kernel.org/tip/cff17205d6bd363703034510a84d66044aff176e
Author: Yisheng Xie <xieyisheng1@huawei.com>
AuthorDate: Mon, 12 Mar 2018 19:25:57 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 16 Mar 2018 13:55:58 -0300
perf record: Avoid duplicate call of perf_default_config()
We have brought perf_default_config to the very beginning at main(), so
it no need to call perf_default_config() once more for most of config in
perf-record but only for record.call-graph.
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1520853957-36106-2-git-send-email-xieyisheng1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index b81494587120..d33103291b02 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1279,10 +1279,12 @@ static int perf_record_config(const char *var, const char *value, void *cb)
return -1;
return 0;
}
- if (!strcmp(var, "record.call-graph"))
- var = "call-graph.record-mode"; /* fall-through */
+ if (!strcmp(var, "record.call-graph")) {
+ var = "call-graph.record-mode";
+ return perf_default_config(var, value, cb);
+ }
- return perf_default_config(var, value, cb);
+ return 0;
}
struct clockid_map {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [tip:perf/core] perf top: Fix top.call-graph config option reading
2018-03-12 11:25 [PATCH 1/2] perf top: Fix top.call-graph works abnormal Yisheng Xie
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
2018-03-12 14:11 ` [PATCH 1/2] perf top: Fix top.call-graph works abnormal Arnaldo Carvalho de Melo
@ 2018-03-20 6:28 ` tip-bot for Yisheng Xie
2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Yisheng Xie @ 2018-03-20 6:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: peterz, hpa, wangnan0, xieyisheng1, acme, tglx, linux-kernel,
mingo, jolsa, alexander.shishkin, namhyung
Commit-ID: a3a4a3b37c9b911af4c375b2475cea0fd2b84d38
Gitweb: https://git.kernel.org/tip/a3a4a3b37c9b911af4c375b2475cea0fd2b84d38
Author: Yisheng Xie <xieyisheng1@huawei.com>
AuthorDate: Mon, 12 Mar 2018 19:25:56 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 16 Mar 2018 13:56:04 -0300
perf top: Fix top.call-graph config option reading
When trying to add the "call-graph" variable for top into the
.perfconfig file, like:
[top]
call-graph = fp
I that perf_top_config() do not parse this variable.
Fix it by calling perf_default_config() when the top.call-graph variable
is set.
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: b8cbb349061e ("perf config: Bring perf_default_config to the very beginning at main()")
Link: http://lkml.kernel.org/r/1520853957-36106-1-git-send-email-xieyisheng1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-top.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 0a26b56afcc5..113c298ed38b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1223,8 +1223,10 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
static int perf_top_config(const char *var, const char *value, void *cb __maybe_unused)
{
- if (!strcmp(var, "top.call-graph"))
- var = "call-graph.record-mode"; /* fall-through */
+ if (!strcmp(var, "top.call-graph")) {
+ var = "call-graph.record-mode";
+ return perf_default_config(var, value, cb);
+ }
if (!strcmp(var, "top.children")) {
symbol_conf.cumulate_callchain = perf_config_bool(var, value);
return 0;
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-03-20 6:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 11:25 [PATCH 1/2] perf top: Fix top.call-graph works abnormal Yisheng Xie
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
2018-03-12 14:06 ` Arnaldo Carvalho de Melo
2018-03-20 6:28 ` [tip:perf/core] " tip-bot for Yisheng Xie
2018-03-12 14:11 ` [PATCH 1/2] perf top: Fix top.call-graph works abnormal Arnaldo Carvalho de Melo
2018-03-20 6:28 ` [tip:perf/core] perf top: Fix top.call-graph config option reading tip-bot for Yisheng Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).