Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbbETN3k (ORCPT ); Wed, 20 May 2015 09:29:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48645 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbbETN3j (ORCPT ); Wed, 20 May 2015 09:29:39 -0400 Message-ID: <555C8C41.1080608@suse.cz> Date: Wed, 20 May 2015 15:29:37 +0200 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: linux-kernel@vger.kernel.org, Ingo Molnar , Paul Mackerras , Peter Zijlstra Subject: Re: [PATCH] perf: fix wrong DEBUG configuration References: <555B3D6F.6000301@suse.cz> <20150519140422.GJ13946@kernel.org> <555C871B.90900@suse.cz> <20150520131748.GC2955@kernel.org> In-Reply-To: <20150520131748.GC2955@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3795 Lines: 114 On 05/20/2015 03:17 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, May 20, 2015 at 03:07:39PM +0200, Martin Liška escreveu: >> On 05/19/2015 04:04 PM, Arnaldo Carvalho de Melo wrote: >>> Em Tue, May 19, 2015 at 03:41:03PM +0200, Martin Liška escreveu: >>>> Following patch is fix for wrong DEBUG configuration. >>> >>> Can you please state, in the changelog, what you think is wrong and how >>> your proposed change fixes it, so that after reading your intent I can >>> go and look at the code to see if it matches that? > > Ok, that improved things, thanks! A question: > >> >> Currently, GCC optimizes -O6 same as -O3 level. Right optimize debugging >> experience is given by passing -Og to compiler. > > Is this is this -Og available in old gcc versions? When was it > introduced? Do you know? > > - Arnaldo Hi GCC 4.8.0 is the first version capable of the option: https://gcc.gnu.org/gcc-4.8/changes.html. That can be problematic, which GCC version do you support in linux/perf? Martin > >> Assign default value for pointers that are identified by compiler as >> non-initialized. >> >> Signed-off-by: Martin Liska > >> >From b5f2b42b279ab497e92d41e1f4021dd5cb6ae3ce Mon Sep 17 00:00:00 2001 >> From: mliska >> Date: Thu, 2 Apr 2015 15:24:49 +0200 >> Subject: [PATCH] perf: fix wrong DEBUG configuration >> >> Currently, GCC optimizes -O6 same as -O3 level. Right optimize debugging >> experience is given by passing -Og to compiler. >> Assign default value for pointers that are identified by compiler as >> non-initialized. >> >> Signed-off-by: Martin Liska >> --- >> tools/perf/arch/common.c | 2 +- >> tools/perf/config/Makefile | 2 +- >> tools/perf/util/symbol.c | 2 +- >> tools/perf/util/trace-event-parse.c | 2 +- >> 4 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c >> index 49776f1..b7bb42c 100644 >> --- a/tools/perf/arch/common.c >> +++ b/tools/perf/arch/common.c >> @@ -61,7 +61,7 @@ const char *const mips_triplets[] = { >> static bool lookup_path(char *name) >> { >> bool found = false; >> - char *path, *tmp; >> + char *path, *tmp = NULL; >> char buf[PATH_MAX]; >> char *env = getenv("PATH"); >> >> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile >> index e3b3724..ca8d3e3 100644 >> --- a/tools/perf/config/Makefile >> +++ b/tools/perf/config/Makefile >> @@ -129,7 +129,7 @@ ifndef DEBUG >> endif >> >> ifeq ($(DEBUG),0) >> - CFLAGS += -O6 >> + CFLAGS += -Og >> endif >> >> ifdef PARSER_DEBUG >> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c >> index 82a31fd..a19fbd4 100644 >> --- a/tools/perf/util/symbol.c >> +++ b/tools/perf/util/symbol.c >> @@ -400,7 +400,7 @@ static struct symbol *symbols__find_by_name(struct rb_root *symbols, >> const char *name) >> { >> struct rb_node *n; >> - struct symbol_name_rb_node *s; >> + struct symbol_name_rb_node *s = NULL; >> >> if (symbols == NULL) >> return NULL; >> diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c >> index 25d6c73..d495741 100644 >> --- a/tools/perf/util/trace-event-parse.c >> +++ b/tools/perf/util/trace-event-parse.c >> @@ -173,7 +173,7 @@ void parse_ftrace_printk(struct pevent *pevent, >> char *line; >> char *next = NULL; >> char *addr_str; >> - char *fmt; >> + char *fmt = NULL; >> >> line = strtok_r(file, "\n", &next); >> while (line) { >> -- >> 2.1.4 >> > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/