linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/5] perf/core improvements and fixes
@ 2011-10-14 18:27 Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 1/5] perf hists browser: Invalidate ui_browser->top after timer calls Arnaldo Carvalho de Melo
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-14 18:27 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, Thomas Jarosch, arnaldo.melo

Hi Ingo,

        Please consider pulling from:

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

	These are in addition to the ones you reported being problematic
with perf top segfaulting sometimes, that problem should be fixed by the
first patch below.

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (4):
  perf hists browser: Invalidate ui_browser->top after timer calls
  perf annotate browser: Exit when pressing ESC or the left arrow
  perf ui browser: Add filter method
  perf annotate browser: Allow toggling the visualization of source code lines

Thomas Jarosch (1):
  perf buildid: Fix possible unterminated readlink() result buffer

 tools/perf/util/header.c               |    2 +-
 tools/perf/util/ui/browser.c           |   52 +++++++++++++++++----
 tools/perf/util/ui/browser.h           |    1 +
 tools/perf/util/ui/browsers/annotate.c |   78 +++++++++++++++++++++++++++++--
 tools/perf/util/ui/browsers/hists.c    |   15 +++++-
 5 files changed, 131 insertions(+), 17 deletions(-)


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

* [PATCH 1/5] perf hists browser: Invalidate ui_browser->top after timer calls
  2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2011-10-14 18:27 ` Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 2/5] perf annotate browser: Exit when pressing ESC or the left arrow Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-14 18:27 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>

With underlying dynamic data structures we need to invalidate pointers
to them after a timer, as that entry may have vanished (decayed in top,
for instance).

I forgot about browser_ui->top. Fix it by resetting it to null after a
timer. The seek operation from SEEK_SET will then set it to a valid
entry because it starts from rb_first(&hists->entries).

Reported-by: Ingo Molnar <mingo@elte.hu>
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-2ssjm0ouh9tsz4dwkcu7c40n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browser.c        |    1 +
 tools/perf/util/ui/browsers/hists.c |   15 +++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index 2923c49..078ceaf 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -249,6 +249,7 @@ void ui_browser__update_nr_entries(struct ui_browser *browser, u32 nr_entries)
 		browser->top_idx += offset;
 	}
 
+	browser->top = NULL;
 	browser->seek(browser, browser->top_idx, SEEK_SET);
 }
 
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 4a3a7c9..b144b10 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -600,14 +600,23 @@ static int hist_browser__show_entry(struct hist_browser *self,
 	return printed;
 }
 
+static void ui_browser__hists_init_top(struct ui_browser *browser)
+{
+	if (browser->top == NULL) {
+		struct hist_browser *hb;
+
+		hb = container_of(browser, struct hist_browser, b);
+		browser->top = rb_first(&hb->hists->entries);
+	}
+}
+
 static unsigned int hist_browser__refresh(struct ui_browser *self)
 {
 	unsigned row = 0;
 	struct rb_node *nd;
 	struct hist_browser *hb = container_of(self, struct hist_browser, b);
 
-	if (self->top == NULL)
-		self->top = rb_first(&hb->hists->entries);
+	ui_browser__hists_init_top(self);
 
 	for (nd = self->top; nd; nd = rb_next(nd)) {
 		struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
@@ -659,6 +668,8 @@ static void ui_browser__hists_seek(struct ui_browser *self,
 	if (self->nr_entries == 0)
 		return;
 
+	ui_browser__hists_init_top(self);
+
 	switch (whence) {
 	case SEEK_SET:
 		nd = hists__filter_entries(rb_first(self->entries));
-- 
1.6.2.5


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

* [PATCH 2/5] perf annotate browser: Exit when pressing ESC or the left arrow
  2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 1/5] perf hists browser: Invalidate ui_browser->top after timer calls Arnaldo Carvalho de Melo
@ 2011-10-14 18:27 ` Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 3/5] perf ui browser: Add filter method Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-14 18:27 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>

We lost that functionality on ed7e566, restore it.

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-z8eb8af2x46x42lgpn1ustid@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browsers/annotate.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c
index cbefb4f..84315c9 100644
--- a/tools/perf/util/ui/browsers/annotate.c
+++ b/tools/perf/util/ui/browsers/annotate.c
@@ -285,6 +285,8 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
 						     timer, arg, delay_secs);
 			}
 			break;
+		case NEWT_KEY_LEFT:
+		case NEWT_KEY_ESCAPE:
 		case 'q':
 		case CTRL('c'):
 			goto out;
-- 
1.6.2.5


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

* [PATCH 3/5] perf ui browser: Add filter method
  2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 1/5] perf hists browser: Invalidate ui_browser->top after timer calls Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 2/5] perf annotate browser: Exit when pressing ESC or the left arrow Arnaldo Carvalho de Melo
@ 2011-10-14 18:27 ` Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 4/5] perf annotate browser: Allow toggling the visualization of source code lines Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-14 18:27 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>

Its becoming common to allow the user to filter out parts of the data
structure being browsed, like already done in the hists browser and in
the annotate browser in the next commit, so provide it directly in the
ui_browser class list_head helpers.

More work required to move the equivalent routines found now in the
hists browser to the rb_tree helpers.

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-jk7danyt1d9ji4e3o2xuthpn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browser.c |   51 ++++++++++++++++++++++++++++++++++-------
 tools/perf/util/ui/browser.h |    1 +
 2 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index 078ceaf..a54b926 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -42,31 +42,62 @@ void ui_browser__gotorc(struct ui_browser *self, int y, int x)
 	SLsmg_gotorc(self->y + y, self->x + x);
 }
 
+static struct list_head *
+ui_browser__list_head_filter_entries(struct ui_browser *browser,
+				     struct list_head *pos)
+{
+	do {
+		if (!browser->filter || !browser->filter(browser, pos))
+			return pos;
+		pos = pos->next;
+	} while (pos != browser->entries);
+
+	return NULL;
+}
+
+static struct list_head *
+ui_browser__list_head_filter_prev_entries(struct ui_browser *browser,
+					  struct list_head *pos)
+{
+	do {
+		if (!browser->filter || !browser->filter(browser, pos))
+			return pos;
+		pos = pos->prev;
+	} while (pos != browser->entries);
+
+	return NULL;
+}
+
 void ui_browser__list_head_seek(struct ui_browser *self, off_t offset, int whence)
 {
 	struct list_head *head = self->entries;
 	struct list_head *pos;
 
+	if (self->nr_entries == 0)
+		return;
+
 	switch (whence) {
 	case SEEK_SET:
-		pos = head->next;
+		pos = ui_browser__list_head_filter_entries(self, head->next);
 		break;
 	case SEEK_CUR:
 		pos = self->top;
 		break;
 	case SEEK_END:
-		pos = head->prev;
+		pos = ui_browser__list_head_filter_prev_entries(self, head->prev);
 		break;
 	default:
 		return;
 	}
 
+	assert(pos != NULL);
+
 	if (offset > 0) {
 		while (offset-- != 0)
-			pos = pos->next;
+			pos = ui_browser__list_head_filter_entries(self, pos->next);
 	} else {
 		while (offset++ != 0)
-			pos = pos->prev;
+			pos = ui_browser__list_head_filter_prev_entries(self, pos->prev);
 	}
 
 	self->top = pos;
@@ -365,15 +396,17 @@ unsigned int ui_browser__list_head_refresh(struct ui_browser *self)
 	int row = 0;
 
 	if (self->top == NULL || self->top == self->entries)
-                self->top = head->next;
+                self->top = ui_browser__list_head_filter_entries(self, head->next);
 
 	pos = self->top;
 
 	list_for_each_from(pos, head) {
-		ui_browser__gotorc(self, row, 0);
-		self->write(self, pos, row);
-		if (++row == self->height)
-			break;
+		if (!self->filter || !self->filter(self, pos)) {
+			ui_browser__gotorc(self, row, 0);
+			self->write(self, pos, row);
+			if (++row == self->height)
+				break;
+		}
 	}
 
 	return row;
diff --git a/tools/perf/util/ui/browser.h b/tools/perf/util/ui/browser.h
index 7dd9d61..351c006 100644
--- a/tools/perf/util/ui/browser.h
+++ b/tools/perf/util/ui/browser.h
@@ -21,6 +21,7 @@ struct ui_browser {
 	unsigned int  (*refresh)(struct ui_browser *self);
 	void	      (*write)(struct ui_browser *self, void *entry, int row);
 	void	      (*seek)(struct ui_browser *self, off_t offset, int whence);
+	bool	      (*filter)(struct ui_browser *self, void *entry);
 	u32	      nr_entries;
 };
 
-- 
1.6.2.5


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

* [PATCH 4/5] perf annotate browser: Allow toggling the visualization of source code lines
  2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2011-10-14 18:27 ` [PATCH 3/5] perf ui browser: Add filter method Arnaldo Carvalho de Melo
@ 2011-10-14 18:27 ` Arnaldo Carvalho de Melo
  2011-10-14 18:27 ` [PATCH 5/5] perf buildid: Fix possible unterminated readlink() result buffer Arnaldo Carvalho de Melo
  2011-10-15 14:59 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar
  5 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-14 18:27 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>

Just press 'S' on any assembly line and the source code will be hidden
while the current line remains selected. Press 'S' again to show them
back.

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-efmxm5etouebb7es0kkyqqwa@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browsers/annotate.c |   76 +++++++++++++++++++++++++++++--
 1 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c
index 84315c9..eb2712e 100644
--- a/tools/perf/util/ui/browsers/annotate.c
+++ b/tools/perf/util/ui/browsers/annotate.c
@@ -21,12 +21,16 @@ struct annotate_browser {
 	struct rb_root	  entries;
 	struct rb_node	  *curr_hot;
 	struct objdump_line *selection;
+	int		    nr_asm_entries;
+	int		    nr_entries;
+	bool		    hide_src_code;
 };
 
 struct objdump_line_rb_node {
 	struct rb_node	rb_node;
 	double		percent;
 	u32		idx;
+	int		idx_asm;
 };
 
 static inline
@@ -35,10 +39,22 @@ struct objdump_line_rb_node *objdump_line__rb(struct objdump_line *self)
 	return (struct objdump_line_rb_node *)(self + 1);
 }
 
+static bool objdump_line__filter(struct ui_browser *browser, void *entry)
+{
+	struct annotate_browser *ab = container_of(browser, struct annotate_browser, b);
+
+	if (ab->hide_src_code) {
+		struct objdump_line *ol = list_entry(entry, struct objdump_line, node);
+		return ol->offset == -1;
+	}
+
+	return false;
+}
+
 static void annotate_browser__write(struct ui_browser *self, void *entry, int row)
 {
 	struct annotate_browser *ab = container_of(self, struct annotate_browser, b);
-	struct objdump_line *ol = rb_entry(entry, struct objdump_line, node);
+	struct objdump_line *ol = list_entry(entry, struct objdump_line, node);
 	bool current_entry = ui_browser__is_current_entry(self, row);
 	int width = self->width;
 
@@ -168,6 +184,45 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
 	browser->curr_hot = rb_last(&browser->entries);
 }
 
+static bool annotate_browser__toggle_source(struct annotate_browser *browser)
+{
+	struct objdump_line *ol;
+	struct objdump_line_rb_node *olrb;
+	off_t offset = browser->b.index - browser->b.top_idx;
+
+	browser->b.seek(&browser->b, offset, SEEK_CUR);
+	ol = list_entry(browser->b.top, struct objdump_line, node);
+	olrb = objdump_line__rb(ol);
+
+	if (browser->hide_src_code) {
+		if (olrb->idx_asm < offset)
+			offset = olrb->idx;
+
+		browser->b.nr_entries = browser->nr_entries;
+		browser->hide_src_code = false;
+		browser->b.seek(&browser->b, -offset, SEEK_CUR);
+		browser->b.top_idx = olrb->idx - offset;
+		browser->b.index = olrb->idx;
+	} else {
+		if (olrb->idx_asm < 0) {
+			ui_helpline__puts("Only available for assembly lines.");
+			browser->b.seek(&browser->b, -offset, SEEK_CUR);
+			return false;
+		}
+
+		if (olrb->idx_asm < offset)
+			offset = olrb->idx_asm;
+
+		browser->b.nr_entries = browser->nr_asm_entries;
+		browser->hide_src_code = true;
+		browser->b.seek(&browser->b, -offset, SEEK_CUR);
+		browser->b.top_idx = olrb->idx_asm - offset;
+		browser->b.index = olrb->idx_asm;
+	}
+
+	return true;
+}
+
 static int annotate_browser__run(struct annotate_browser *self, int evidx,
 				 int nr_events, void(*timer)(void *arg),
 				 void *arg, int delay_secs)
@@ -175,11 +230,12 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
 	struct rb_node *nd = NULL;
 	struct map_symbol *ms = self->b.priv;
 	struct symbol *sym = ms->sym;
+	const char *help = "<-, ESC: exit, TAB/shift+TAB: cycle hottest lines, "
+			   "H: Hottest, -> Line action, S -> Toggle source "
+			   "code view";
 	int key;
 
-	if (ui_browser__show(&self->b, sym->name,
-			     "<- or ESC: exit, TAB/shift+TAB: "
-			     "cycle hottest lines, H: Hottest, -> Line action") < 0)
+	if (ui_browser__show(&self->b, sym->name, help) < 0)
 		return -1;
 
 	annotate_browser__calc_percent(self, evidx);
@@ -234,6 +290,10 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
 		case 'H':
 			nd = self->curr_hot;
 			break;
+		case 'S':
+			if (annotate_browser__toggle_source(self))
+				ui_helpline__puts(help);
+			continue;
 		case NEWT_KEY_ENTER:
 		case NEWT_KEY_RIGHT:
 			if (self->selection == NULL) {
@@ -324,6 +384,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
 			.refresh = ui_browser__list_head_refresh,
 			.seek	 = ui_browser__list_head_seek,
 			.write	 = annotate_browser__write,
+			.filter  = objdump_line__filter,
 			.priv	 = &ms,
 		},
 	};
@@ -351,9 +412,14 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
 		if (browser.b.width < line_len)
 			browser.b.width = line_len;
 		rbpos = objdump_line__rb(pos);
-		rbpos->idx = browser.b.nr_entries++;
+		rbpos->idx = browser.nr_entries++;
+		if (pos->offset != -1)
+			rbpos->idx_asm = browser.nr_asm_entries++;
+		else
+			rbpos->idx_asm = -1;
 	}
 
+	browser.b.nr_entries = browser.nr_entries;
 	browser.b.entries = &notes->src->source,
 	browser.b.width += 18; /* Percentage */
 	ret = annotate_browser__run(&browser, evidx, nr_events,
-- 
1.6.2.5


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

* [PATCH 5/5] perf buildid: Fix possible unterminated readlink() result buffer
  2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2011-10-14 18:27 ` [PATCH 4/5] perf annotate browser: Allow toggling the visualization of source code lines Arnaldo Carvalho de Melo
@ 2011-10-14 18:27 ` Arnaldo Carvalho de Melo
  2011-10-15 14:59 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar
  5 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-14 18:27 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Thomas Jarosch, Arnaldo Carvalho de Melo

From: Thomas Jarosch <thomas.jarosch@intra2net.com>

The readlink function doesn't guarantee that a '\0' will be put at the
end of the provided buffer if there is no space left.

No need to do "buf[len] = '\0';" since the buffer is allocated with
zalloc().

Link: http://lkml.kernel.org/r/4E986ABF.9040706@intra2net.com
Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/header.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index f2ceb0f..2143a32 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1289,7 +1289,7 @@ int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir)
 	if (access(linkname, F_OK))
 		goto out_free;
 
-	if (readlink(linkname, filename, size) < 0)
+	if (readlink(linkname, filename, size - 1) < 0)
 		goto out_free;
 
 	if (unlink(linkname))
-- 
1.6.2.5


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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2011-10-14 18:27 ` [PATCH 5/5] perf buildid: Fix possible unterminated readlink() result buffer Arnaldo Carvalho de Melo
@ 2011-10-15 14:59 ` Ingo Molnar
  2011-10-15 17:00   ` David Ahern
  5 siblings, 1 reply; 14+ messages in thread
From: Ingo Molnar @ 2011-10-15 14:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David Ahern, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Thomas Jarosch,
	arnaldo.melo


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

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://github.com/acmel/linux.git perf/core
> 
> 	These are in addition to the ones you reported being problematic
> with perf top segfaulting sometimes, that problem should be fixed by the
> first patch below.
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (4):
>   perf hists browser: Invalidate ui_browser->top after timer calls
>   perf annotate browser: Exit when pressing ESC or the left arrow
>   perf ui browser: Add filter method
>   perf annotate browser: Allow toggling the visualization of source code lines
> 
> Thomas Jarosch (1):
>   perf buildid: Fix possible unterminated readlink() result buffer
> 
>  tools/perf/util/header.c               |    2 +-
>  tools/perf/util/ui/browser.c           |   52 +++++++++++++++++----
>  tools/perf/util/ui/browser.h           |    1 +
>  tools/perf/util/ui/browsers/annotate.c |   78 +++++++++++++++++++++++++++++--
>  tools/perf/util/ui/browsers/hists.c    |   15 +++++-
>  5 files changed, 131 insertions(+), 17 deletions(-)

Pulled, thanks a lot Arnaldo!

The 'perf top' segfault is indeed fixed for me too.

Btw., i noticed another weirdness - sometimes after startup i get 
this message:

/lib64/libc-2.14.90.so was updated, restart the long running apps that use it!                          

but it was not updated recently:

 earth5:~/tip/tools/perf> ll /lib64/libc-2.14.90.so
 -rwxr-xr-x 1 root root 2062920 Sep 28 15:11 /lib64/libc-2.14.90.so
 earth5:~/tip/tools/perf> date
 Sat Oct 15 16:59:04 CEST 2011
 earth5:~/tip/tools/perf> uptime
  16:59:08 up 19 days, 21:35, 11 users,  load average: 7.77, 7.48, 3.81

Thanks,

	Ingo

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-15 14:59 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar
@ 2011-10-15 17:00   ` David Ahern
  2011-10-15 17:04     ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: David Ahern @ 2011-10-15 17:00 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Frederic Weisbecker,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Thomas Jarosch, arnaldo.melo

On 10/15/2011 08:59 AM, Ingo Molnar wrote:
> Btw., i noticed another weirdness - sometimes after startup i get 
> this message:
> 
> /lib64/libc-2.14.90.so was updated, restart the long running apps that use it!                          
> 
> but it was not updated recently:
> 
>  earth5:~/tip/tools/perf> ll /lib64/libc-2.14.90.so
>  -rwxr-xr-x 1 root root 2062920 Sep 28 15:11 /lib64/libc-2.14.90.so
>  earth5:~/tip/tools/perf> date
>  Sat Oct 15 16:59:04 CEST 2011
>  earth5:~/tip/tools/perf> uptime
>   16:59:08 up 19 days, 21:35, 11 users,  load average: 7.77, 7.48, 3.81

I got the impression that comment was relative to when the processes
were started versus prelink touching it. In your case the mod time of
libc is after the uptime of the box.

David

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-15 17:00   ` David Ahern
@ 2011-10-15 17:04     ` Ingo Molnar
  2011-10-15 17:46       ` David Ahern
  0 siblings, 1 reply; 14+ messages in thread
From: Ingo Molnar @ 2011-10-15 17:04 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Frederic Weisbecker,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Thomas Jarosch, arnaldo.melo


* David Ahern <dsahern@gmail.com> wrote:

> On 10/15/2011 08:59 AM, Ingo Molnar wrote:
> > Btw., i noticed another weirdness - sometimes after startup i get 
> > this message:
> > 
> > /lib64/libc-2.14.90.so was updated, restart the long running apps that use it!                          
> > 
> > but it was not updated recently:
> > 
> >  earth5:~/tip/tools/perf> ll /lib64/libc-2.14.90.so
> >  -rwxr-xr-x 1 root root 2062920 Sep 28 15:11 /lib64/libc-2.14.90.so
> >  earth5:~/tip/tools/perf> date
> >  Sat Oct 15 16:59:04 CEST 2011
> >  earth5:~/tip/tools/perf> uptime
> >   16:59:08 up 19 days, 21:35, 11 users,  load average: 7.77, 7.48, 3.81
> 
> I got the impression that comment was relative to when the 
> processes were started versus prelink touching it. In your case the 
> mod time of libc is after the uptime of the box.

Ok, that makes sense. Do we report this in perf report output as 
well?

Thanks,

	Ingo

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-15 17:04     ` Ingo Molnar
@ 2011-10-15 17:46       ` David Ahern
  2011-10-15 19:06         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 14+ messages in thread
From: David Ahern @ 2011-10-15 17:46 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaldo Carvalho de Melo, linux-kernel, Frederic Weisbecker,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Thomas Jarosch, arnaldo.melo



On 10/15/2011 11:04 AM, Ingo Molnar wrote:
> 
> * David Ahern <dsahern@gmail.com> wrote:
> 
>> On 10/15/2011 08:59 AM, Ingo Molnar wrote:
>>> Btw., i noticed another weirdness - sometimes after startup i get 
>>> this message:
>>>
>>> /lib64/libc-2.14.90.so was updated, restart the long running apps that use it!                          
>>>
>>> but it was not updated recently:
>>>
>>>  earth5:~/tip/tools/perf> ll /lib64/libc-2.14.90.so
>>>  -rwxr-xr-x 1 root root 2062920 Sep 28 15:11 /lib64/libc-2.14.90.so
>>>  earth5:~/tip/tools/perf> date
>>>  Sat Oct 15 16:59:04 CEST 2011
>>>  earth5:~/tip/tools/perf> uptime
>>>   16:59:08 up 19 days, 21:35, 11 users,  load average: 7.77, 7.48, 3.81
>>
>> I got the impression that comment was relative to when the 
>> processes were started versus prelink touching it. In your case the 
>> mod time of libc is after the uptime of the box.
> 
> Ok, that makes sense. Do we report this in perf report output as 
> well?

It should. The message comes from map__load() when it detects a deleted
mapping such as:

7f9e8d5c7000-7f9e8d5c8000 rw-p 0000c000 fd:02 1046947
 /lib64/libpam.so.0.82.2.#prelink#.cM3f72 (deleted)

I have removed prelink from most of my systems (managed to find one lone
server with the above).

David

> 
> Thanks,
> 
> 	Ingo

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-15 17:46       ` David Ahern
@ 2011-10-15 19:06         ` Arnaldo Carvalho de Melo
  2011-10-15 19:09           ` David Ahern
  0 siblings, 1 reply; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-15 19:06 UTC (permalink / raw)
  To: David Ahern
  Cc: Ingo Molnar, linux-kernel, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Thomas Jarosch

Em Sat, Oct 15, 2011 at 11:46:14AM -0600, David Ahern escreveu:
> 
> 
> On 10/15/2011 11:04 AM, Ingo Molnar wrote:
> > 
> > * David Ahern <dsahern@gmail.com> wrote:
> > 
> >> On 10/15/2011 08:59 AM, Ingo Molnar wrote:
> >>> Btw., i noticed another weirdness - sometimes after startup i get 
> >>> this message:
> >>>
> >>> /lib64/libc-2.14.90.so was updated, restart the long running apps that use it!                          
> >>>
> >>> but it was not updated recently:
> >>>
> >>>  earth5:~/tip/tools/perf> ll /lib64/libc-2.14.90.so
> >>>  -rwxr-xr-x 1 root root 2062920 Sep 28 15:11 /lib64/libc-2.14.90.so
> >>>  earth5:~/tip/tools/perf> date
> >>>  Sat Oct 15 16:59:04 CEST 2011
> >>>  earth5:~/tip/tools/perf> uptime
> >>>   16:59:08 up 19 days, 21:35, 11 users,  load average: 7.77, 7.48, 3.81
> >>
> >> I got the impression that comment was relative to when the 
> >> processes were started versus prelink touching it. In your case the 
> >> mod time of libc is after the uptime of the box.
> > 
> > Ok, that makes sense. Do we report this in perf report output as 
> > well?
> 
> It should. The message comes from map__load() when it detects a deleted
> mapping such as:
> 
> 7f9e8d5c7000-7f9e8d5c8000 rw-p 0000c000 fd:02 1046947
>  /lib64/libpam.so.0.82.2.#prelink#.cM3f72 (deleted)
> 
> I have removed prelink from most of my systems (managed to find one lone
> server with the above).

David,

	Can you send me a patch that clarifies this situation?

- Arnaldo

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-15 19:06         ` Arnaldo Carvalho de Melo
@ 2011-10-15 19:09           ` David Ahern
  2011-10-17  1:15             ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 14+ messages in thread
From: David Ahern @ 2011-10-15 19:09 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, linux-kernel, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Thomas Jarosch



On 10/15/2011 01:06 PM, Arnaldo Carvalho de Melo wrote:
>>
>> It should. The message comes from map__load() when it detects a deleted
>> mapping such as:
>>
>> 7f9e8d5c7000-7f9e8d5c8000 rw-p 0000c000 fd:02 1046947
>>  /lib64/libpam.so.0.82.2.#prelink#.cM3f72 (deleted)
>>
>> I have removed prelink from most of my systems (managed to find one lone
>> server with the above).
> 
> David,
> 
> 	Can you send me a patch that clarifies this situation?
> 
> - Arnaldo

Clarifies in what way? The code checks for "(deleted)" on the dso and
suggests a restart of the process.

David

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-15 19:09           ` David Ahern
@ 2011-10-17  1:15             ` Arnaldo Carvalho de Melo
  2011-10-17  6:48               ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-17  1:15 UTC (permalink / raw)
  To: David Ahern
  Cc: Ingo Molnar, linux-kernel, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Thomas Jarosch

Em Sat, Oct 15, 2011 at 01:09:32PM -0600, David Ahern escreveu:
> On 10/15/2011 01:06 PM, Arnaldo Carvalho de Melo wrote:
> >>
> >> It should. The message comes from map__load() when it detects a deleted
> >> mapping such as:
> >>
> >> 7f9e8d5c7000-7f9e8d5c8000 rw-p 0000c000 fd:02 1046947
> >>  /lib64/libpam.so.0.82.2.#prelink#.cM3f72 (deleted)
> >>
> >> I have removed prelink from most of my systems (managed to find one lone
> >> server with the above).
> > 
> > 	Can you send me a patch that clarifies this situation?
> 
> Clarifies in what way? The code checks for "(deleted)" on the dso and
> suggests a restart of the process.

Perhaps telling that prelinking is the reason, so that users that don't
recall updating anything understands the situation.

- Arnaldo

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

* Re: [GIT PULL 0/5] perf/core improvements and fixes
  2011-10-17  1:15             ` Arnaldo Carvalho de Melo
@ 2011-10-17  6:48               ` Ingo Molnar
  0 siblings, 0 replies; 14+ messages in thread
From: Ingo Molnar @ 2011-10-17  6:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Ahern, linux-kernel, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, Thomas Jarosch


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

> Em Sat, Oct 15, 2011 at 01:09:32PM -0600, David Ahern escreveu:
> > On 10/15/2011 01:06 PM, Arnaldo Carvalho de Melo wrote:
> > >>
> > >> It should. The message comes from map__load() when it detects a deleted
> > >> mapping such as:
> > >>
> > >> 7f9e8d5c7000-7f9e8d5c8000 rw-p 0000c000 fd:02 1046947
> > >>  /lib64/libpam.so.0.82.2.#prelink#.cM3f72 (deleted)
> > >>
> > >> I have removed prelink from most of my systems (managed to find one lone
> > >> server with the above).
> > > 
> > > 	Can you send me a patch that clarifies this situation?
> > 
> > Clarifies in what way? The code checks for "(deleted)" on the dso and
> > suggests a restart of the process.
> 
> Perhaps telling that prelinking is the reason, so that users that 
> don't recall updating anything understands the situation.

Yeah. I am certainly aware of prelinking yet it did not occur to me 
when i saw the message.

Thanks,

	Ingo

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

end of thread, other threads:[~2011-10-17  6:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 18:27 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
2011-10-14 18:27 ` [PATCH 1/5] perf hists browser: Invalidate ui_browser->top after timer calls Arnaldo Carvalho de Melo
2011-10-14 18:27 ` [PATCH 2/5] perf annotate browser: Exit when pressing ESC or the left arrow Arnaldo Carvalho de Melo
2011-10-14 18:27 ` [PATCH 3/5] perf ui browser: Add filter method Arnaldo Carvalho de Melo
2011-10-14 18:27 ` [PATCH 4/5] perf annotate browser: Allow toggling the visualization of source code lines Arnaldo Carvalho de Melo
2011-10-14 18:27 ` [PATCH 5/5] perf buildid: Fix possible unterminated readlink() result buffer Arnaldo Carvalho de Melo
2011-10-15 14:59 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar
2011-10-15 17:00   ` David Ahern
2011-10-15 17:04     ` Ingo Molnar
2011-10-15 17:46       ` David Ahern
2011-10-15 19:06         ` Arnaldo Carvalho de Melo
2011-10-15 19:09           ` David Ahern
2011-10-17  1:15             ` Arnaldo Carvalho de Melo
2011-10-17  6:48               ` 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).