From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932114AbbLGKso (ORCPT ); Mon, 7 Dec 2015 05:48:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:59987 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755525AbbLGKsL (ORCPT ); Mon, 7 Dec 2015 05:48:11 -0500 Subject: Re: [RFC] The -Og debugging experience To: Jiri Olsa , Jiri Olsa References: <20151202164827.GA21124@krava.brq.redhat.com> Cc: Arnaldo Carvalho de Melo , lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <566563E7.9040706@suse.cz> Date: Mon, 7 Dec 2015 11:48:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151202164827.GA21124@krava.brq.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/02/2015 05:48 PM, Jiri Olsa wrote: > heya, > using the -Og for DEBUG=1 builds gives me many 'optimized out' stuff > > It was introduced in here: > e8b7ea4356fd perf tools: Improve setting of gcc debug option > > - here's backtrace from segfault I was looking at, current code: Hi. Can you please provide a test-case which I can use for testing of the issue? If -Og is problem, I would suggest to use -O0 as a default DEBUG configure option. Thanks, Martin > > (gdb) bt > #0 0x00000000004b490f in parse_events__scan_string (yystr=yystr@entry=0x0, yyscanner=0x1916be0) at util/parse-events-flex.c:3353 > #1 0x000000000048fe6f in parse_events__scanner (str=0x0, data=data@entry=0x7fffffffdac0, start_token=start_token@entry=258) > at util/parse-events.c:1356 > #2 0x0000000000491775 in parse_events (evlist=evlist@entry=0x1917c90, str=, err=err@entry=0x0) at util/parse-events.c:1401 > #3 0x0000000000468bf6 in __perf_evsel__name_array_test (names=0x872c00 , nr_names=nr_names@entry=11) > at tests/evsel-roundtrip-name.c:74 > #4 0x0000000000468f13 in test__perf_evsel__roundtrip_name_test (subtest=) at tests/evsel-roundtrip-name.c:106 > #5 0x000000000045a2c8 in run_test (test=test@entry=0x86fe50 , subtest=subtest@entry=-1) at tests/builtin-test.c:241 > #6 0x000000000045a3a1 in test_and_print (t=t@entry=0x86fe50 , force_skip=force_skip@entry=false, > subtest=subtest@entry=-1) at tests/builtin-test.c:268 > #7 0x000000000045a5cd in __cmd_test (argc=argc@entry=1, argv=argv@entry=0x7fffffffe200, skiplist=0x0) at tests/builtin-test.c:324 > #8 0x000000000045a8a9 in cmd_test (argc=1, argv=0x7fffffffe200, prefix=) at tests/builtin-test.c:416 > #9 0x00000000004784a9 in run_builtin (p=p@entry=0x871e18 , argc=argc@entry=2, argv=argv@entry=0x7fffffffe200) at perf.c:387 > #10 0x00000000004786a4 in handle_internal_command (argc=2, argv=0x7fffffffe200) at perf.c:448 > #11 0x0000000000478710 in run_argv (argcp=argcp@entry=0x7fffffffe06c, argv=argv@entry=0x7fffffffe060) at perf.c:492 > #12 0x0000000000478981 in main (argc=2, argv=0x7fffffffe200) at perf.c:609 > > > - and same crash with above patch reverted: > > (gdb) bt > #0 0x00007ffff573f36a in strlen () from /lib64/libc.so.6 > #1 0x00000000004f458b in parse_events__scan_string (yystr=0x0, yyscanner=0x1985be0) at util/parse-events-flex.c:3353 > #2 0x00000000004bc752 in parse_events__scanner (str=0x0, data=0x7fffffffda50, start_token=258) at util/parse-events.c:1356 > #3 0x00000000004bc8e2 in parse_events (evlist=0x1986c90, str=0x0, err=0x0) at util/parse-events.c:1401 > #4 0x00000000004837c4 in __perf_evsel__name_array_test (names=0x8e1140 , nr_names=11) > at tests/evsel-roundtrip-name.c:74 > #5 0x0000000000483969 in test__perf_evsel__roundtrip_name_test (subtest=-1) at tests/evsel-roundtrip-name.c:106 > #6 0x000000000047099b in run_test (test=0x8de030 , subtest=-1) at tests/builtin-test.c:241 > #7 0x0000000000470ae3 in test_and_print (t=0x8de030 , force_skip=false, subtest=-1) at tests/builtin-test.c:268 > #8 0x0000000000470d71 in __cmd_test (argc=1, argv=0x7fffffffe200, skiplist=0x0) at tests/builtin-test.c:324 > #9 0x00000000004711c4 in cmd_test (argc=1, argv=0x7fffffffe200, prefix=0x0) at tests/builtin-test.c:416 > #10 0x0000000000498070 in run_builtin (p=0x8dfe58 , argc=2, argv=0x7fffffffe200) at perf.c:387 > #11 0x00000000004982de in handle_internal_command (argc=2, argv=0x7fffffffe200) at perf.c:448 > #12 0x000000000049842a in run_argv (argcp=0x7fffffffe05c, argv=0x7fffffffe050) at perf.c:492 > #13 0x0000000000498786 in main (argc=2, argv=0x7fffffffe200) at perf.c:609 > > > I haven't tracked the history of -Og, maybe it gets better from some gcc version? > > If there's no clue, I rather revert this one, because it does > provide the proper debugging experience ;-) > > thoughts? > jirka >