linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <namhyung@kernel.org>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
	penberg@kernel.org, namhyung@kernel.org, tglx@linutronix.de
Subject: [tip:perf/core] perf ui/gtk: Setup browser window early
Date: Fri, 25 Jan 2013 03:24:42 -0800	[thread overview]
Message-ID: <tip-6bf1a295a896c8dbe8cad663c6344e8c877a0570@git.kernel.org> (raw)
In-Reply-To: <1356078018-31905-3-git-send-email-namhyung@kernel.org>

Commit-ID:  6bf1a295a896c8dbe8cad663c6344e8c877a0570
Gitweb:     http://git.kernel.org/tip/6bf1a295a896c8dbe8cad663c6344e8c877a0570
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Fri, 21 Dec 2012 17:20:14 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 24 Jan 2013 16:40:16 -0300

perf ui/gtk: Setup browser window early

The ui__error/warning functions use gtk infobar or statusbar and pr_*
functions use statusbar too.  But after perf gtk context created but
those infobar and/or statusbar not yet set up, calling one of those
functions will get a segment fault.

Although current code has no problem, move these setting as early as
possible so that it can prevent the segfault from future change.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1356078018-31905-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 26912f8..c03da79 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -180,6 +180,17 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist,
 
 	notebook = gtk_notebook_new();
 
+	gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
+
+	info_bar = perf_gtk__setup_info_bar();
+	if (info_bar)
+		gtk_box_pack_start(GTK_BOX(vbox), info_bar, FALSE, FALSE, 0);
+
+	statbar = perf_gtk__setup_statusbar();
+	gtk_box_pack_start(GTK_BOX(vbox), statbar, FALSE, FALSE, 0);
+
+	gtk_container_add(GTK_CONTAINER(window), vbox);
+
 	list_for_each_entry(pos, &evlist->entries, node) {
 		struct hists *hists = &pos->hists;
 		const char *evname = perf_evsel__name(pos);
@@ -199,17 +210,6 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist,
 		gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window, tab_label);
 	}
 
-	gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
-
-	info_bar = perf_gtk__setup_info_bar();
-	if (info_bar)
-		gtk_box_pack_start(GTK_BOX(vbox), info_bar, FALSE, FALSE, 0);
-
-	statbar = perf_gtk__setup_statusbar();
-	gtk_box_pack_start(GTK_BOX(vbox), statbar, FALSE, FALSE, 0);
-
-	gtk_container_add(GTK_CONTAINER(window), vbox);
-
 	gtk_widget_show_all(window);
 
 	perf_gtk__resize_window(window);

  reply	other threads:[~2013-01-25 11:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21  8:20 [PATCH 0/6] perf annotate: Add support for GTK+ annotation browser (v1) Namhyung Kim
2012-12-21  8:20 ` [PATCH 1/6] perf ui/gtk: Factor out common browser routines Namhyung Kim
2013-01-25 11:23   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-21  8:20 ` [PATCH 2/6] perf ui/gtk: Setup browser window early Namhyung Kim
2013-01-25 11:24   ` tip-bot for Namhyung Kim [this message]
2012-12-21  8:20 ` [PATCH 3/6] perf ui/gtk: Implement basic GTK2 annotation browser Namhyung Kim
2012-12-21 14:51   ` Arnaldo Carvalho de Melo
2012-12-24  5:55     ` Namhyung Kim
2012-12-21  8:20 ` [PATCH 4/6] perf gtk/annotate: Support multiple annotation result Namhyung Kim
2012-12-21  8:20 ` [PATCH 5/6] perf gtk/annotate: Show source lines with gray color Namhyung Kim
2012-12-21  8:20 ` [PATCH 6/6] perf annotate: Add --gtk option Namhyung Kim
2012-12-21  8:32   ` Borislav Petkov
2012-12-21  9:16     ` Namhyung Kim
2012-12-21 15:44       ` Borislav Petkov
2012-12-24  6:04         ` Namhyung Kim
2012-12-24 13:18           ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-6bf1a295a896c8dbe8cad663c6344e8c877a0570@git.kernel.org \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).