Skip to contentSkip to conversation

perf: fix use_browser infinite loop bug in annotate

PATCH In review Stephane Eranian 2 participants 4 messages May 27, 2010 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: fix use_browser infinite loop bug in annotate

This patch fixes an infinite loop problem with perf annotate when the TUI is not used. When the perfconfig file is not found use_browser remains at -1, when found and tui is disabled use_browser = 0. Thus the correct test for TUI is use_browser > 0.

tools/perf/builtin-annotate.c +1 -1
index 08278ed..96db524 100644
@@ -343,7 +343,7 @@ find_next:
 			continue;
 		}
 
-		if (use_browser) {
+		if (use_browser > 0) {
 			key = hist_entry__tui_annotate(he);
 			if (is_exit_key(key))
 				break;
#1 lore raw

Em Thu, May 27, 2010 at 02:50:01PM +0200, Stephane Eranian escreveu:

Quoted 6 lines

This patch fixes an infinite loop problem with perf annotate when the TUI is not used. When the perfconfig file is not found use_browser remains at -1, when found and tui is disabled use_browser = 0. Thus the correct test for TUI is use_browser > 0.

Thanks, I'm applying this one and doing an audit of other uses, I know of one more case reported by Frédéric that was fixed in a similar way.

Quoted 13 lines
tools/perf/builtin-annotate.c +1 -1
index 08278ed..96db524 100644
@@ -343,7 +343,7 @@ find_next:
 			continue;
 		}
 
-		if (use_browser) {
+		if (use_browser > 0) {
 			key = hist_entry__tui_annotate(he);
 			if (is_exit_key(key))
 				break;
#2 lore raw

Em Thu, May 27, 2010 at 11:51:42AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 10 lines

Em Thu, May 27, 2010 at 02:50:01PM +0200, Stephane Eranian escreveu:

Quoted 6 lines

This patch fixes an infinite loop problem with perf annotate when the TUI is not used. When the perfconfig file is not found use_browser remains at -1, when found and tui is disabled use_browser = 0. Thus the correct test for TUI is use_browser > 0.

Thanks, I'm applying this one and doing an audit of other uses, I know of one more case reported by Frédéric that was fixed in a similar way.

Oops, I already have this fixed on changeset

62e3436b5f3461662929eae102beefbd12127cb1

That is at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf

http://git.kernel.org/?p=linux/kernel/git/acme/linux-2.6.git;a=commit;h=62e3436b5f3461662929eae102beefbd12127cb1

I pushed this to Ingo yesterday, should be in tip/perf/core soon,
thanks anyway!

- Arnaldo

#3 lore raw
Quoted 16 lines · Arnaldo Carvalho de Melo

Em Thu, May 27, 2010 at 11:51:42AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 10 lines

Em Thu, May 27, 2010 at 02:50:01PM +0200, Stephane Eranian escreveu:

Quoted 6 lines

This patch fixes an infinite loop problem with perf annotate when the TUI is not used. When the perfconfig file is not found use_browser remains at -1, when found and tui is disabled use_browser = 0. Thus the correct test for TUI is use_browser > 0.

Thanks, I'm applying this one and doing an audit of other uses, I know of one more case reported by Frédéric that was fixed in a similar way.

       Oops, I already have this fixed on changeset

62e3436b5f3461662929eae102beefbd12127cb1

Quoted 9 lines

       That is at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf

http://git.kernel.org/?p=linux/kernel/git/acme/linux-2.6.git;a=commit;h=62e3436b5f3461662929eae102beefbd12127cb1

       I pushed this to Ingo yesterday, should be in tip/perf/core soon, thanks anyway!

Ok, if it's fixed then this is fine. The other problem I reported is more important.
Thanks for checking.