public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/8] perf/core fixes
@ 2014-01-21 20:42 Arnaldo Carvalho de Melo
  2014-01-23 16:45 ` Ingo Molnar
  0 siblings, 1 reply; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-01-21 20:42 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alan Cox,
	Alan Cox, Andi Kleen, Baruch Siach, David Ahern,
	Frederic Weisbecker, Gaurav Jain, Jiri Olsa, linux-xtensa,
	Max Filippov, Mike Galbraith, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Peter Zijlstra,
	Stanislav Fomichev, Stephane Eranian, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 45e6af06367e7b2eb8dc49671092462d8f8a5f47:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-19 13:09:01 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 578c03c86fadcc6fd7319ddf41dd4d1d88aab77a:

  perf symbols: Fix JIT symbol resolution on heap (2014-01-21 10:56:05 -0300)

----------------------------------------------------------------
perf/core fixes:

. Fix JIT symbol resolution on heap (Namhyung Kim)

. Fix wrong SVG height in 'timechart' (Stanislav Fomichev)

. Free temp cpu_map in perf_session__cpu_bitmap (Stanislav Fomichev)

. Fix NULL pointer reference bug with event unit in 'stat' (Stephane Eranian)

. Fix memory corruption of xyarray when cpumask is used (Stephane Eranian)

. Ensure sscanf does not overrun the "mem" field (Alan Cox)

. Add support for the xtensa architecture (Baruch Siach)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Alan Cox (1):
      perf tools: Ensure sscanf does not overrun the "mem" field

Baruch Siach (1):
      perf tools: Add support for the xtensa architecture

Namhyung Kim (1):
      perf symbols: Fix JIT symbol resolution on heap

Stanislav Fomichev (2):
      perf timechart: Fix wrong SVG height
      perf session: Free cpu_map in perf_session__cpu_bitmap

Stephane Eranian (3):
      perf stat: fix NULL pointer reference bug with event unit
      perf evsel: Remove duplicate member zeroing after free
      perf stat: Fix memory corruption of xyarray when cpumask is used

 tools/perf/builtin-timechart.c |  3 +++
 tools/perf/perf.h              |  7 +++++++
 tools/perf/util/evlist.c       |  7 +++++--
 tools/perf/util/evsel.c        |  1 -
 tools/perf/util/header.c       |  2 +-
 tools/perf/util/map.c          |  4 ++--
 tools/perf/util/parse-events.c |  2 +-
 tools/perf/util/pmu.c          | 24 ++++++++++++++++++++----
 tools/perf/util/pmu.h          |  2 +-
 tools/perf/util/session.c      | 10 +++++++---
 10 files changed, 47 insertions(+), 15 deletions(-)

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

* Re: [GIT PULL 0/8] perf/core fixes
  2014-01-21 20:42 Arnaldo Carvalho de Melo
@ 2014-01-23 16:45 ` Ingo Molnar
  0 siblings, 0 replies; 15+ messages in thread
From: Ingo Molnar @ 2014-01-23 16:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alan Cox,
	Alan Cox, Andi Kleen, Baruch Siach, David Ahern,
	Frederic Weisbecker, Gaurav Jain, Jiri Olsa, linux-xtensa,
	Max Filippov, Mike Galbraith, Namhyung Kim, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Peter Zijlstra,
	Stanislav Fomichev, Stephane Eranian, Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> 
> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 45e6af06367e7b2eb8dc49671092462d8f8a5f47:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-19 13:09:01 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 578c03c86fadcc6fd7319ddf41dd4d1d88aab77a:
> 
>   perf symbols: Fix JIT symbol resolution on heap (2014-01-21 10:56:05 -0300)
> 
> ----------------------------------------------------------------
> perf/core fixes:
> 
> . Fix JIT symbol resolution on heap (Namhyung Kim)
> 
> . Fix wrong SVG height in 'timechart' (Stanislav Fomichev)
> 
> . Free temp cpu_map in perf_session__cpu_bitmap (Stanislav Fomichev)
> 
> . Fix NULL pointer reference bug with event unit in 'stat' (Stephane Eranian)
> 
> . Fix memory corruption of xyarray when cpumask is used (Stephane Eranian)
> 
> . Ensure sscanf does not overrun the "mem" field (Alan Cox)
> 
> . Add support for the xtensa architecture (Baruch Siach)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Alan Cox (1):
>       perf tools: Ensure sscanf does not overrun the "mem" field
> 
> Baruch Siach (1):
>       perf tools: Add support for the xtensa architecture
> 
> Namhyung Kim (1):
>       perf symbols: Fix JIT symbol resolution on heap
> 
> Stanislav Fomichev (2):
>       perf timechart: Fix wrong SVG height
>       perf session: Free cpu_map in perf_session__cpu_bitmap
> 
> Stephane Eranian (3):
>       perf stat: fix NULL pointer reference bug with event unit
>       perf evsel: Remove duplicate member zeroing after free
>       perf stat: Fix memory corruption of xyarray when cpumask is used
> 
>  tools/perf/builtin-timechart.c |  3 +++
>  tools/perf/perf.h              |  7 +++++++
>  tools/perf/util/evlist.c       |  7 +++++--
>  tools/perf/util/evsel.c        |  1 -
>  tools/perf/util/header.c       |  2 +-
>  tools/perf/util/map.c          |  4 ++--
>  tools/perf/util/parse-events.c |  2 +-
>  tools/perf/util/pmu.c          | 24 ++++++++++++++++++++----
>  tools/perf/util/pmu.h          |  2 +-
>  tools/perf/util/session.c      | 10 +++++++---
>  10 files changed, 47 insertions(+), 15 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* [GIT PULL 0/8] perf/core fixes
@ 2015-07-01 21:23 Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 1/8] perf tools: Add missing break for PERF_RECORD_ITRACE_START Arnaldo Carvalho de Melo
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Aaro Koskinen,
	Adrian Hunter, David Ahern, Jiri Olsa, Kan Liang, Namhyung Kim,
	Peter Zijlstra, Taeung Song, Arnaldo Carvalho de Melo

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 93472aff802fd7b61f2209335207e9bd793012f7:

  perf/x86: Fix 'active_events' imbalance (2015-06-30 13:08:46 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo

for you to fetch changes up to 5ef7bbb09f7b91ef06524c72e1ab1fc48e0d6682:

  perf tools: Allow to specify custom linker command (2015-07-01 17:53:50 -0300)

----------------------------------------------------------------
perf/core fixes:

Build fixes:

- Create config.detected into OUTPUT directory, fixing parallel
  builds sharing the same source directory (Aaro Kiskinen)

- Allow to specify custom linker command, fixing some MIPS64
  builds. (Aaro Kiskinen)

Infrastructure:

- Add missing break for PERF_RECORD_ITRACE_START, which caused those events
  samples to be parsed as well as PERF_RECORD_LOST_SAMPLES. ITRACE_START only
  appears when Intel PT or BTS are present, so  (Jiri Olsa)

- Call the perf_session destructor when bailing out in the inject, kmem, report,
  kvm and mem tools (Taeung Song)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Aaro Koskinen (2):
      perf tools: Create config.detected into OUTPUT directory
      perf tools: Allow to specify custom linker command

Jiri Olsa (1):
      perf tools: Add missing break for PERF_RECORD_ITRACE_START

Taeung Song (5):
      perf inject: Fill in the missing session freeing after an error occurs
      perf kmem: Fill in the missing session freeing after an error occurs
      perf report: Fill in the missing session freeing after an error occurs
      perf kvm: Fill in the missing session freeing after an error occurs
      perf mem: Fill in the missing session freeing after an error occurs

 tools/build/Makefile.build  |  2 +-
 tools/perf/Makefile.perf    |  4 ++--
 tools/perf/builtin-inject.c |  7 ++++---
 tools/perf/builtin-kmem.c   |  4 ++--
 tools/perf/builtin-kvm.c    | 14 ++++++++++----
 tools/perf/builtin-mem.c    | 16 ++++++----------
 tools/perf/builtin-report.c |  6 ++++--
 tools/perf/config/Makefile  |  6 +++---
 tools/perf/util/machine.c   |  3 +--
 9 files changed, 33 insertions(+), 29 deletions(-)

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

* [PATCH 1/8] perf tools: Add missing break for PERF_RECORD_ITRACE_START
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 2/8] perf inject: Fill in the missing session freeing after an error occurs Arnaldo Carvalho de Melo
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jiri Olsa, Jiri Olsa, Adrian Hunter, David Ahern,
	Kan Liang, Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@redhat.com>

Missing switch break since introduction of new event:

  c4937a91ea56 perf tools: handle PERF_RECORD_LOST_SAMPLES

Also removing unneeded break for PERF_RECORD_LOST_SAMPLES.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20150629112745.GA21507@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 4744673aff1b..7ff682770fdb 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1448,10 +1448,9 @@ int machine__process_event(struct machine *machine, union perf_event *event,
 	case PERF_RECORD_AUX:
 		ret = machine__process_aux_event(machine, event); break;
 	case PERF_RECORD_ITRACE_START:
-		ret = machine__process_itrace_start_event(machine, event);
+		ret = machine__process_itrace_start_event(machine, event); break;
 	case PERF_RECORD_LOST_SAMPLES:
 		ret = machine__process_lost_samples_event(machine, event, sample); break;
-		break;
 	default:
 		ret = -1;
 		break;
-- 
2.1.0


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

* [PATCH 2/8] perf inject: Fill in the missing session freeing after an error occurs
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 1/8] perf tools: Add missing break for PERF_RECORD_ITRACE_START Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 3/8] perf kmem: " Arnaldo Carvalho de Melo
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Taeung Song, Namhyung Kim, Arnaldo Carvalho de Melo

From: Taeung Song <treeze.taeung@gmail.com>

When an error occur an error value is just returned without freeing the
session. So allocating and freeing session have to be matched as a pair
even if an error occurs.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1435652124-22414-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-inject.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 52ec66b23607..01b06492bd6a 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -630,12 +630,13 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
 	if (inject.session == NULL)
 		return -1;
 
-	if (symbol__init(&inject.session->header.env) < 0)
-		return -1;
+	ret = symbol__init(&inject.session->header.env);
+	if (ret < 0)
+		goto out_delete;
 
 	ret = __cmd_inject(&inject);
 
+out_delete:
 	perf_session__delete(inject.session);
-
 	return ret;
 }
-- 
2.1.0


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

* [PATCH 3/8] perf kmem: Fill in the missing session freeing after an error occurs
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 1/8] perf tools: Add missing break for PERF_RECORD_ITRACE_START Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 2/8] perf inject: Fill in the missing session freeing after an error occurs Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 4/8] perf report: " Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Taeung Song, Namhyung Kim, Arnaldo Carvalho de Melo

From: Taeung Song <treeze.taeung@gmail.com>

When an error occurs an error value is just returned without freeing the
session. So allocating and freeing session have to be matched as a pair
even if an error occurs.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1435652124-22414-3-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 950f296dfcf7..23b1faaaa4cc 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -1916,7 +1916,7 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
 		if (!perf_evlist__find_tracepoint_by_name(session->evlist,
 							  "kmem:kmalloc")) {
 			pr_err(errmsg, "slab", "slab");
-			return -1;
+			goto out_delete;
 		}
 	}
 
@@ -1927,7 +1927,7 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
 							     "kmem:mm_page_alloc");
 		if (evsel == NULL) {
 			pr_err(errmsg, "page", "page");
-			return -1;
+			goto out_delete;
 		}
 
 		kmem_page_size = pevent_get_page_size(evsel->tp_format->pevent);
-- 
2.1.0


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

* [PATCH 4/8] perf report: Fill in the missing session freeing after an error occurs
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2015-07-01 21:23 ` [PATCH 3/8] perf kmem: " Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 5/8] perf kvm: " Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Taeung Song, Namhyung Kim, Arnaldo Carvalho de Melo

From: Taeung Song <treeze.taeung@gmail.com>

When an error occurs an error value is just returned without freeing the
session. So allocating and freeing session have to be matched as a pair
even if an error occurs.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1435652124-22414-6-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-report.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 348bed4a2abf..95a47719aec3 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -839,8 +839,10 @@ repeat:
 	if (report.header || report.header_only) {
 		perf_session__fprintf_info(session, stdout,
 					   report.show_full_info);
-		if (report.header_only)
-			return 0;
+		if (report.header_only) {
+			ret = 0;
+			goto error;
+		}
 	} else if (use_browser == 0) {
 		fputs("# To display the perf.data header info, please use --header/--header-only options.\n#\n",
 		      stdout);
-- 
2.1.0


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

* [PATCH 5/8] perf kvm: Fill in the missing session freeing after an error occurs
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2015-07-01 21:23 ` [PATCH 4/8] perf report: " Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 6/8] perf mem: " Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Taeung Song, Jiri Olsa, Namhyung Kim,
	Arnaldo Carvalho de Melo

From: Taeung Song <treeze.taeung@gmail.com>

When an error occurs an error value is just returned without freeing the
session. So allocating and freeing session have to be matched as a pair
even if an error occurs.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1435677525-28055-1-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-kvm.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 74878cd75078..fc1cffb1b7a2 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1061,8 +1061,10 @@ static int read_events(struct perf_kvm_stat *kvm)
 
 	symbol__init(&kvm->session->header.env);
 
-	if (!perf_session__has_traces(kvm->session, "kvm record"))
-		return -EINVAL;
+	if (!perf_session__has_traces(kvm->session, "kvm record")) {
+		ret = -EINVAL;
+		goto out_delete;
+	}
 
 	/*
 	 * Do not use 'isa' recorded in kvm_exit tracepoint since it is not
@@ -1070,9 +1072,13 @@ static int read_events(struct perf_kvm_stat *kvm)
 	 */
 	ret = cpu_isa_config(kvm);
 	if (ret < 0)
-		return ret;
+		goto out_delete;
 
-	return perf_session__process_events(kvm->session);
+	ret = perf_session__process_events(kvm->session);
+
+out_delete:
+	perf_session__delete(kvm->session);
+	return ret;
 }
 
 static int parse_target_str(struct perf_kvm_stat *kvm)
-- 
2.1.0


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

* [PATCH 6/8] perf mem: Fill in the missing session freeing after an error occurs
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2015-07-01 21:23 ` [PATCH 5/8] perf kvm: " Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 7/8] perf tools: Create config.detected into OUTPUT directory Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Taeung Song, Namhyung Kim, Arnaldo Carvalho de Melo

From: Taeung Song <treeze.taeung@gmail.com>

When an error occurs an error value is just returned without freeing the
session. So allocating and freeing session have to be matched as a pair
even if an error occurs.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1435752499-11752-1-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-mem.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index da2ec06f0742..80170aace5d4 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -124,7 +124,6 @@ static int report_raw_events(struct perf_mem *mem)
 		.mode = PERF_DATA_MODE_READ,
 		.force = mem->force,
 	};
-	int err = -EINVAL;
 	int ret;
 	struct perf_session *session = perf_session__new(&file, false,
 							 &mem->tool);
@@ -135,24 +134,21 @@ static int report_raw_events(struct perf_mem *mem)
 	if (mem->cpu_list) {
 		ret = perf_session__cpu_bitmap(session, mem->cpu_list,
 					       mem->cpu_bitmap);
-		if (ret)
+		if (ret < 0)
 			goto out_delete;
 	}
 
-	if (symbol__init(&session->header.env) < 0)
-		return -1;
+	ret = symbol__init(&session->header.env);
+	if (ret < 0)
+		goto out_delete;
 
 	printf("# PID, TID, IP, ADDR, LOCAL WEIGHT, DSRC, SYMBOL\n");
 
-	err = perf_session__process_events(session);
-	if (err)
-		return err;
-
-	return 0;
+	ret = perf_session__process_events(session);
 
 out_delete:
 	perf_session__delete(session);
-	return err;
+	return ret;
 }
 
 static int report_events(int argc, const char **argv, struct perf_mem *mem)
-- 
2.1.0


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

* [PATCH 7/8] perf tools: Create config.detected into OUTPUT directory
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2015-07-01 21:23 ` [PATCH 6/8] perf mem: " Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-01 21:23 ` [PATCH 8/8] perf tools: Allow to specify custom linker command Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Aaro Koskinen, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Aaro Koskinen <aaro.koskinen@nokia.com>

Create config.detected into OUTPUT directory instead of source
directory.

This fixes parallel builds that share the same source directory.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1435751683-18500-1-git-send-email-aaro.koskinen@nokia.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.build | 2 +-
 tools/perf/Makefile.perf   | 2 +-
 tools/perf/config/Makefile | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index a51244a8022f..faca2bf6a430 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -25,7 +25,7 @@ build-dir := $(srctree)/tools/build
 include $(build-dir)/Build.include
 
 # do not force detected configuration
--include .config-detected
+-include $(OUTPUT).config-detected
 
 # Init all relevant variables used in build files so
 # 1) they have correct type
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 1af0cfeb7a57..0e0938afbbb1 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -545,7 +545,7 @@ config-clean:
 clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean config-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
-	$(Q)$(RM) .config-detected
+	$(Q)$(RM) $(OUTPUT).config-detected
 	$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32
 	$(call QUIET_CLEAN, core-gen)   $(RM)  *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
 	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 317001c94660..094ddaee104c 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -11,9 +11,9 @@ ifneq ($(obj-perf),)
 obj-perf := $(abspath $(obj-perf))/
 endif
 
-$(shell echo -n > .config-detected)
-detected     = $(shell echo "$(1)=y"       >> .config-detected)
-detected_var = $(shell echo "$(1)=$($(1))" >> .config-detected)
+$(shell echo -n > $(OUTPUT).config-detected)
+detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
+detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
 
 CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
 
-- 
2.1.0


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

* [PATCH 8/8] perf tools: Allow to specify custom linker command
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2015-07-01 21:23 ` [PATCH 7/8] perf tools: Create config.detected into OUTPUT directory Arnaldo Carvalho de Melo
@ 2015-07-01 21:23 ` Arnaldo Carvalho de Melo
  2015-07-02  8:50 ` [GIT PULL 0/8] perf/core fixes Ingo Molnar
  2015-07-02  8:56 ` Ingo Molnar
  9 siblings, 0 replies; 15+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Aaro Koskinen, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Aaro Koskinen <aaro.koskinen@nokia.com>

Allow to specify custom linker command. This fixes MIPS64 builds for
64-bit userspace as it will allow to pass a linker using the correct
linker flags for 64-bit ABI (by default GNU binutils ld will assume
N32).

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1435751683-18500-2-git-send-email-aaro.koskinen@nokia.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 0e0938afbbb1..7a4b549214e3 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -110,7 +110,7 @@ $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
 	$(Q)touch $(OUTPUT)PERF-VERSION-FILE
 
 CC = $(CROSS_COMPILE)gcc
-LD = $(CROSS_COMPILE)ld
+LD ?= $(CROSS_COMPILE)ld
 AR = $(CROSS_COMPILE)ar
 PKG_CONFIG = $(CROSS_COMPILE)pkg-config
 
-- 
2.1.0


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

* Re: [GIT PULL 0/8] perf/core fixes
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (7 preceding siblings ...)
  2015-07-01 21:23 ` [PATCH 8/8] perf tools: Allow to specify custom linker command Arnaldo Carvalho de Melo
@ 2015-07-02  8:50 ` Ingo Molnar
  2015-07-02  8:56 ` Ingo Molnar
  9 siblings, 0 replies; 15+ messages in thread
From: Ingo Molnar @ 2015-07-02  8:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Aaro Koskinen, Adrian Hunter, David Ahern,
	Jiri Olsa, Kan Liang, Namhyung Kim, Peter Zijlstra, Taeung Song,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 93472aff802fd7b61f2209335207e9bd793012f7:
> 
>   perf/x86: Fix 'active_events' imbalance (2015-06-30 13:08:46 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to 5ef7bbb09f7b91ef06524c72e1ab1fc48e0d6682:
> 
>   perf tools: Allow to specify custom linker command (2015-07-01 17:53:50 -0300)
> 
> ----------------------------------------------------------------
> perf/core fixes:
> 
> Build fixes:
> 
> - Create config.detected into OUTPUT directory, fixing parallel
>   builds sharing the same source directory (Aaro Kiskinen)
> 
> - Allow to specify custom linker command, fixing some MIPS64
>   builds. (Aaro Kiskinen)
> 
> Infrastructure:
> 
> - Add missing break for PERF_RECORD_ITRACE_START, which caused those events
>   samples to be parsed as well as PERF_RECORD_LOST_SAMPLES. ITRACE_START only
>   appears when Intel PT or BTS are present, so  (Jiri Olsa)
> 
> - Call the perf_session destructor when bailing out in the inject, kmem, report,
>   kvm and mem tools (Taeung Song)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Aaro Koskinen (2):
>       perf tools: Create config.detected into OUTPUT directory
>       perf tools: Allow to specify custom linker command
> 
> Jiri Olsa (1):
>       perf tools: Add missing break for PERF_RECORD_ITRACE_START
> 
> Taeung Song (5):
>       perf inject: Fill in the missing session freeing after an error occurs
>       perf kmem: Fill in the missing session freeing after an error occurs
>       perf report: Fill in the missing session freeing after an error occurs
>       perf kvm: Fill in the missing session freeing after an error occurs
>       perf mem: Fill in the missing session freeing after an error occurs
> 
>  tools/build/Makefile.build  |  2 +-
>  tools/perf/Makefile.perf    |  4 ++--
>  tools/perf/builtin-inject.c |  7 ++++---
>  tools/perf/builtin-kmem.c   |  4 ++--
>  tools/perf/builtin-kvm.c    | 14 ++++++++++----
>  tools/perf/builtin-mem.c    | 16 ++++++----------
>  tools/perf/builtin-report.c |  6 ++++--
>  tools/perf/config/Makefile  |  6 +++---
>  tools/perf/util/machine.c   |  3 +--
>  9 files changed, 33 insertions(+), 29 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

* Re: [GIT PULL 0/8] perf/core fixes
  2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
                   ` (8 preceding siblings ...)
  2015-07-02  8:50 ` [GIT PULL 0/8] perf/core fixes Ingo Molnar
@ 2015-07-02  8:56 ` Ingo Molnar
  2015-07-02  9:11   ` Jiri Olsa
  9 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2015-07-02  8:56 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Aaro Koskinen, Adrian Hunter, David Ahern,
	Jiri Olsa, Kan Liang, Namhyung Kim, Peter Zijlstra, Taeung Song,
	Arnaldo Carvalho de Melo


Hm, had to unpull it, due to:

make[3]: *** No rule to make target 'util/intel-pt.h', needed by 'util/auxtrace.o'.  Stop.
/home/mingo/tip/tools/build/Makefile.build:107: recipe for target 'util' failed
make[2]: *** [util] Error 2
Makefile.perf:373: recipe for target 'libperf-in.o' failed
make[1]: *** [libperf-in.o] Error 2
Makefile:87: recipe for target 'install' failed
make: *** [install] Error 2

Thanks,

	Ingo

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

* Re: [GIT PULL 0/8] perf/core fixes
  2015-07-02  8:56 ` Ingo Molnar
@ 2015-07-02  9:11   ` Jiri Olsa
  2015-07-02  9:22     ` Ingo Molnar
  0 siblings, 1 reply; 15+ messages in thread
From: Jiri Olsa @ 2015-07-02  9:11 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Aaro Koskinen,
	Adrian Hunter, David Ahern, Kan Liang, Namhyung Kim,
	Peter Zijlstra, Taeung Song, Arnaldo Carvalho de Melo

On Thu, Jul 02, 2015 at 10:56:07AM +0200, Ingo Molnar wrote:
> 
> Hm, had to unpull it, due to:
> 
> make[3]: *** No rule to make target 'util/intel-pt.h', needed by 'util/auxtrace.o'.  Stop.
> /home/mingo/tip/tools/build/Makefile.build:107: recipe for target 'util' failed

Any chance this is leftover from previous intel pt pull/revert?

And 'util/intel-pt.h' dependency stayed in the util/.auxtrace.o.cmd file?
Removing the util/.auxtrace.o.cmd file should fix that.

I'm looking at this issue currently.. need somehow to check the
dependency validity, need to check how kbuild deal with this ;-)

jirka


> make[2]: *** [util] Error 2
> Makefile.perf:373: recipe for target 'libperf-in.o' failed
> make[1]: *** [libperf-in.o] Error 2
> Makefile:87: recipe for target 'install' failed
> make: *** [install] Error 2
> 
> Thanks,
> 
> 	Ingo

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

* Re: [GIT PULL 0/8] perf/core fixes
  2015-07-02  9:11   ` Jiri Olsa
@ 2015-07-02  9:22     ` Ingo Molnar
  0 siblings, 0 replies; 15+ messages in thread
From: Ingo Molnar @ 2015-07-02  9:22 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Aaro Koskinen,
	Adrian Hunter, David Ahern, Kan Liang, Namhyung Kim,
	Peter Zijlstra, Taeung Song, Arnaldo Carvalho de Melo


* Jiri Olsa <jolsa@redhat.com> wrote:

> On Thu, Jul 02, 2015 at 10:56:07AM +0200, Ingo Molnar wrote:
> > 
> > Hm, had to unpull it, due to:
> > 
> > make[3]: *** No rule to make target 'util/intel-pt.h', needed by 'util/auxtrace.o'.  Stop.
> > /home/mingo/tip/tools/build/Makefile.build:107: recipe for target 'util' failed
> 
> Any chance this is leftover from previous intel pt pull/revert?
> 
> And 'util/intel-pt.h' dependency stayed in the util/.auxtrace.o.cmd file?
> Removing the util/.auxtrace.o.cmd file should fix that.
> 
> I'm looking at this issue currently.. need somehow to check the
> dependency validity, need to check how kbuild deal with this ;-)

That's exactly what happened - it now builds fine so I restored the pull, thanks 
Jiri!

	Ingo

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

end of thread, other threads:[~2015-07-02  9:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01 21:23 [GIT PULL 0/8] perf/core fixes Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 1/8] perf tools: Add missing break for PERF_RECORD_ITRACE_START Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 2/8] perf inject: Fill in the missing session freeing after an error occurs Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 3/8] perf kmem: " Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 4/8] perf report: " Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 5/8] perf kvm: " Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 6/8] perf mem: " Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 7/8] perf tools: Create config.detected into OUTPUT directory Arnaldo Carvalho de Melo
2015-07-01 21:23 ` [PATCH 8/8] perf tools: Allow to specify custom linker command Arnaldo Carvalho de Melo
2015-07-02  8:50 ` [GIT PULL 0/8] perf/core fixes Ingo Molnar
2015-07-02  8:56 ` Ingo Molnar
2015-07-02  9:11   ` Jiri Olsa
2015-07-02  9:22     ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2014-01-21 20:42 Arnaldo Carvalho de Melo
2014-01-23 16:45 ` Ingo Molnar

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