Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932911AbbLBQsc (ORCPT ); Wed, 2 Dec 2015 11:48:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43266 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755686AbbLBQsa (ORCPT ); Wed, 2 Dec 2015 11:48:30 -0500 Date: Wed, 2 Dec 2015 17:48:27 +0100 From: Jiri Olsa To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Martin Liska Subject: [RFC] The -Og debugging experience Message-ID: <20151202164827.GA21124@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3940 Lines: 59 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: (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 -- 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/