All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: "Josh Stone" <jistone@redhat.com>,
	"Frank Ch. Eigler" <fche@redhat.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jakub Jelinek" <jakub@redhat.com>,
	"Josh Boyer" <jwboyer@fedoraproject.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Markus Trippelsdorf" <markus@trippelsdorf.de>,
	"Michel Dänzer" <michel@daenzer.net>
Subject: [PATCH] Kbuild: Add an option to enable GCC VTA
Date: Mon,  6 Oct 2014 14:05:36 -0700	[thread overview]
Message-ID: <1412629536-21512-1-git-send-email-jistone@redhat.com> (raw)
In-Reply-To: <CA+55aFz_wx5BVir=WviqwE_ysKMXb1Ka8T7L+Gq2NT9S=yo2_w@mail.gmail.com>

Due to recent codegen issues, gcc -fvar-tracking-assignments was
unconditionally disabled in commit 2062afb4f804a ("Fix gcc-4.9.0
miscompilation of load_balance() in scheduler").  However, this reduces
the debuginfo coverage for variable locations, especially in inline
functions.  VTA is certainly not perfect either in those cases, but it
is much better than without.  With compiler versions that have fixed the
codegen bugs, we would prefer to have the better details for SystemTap,
and surely other debuginfo consumers like perf will benefit as well.

This patch simply makes CONFIG_DEBUG_INFO_VTA an option.  I considered
Frank and Linus's discussion of a cc-option-like -fcompare-debug test,
but I'm convinced that a narrow test of an arch-specific codegen issue
is not really useful.  GCC has their own regression tests for this, so
I'd suggest GCC_COMPARE_DEBUG=-fvar-tracking-assignments-toggle is more
useful for kernel developers to test confidence.

In fact, I ran into a couple more issues when testing for this patch[1],
although neither of those had any codegen impact.
 [1] https://bugzilla.redhat.com/show_bug.cgi?id=1140872

With gcc-4.9.1-11.fc22, I can now build 3.17 with Fedora's i686 and
x86_64 configs, and this is completely clean with GCC_COMPARE_DEBUG.

Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Josh Stone <jistone@redhat.com>
---
 Makefile          |  4 ++++
 lib/Kconfig.debug | 18 +++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index b77de27e58fc..dc107248beb5 100644
--- a/Makefile
+++ b/Makefile
@@ -709,7 +709,11 @@ KBUILD_CFLAGS	+= -fomit-frame-pointer
 endif
 endif
 
+ifdef CONFIG_DEBUG_INFO_VTA
+KBUILD_CFLAGS   += $(call cc-option, -fvar-tracking-assignments)
+else
 KBUILD_CFLAGS   += $(call cc-option, -fno-var-tracking-assignments)
+endif
 
 ifdef CONFIG_DEBUG_INFO
 ifdef CONFIG_DEBUG_INFO_SPLIT
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index a28590083622..ce1107439d7d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -165,7 +165,23 @@ config DEBUG_INFO_DWARF4
 	  Generate dwarf4 debug info. This requires recent versions
 	  of gcc and gdb. It makes the debug information larger.
 	  But it significantly improves the success of resolving
-	  variables in gdb on optimized code.
+	  variables in gdb on optimized code.  The gcc docs also
+	  recommend enabling -fvar-tracking-assignments for maximum
+	  benefit. (see DEBUG_INFO_VTA)
+
+config DEBUG_INFO_VTA
+	bool "Enable var-tracking-assignments for debuginfo"
+	depends on DEBUG_INFO
+	help
+	  Enable gcc -fvar-tracking-assignments for improved debug
+	  information on variable locations in optimized code.  Per
+	  gcc, DEBUG_INFO_DWARF4 is recommended for best use of VTA.
+
+	  VTA has been implicated in codegen bugs (gcc PR61801,
+	  PR61904), so this may deserve some caution.  One can set
+	  GCC_COMPARE_DEBUG=-fvar-tracking-assignments-toggle in the
+	  environment to automatically compile everything both ways,
+	  generating an error if anything differs.
 
 config ENABLE_WARN_DEPRECATED
 	bool "Enable __deprecated logic"
-- 
1.9.3


  reply	other threads:[~2014-10-06 21:06 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  1:48 [PATCH 3.15 00/37] 3.15.8-stable review Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 01/37] media: staging: tighten omap4iss dependencies Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 02/37] media: media: v4l2-core: v4l2-dv-timings.c: Cleaning up code wrong value used in aspect ratio Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 03/37] media: af9035: override tuner id when bad value set into eeprom Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 04/37] media: hdpvr: fix two audio bugs Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 05/37] media: tda10071: force modulation to QPSK on DVB-S Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 06/37] nfs: only show Posix ACLs in listxattr if actually present Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 07/37] xtensa: fix sysmem reservation at the end of existing block Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 08/37] block: provide compat ioctl for BLKZEROOUT Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 09/37] block: dont assume last put of shared tags is for the host Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 10/37] libata: support the ata host which implements a queue depth less than 32 Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 11/37] libata: introduce ata_host->n_tags to avoid oops on SAS controllers Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 12/37] s390/ptrace: fix PSW mask check Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 13/37] ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode) Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 14/37] blkcg: dont call into policy draining if root_blkg is already gone Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 15/37] tracing: Fix wraparound problems in "uptime" trace clock Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 16/37] zram: avoid lockdep splat by revalidate_disk Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 17/37] powerpc/pseries: dynamically added OF nodes need to call of_node_init Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 18/37] slab_common: fix the check for duplicate slab names Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 19/37] Input: synaptics - add min/max quirk for pnp-id LEN2002 (Edge E531) Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 20/37] Input: fix defuzzing logic Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 21/37] coredump: fix the setting of PF_DUMPCORE Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 22/37] fuse: s_time_gran fix Greg Kroah-Hartman
2014-07-30  1:48 ` [PATCH 3.15 23/37] fuse: add FUSE_NO_OPEN_SUPPORT flag to INIT Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 24/37] pinctrl: st: Fix irqmux handler Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 25/37] parisc: Remove SA_RESTORER define Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 26/37] hwmon: (smsc47m192) Fix temperature limit and vrm write operations Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 27/37] parport: fix menu breakage Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 28/37] fs: umount on symlink leaks mnt count Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 29/37] x86_32, entry: Store badsys error code in %eax Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 32/37] mm: hugetlb: fix copy_hugetlb_page_range() Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 34/37] hwrng: virtio - ensure reads happen after successful probe Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 35/37] mm: do not call do_fault_around for non-linear fault Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 36/37] nl80211: move set_qos_map command into split state Greg Kroah-Hartman
2014-07-30  1:49 ` [PATCH 3.15 37/37] platform_get_irq: Revert to platform_get_resource if of_irq_get fails Greg Kroah-Hartman
     [not found] ` <20140730014829.344302554@linuxfoundation.org>
2014-07-30  6:53   ` [PATCH 3.15 33/37] Fix gcc-4.9.0 miscompilation of load_balance() in scheduler Jakub Jelinek
2014-07-30  7:13     ` Markus Trippelsdorf
2014-07-30  7:21       ` Jakub Jelinek
2014-07-30  7:27         ` Markus Trippelsdorf
2014-07-30 15:47     ` Linus Torvalds
2014-08-05 11:31       ` Josh Boyer
2014-08-05 11:46         ` Markus Trippelsdorf
2014-08-05 15:24           ` Jakub Jelinek
2014-08-05 15:19         ` Greg Kroah-Hartman
2014-08-05 16:49         ` Linus Torvalds
2014-08-05 20:57           ` Josh Boyer
2014-08-05 21:07             ` Frank Ch. Eigler
2014-08-05 22:36               ` Linus Torvalds
2014-08-05 23:30                 ` Frank Ch. Eigler
2014-08-05 23:59                   ` Linus Torvalds
2014-10-06 21:05                     ` Josh Stone [this message]
2014-08-06  8:14                 ` Jakub Jelinek
2014-08-06 10:23                   ` Måns Rullgård
2014-08-06 10:23                     ` Måns Rullgård
2014-08-06 16:34                   ` Alexei Starovoitov
2014-07-30 11:58 ` [PATCH 3.15 00/37] 3.15.8-stable review Satoru Takeuchi
2014-07-30 11:58   ` Satoru Takeuchi
2014-07-30 15:50   ` Greg Kroah-Hartman
2014-07-30 16:09 ` Guenter Roeck
2014-07-30 22:23   ` Greg Kroah-Hartman
2014-11-21 18:40 [PATCH RESEND] Kbuild: Add an option to enable GCC VTA Josh Stone
2015-04-23 21:25 ` [PATCH] " Frank Ch. Eigler
2015-04-24 12:40   ` Josh Boyer
2015-04-24 13:42     ` Frank Ch. Eigler

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=1412629536-21512-1-git-send-email-jistone@redhat.com \
    --to=jistone@redhat.com \
    --cc=fche@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jakub@redhat.com \
    --cc=jwboyer@fedoraproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    --cc=michel@daenzer.net \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.