linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/2] perf/urgent fixes
@ 2011-11-16 14:51 Arnaldo Carvalho de Melo
  2011-11-16 14:51 ` [PATCH 1/2] perf python: Fix undefined symbol problem Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-11-16 14:51 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Anton Blanchard,
	David Ahern, Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, arnaldo.melo

Hi Ingo,

        Please consider pulling from:

git://github.com/acmel/linux.git perf/urgent

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (1):
  perf python: Fix undefined symbol problem

David Ahern (1):
  perf session: Fix crash with invalid CPU list

 tools/perf/util/evsel.c   |   10 ++++++++++
 tools/perf/util/hist.c    |   10 ----------
 tools/perf/util/hist.h    |    2 --
 tools/perf/util/session.c |    4 ++++
 4 files changed, 14 insertions(+), 12 deletions(-)

-- 
1.7.8.rc0.35.gee6df


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

* [PATCH 1/2] perf python: Fix undefined symbol problem
  2011-11-16 14:51 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2011-11-16 14:51 ` Arnaldo Carvalho de Melo
  2011-11-16 14:51 ` [PATCH 2/2] perf session: Fix crash with invalid CPU list Arnaldo Carvalho de Melo
  2011-12-05  9:33 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-11-16 14:51 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Recently we made perf_evsel__init call hists__init, which broke the perf
python binding:

[root@emilia linux]# ./tools/perf/python/twatch.py
Traceback (most recent call last):
  File "./tools/perf/python/twatch.py", line 16, in <module>
    import perf
ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: hists__init

Fix it by moving the hists__init function to its only caller, evsel.c.

This way we avoid dragging in other parts of tools/perf/util/ to the
perf python binding.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-5nffmdt5mu6ozxgj54oi4qon@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c |   10 ++++++++++
 tools/perf/util/hist.c  |   10 ----------
 tools/perf/util/hist.h  |    2 --
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index e426264..d7915d4 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -34,6 +34,16 @@ int __perf_evsel__sample_size(u64 sample_type)
 	return size;
 }
 
+static void hists__init(struct hists *hists)
+{
+	memset(hists, 0, sizeof(*hists));
+	hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT;
+	hists->entries_in = &hists->entries_in_array[0];
+	hists->entries_collapsed = RB_ROOT;
+	hists->entries = RB_ROOT;
+	pthread_mutex_init(&hists->lock, NULL);
+}
+
 void perf_evsel__init(struct perf_evsel *evsel,
 		      struct perf_event_attr *attr, int idx)
 {
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index a36a3fa..abef270 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1211,13 +1211,3 @@ size_t hists__fprintf_nr_events(struct hists *hists, FILE *fp)
 
 	return ret;
 }
-
-void hists__init(struct hists *hists)
-{
-	memset(hists, 0, sizeof(*hists));
-	hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT;
-	hists->entries_in = &hists->entries_in_array[0];
-	hists->entries_collapsed = RB_ROOT;
-	hists->entries = RB_ROOT;
-	pthread_mutex_init(&hists->lock, NULL);
-}
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index c86c1d2..89289c8 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -63,8 +63,6 @@ struct hists {
 	struct callchain_cursor	callchain_cursor;
 };
 
-void hists__init(struct hists *hists);
-
 struct hist_entry *__hists__add_entry(struct hists *self,
 				      struct addr_location *al,
 				      struct symbol *parent, u64 period);
-- 
1.7.8.rc0.35.gee6df


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

* [PATCH 2/2] perf session: Fix crash with invalid CPU list
  2011-11-16 14:51 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2011-11-16 14:51 ` [PATCH 1/2] perf python: Fix undefined symbol problem Arnaldo Carvalho de Melo
@ 2011-11-16 14:51 ` Arnaldo Carvalho de Melo
  2011-12-05  9:33 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-11-16 14:51 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, David Ahern, Anton Blanchard,
	Arnaldo Carvalho de Melo

From: David Ahern <dsahern@gmail.com>

commit 5d67be9 added the option to specify a range of CPUs of interest,
but does not catch an invalid CPU list:

$ perf script -c foo
Segmentation fault (core dumped)

Cc: Anton Blanchard <anton@samba.org>
Link: http://lkml.kernel.org/r/1321206327-5881-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/session.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 85c1e6b7..0f4555c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1333,6 +1333,10 @@ int perf_session__cpu_bitmap(struct perf_session *session,
 	}
 
 	map = cpu_map__new(cpu_list);
+	if (map == NULL) {
+		pr_err("Invalid cpu_list\n");
+		return -1;
+	}
 
 	for (i = 0; i < map->nr; i++) {
 		int cpu = map->map[i];
-- 
1.7.8.rc0.35.gee6df


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

* Re: [GIT PULL 0/2] perf/urgent fixes
  2011-11-16 14:51 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2011-11-16 14:51 ` [PATCH 1/2] perf python: Fix undefined symbol problem Arnaldo Carvalho de Melo
  2011-11-16 14:51 ` [PATCH 2/2] perf session: Fix crash with invalid CPU list Arnaldo Carvalho de Melo
@ 2011-12-05  9:33 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2011-12-05  9:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Anton Blanchard, David Ahern, Frederic Weisbecker,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	arnaldo.melo


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

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://github.com/acmel/linux.git perf/urgent
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (1):
>   perf python: Fix undefined symbol problem
> 
> David Ahern (1):
>   perf session: Fix crash with invalid CPU list
> 
>  tools/perf/util/evsel.c   |   10 ++++++++++
>  tools/perf/util/hist.c    |   10 ----------
>  tools/perf/util/hist.h    |    2 --
>  tools/perf/util/session.c |    4 ++++
>  4 files changed, 14 insertions(+), 12 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

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

end of thread, other threads:[~2011-12-05  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 14:51 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2011-11-16 14:51 ` [PATCH 1/2] perf python: Fix undefined symbol problem Arnaldo Carvalho de Melo
2011-11-16 14:51 ` [PATCH 2/2] perf session: Fix crash with invalid CPU list Arnaldo Carvalho de Melo
2011-12-05  9:33 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar

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).