mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] perf tool: add hists__init for perf diff
@ 2014-10-22 19:02 kan.liang
  2014-10-22 19:29 ` Arnaldo Carvalho de Melo
  2014-10-24  7:55 ` [tip:perf/urgent] perf diff: Add missing hists__init() call at tool start tip-bot for Kan Liang
  0 siblings, 2 replies; 3+ messages in thread
From: kan.liang @ 2014-10-22 19:02 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel, Kan Liang

From: Kan Liang <kan.liang@intel.com>

perf diff also uses hists/hist_entries, hists__init() should be called
before creating any evsels.

Signed-off-by: Kan Liang <kan.liang@intel.com>
---
 tools/perf/builtin-diff.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 8c5c11c..25114c9 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1142,6 +1142,11 @@ static int data_init(int argc, const char **argv)
 
 int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
 {
+	int ret = hists__init();
+
+	if (ret < 0)
+		return ret;
+
 	perf_config(perf_default_config, NULL);
 
 	argc = parse_options(argc, argv, options, diff_usage, 0);
-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] perf tool: add hists__init for perf diff
  2014-10-22 19:02 [PATCH 1/1] perf tool: add hists__init for perf diff kan.liang
@ 2014-10-22 19:29 ` Arnaldo Carvalho de Melo
  2014-10-24  7:55 ` [tip:perf/urgent] perf diff: Add missing hists__init() call at tool start tip-bot for Kan Liang
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-10-22 19:29 UTC (permalink / raw)
  To: kan.liang; +Cc: linux-kernel

Em Wed, Oct 22, 2014 at 03:02:41PM -0400, kan.liang@intel.com escreveu:
> From: Kan Liang <kan.liang@intel.com>
> 
> perf diff also uses hists/hist_entries, hists__init() should be called
> before creating any evsels.

Thanks, this one merits perf/urgent :-\

- Arnaldo
 
> Signed-off-by: Kan Liang <kan.liang@intel.com>
> ---
>  tools/perf/builtin-diff.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
> index 8c5c11c..25114c9 100644
> --- a/tools/perf/builtin-diff.c
> +++ b/tools/perf/builtin-diff.c
> @@ -1142,6 +1142,11 @@ static int data_init(int argc, const char **argv)
>  
>  int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
>  {
> +	int ret = hists__init();
> +
> +	if (ret < 0)
> +		return ret;
> +
>  	perf_config(perf_default_config, NULL);
>  
>  	argc = parse_options(argc, argv, options, diff_usage, 0);
> -- 
> 1.8.3.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/urgent] perf diff: Add missing hists__init() call at tool start
  2014-10-22 19:02 [PATCH 1/1] perf tool: add hists__init for perf diff kan.liang
  2014-10-22 19:29 ` Arnaldo Carvalho de Melo
@ 2014-10-24  7:55 ` tip-bot for Kan Liang
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Kan Liang @ 2014-10-24  7:55 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, tglx, mingo, kan.liang, acme, hpa

Commit-ID:  9ab1f50876dbb8b962db058259be7aae920d4c25
Gitweb:     http://git.kernel.org/tip/9ab1f50876dbb8b962db058259be7aae920d4c25
Author:     Kan Liang <kan.liang@intel.com>
AuthorDate: Wed, 22 Oct 2014 15:02:41 -0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 22 Oct 2014 16:31:06 -0300

perf diff: Add missing hists__init() call at tool start

It also uses hists/hist_entries, hists__init() should be called before
creating any evsels.

Otherwise no extra space will be allocated per perf_evsel nor this space
will be initialized when allocating a new perf_evsel instance, resulting
in reads/writes to non allocated space, oops. Fix it.

Signed-off-by: Kan Liang <kan.liang@intel.com>
Link: http://lkml.kernel.org/r/1414004561-22096-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-diff.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 8c5c11c..25114c9 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1142,6 +1142,11 @@ static int data_init(int argc, const char **argv)
 
 int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused)
 {
+	int ret = hists__init();
+
+	if (ret < 0)
+		return ret;
+
 	perf_config(perf_default_config, NULL);
 
 	argc = parse_options(argc, argv, options, diff_usage, 0);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-24  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-22 19:02 [PATCH 1/1] perf tool: add hists__init for perf diff kan.liang
2014-10-22 19:29 ` Arnaldo Carvalho de Melo
2014-10-24  7:55 ` [tip:perf/urgent] perf diff: Add missing hists__init() call at tool start tip-bot for Kan Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome