New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: generate debugging information to display inlined functions in backtraces #4735

Open
remyoudompheng opened this Issue Jan 31, 2013 · 11 comments

Comments

Projects
None yet
7 participants
@remyoudompheng
Contributor

remyoudompheng commented Jan 31, 2013

Inlined functions do not show up in backtraces. It would be interesting to add support
for inlined functions in backtraces so that inlining of non-leaf functions does not
break behaviour.
@minux

This comment has been minimized.

Member

minux commented Feb 1, 2013

Comment 1:

yeah, this is an interesting task.
i suggest we switch to DWARF, so that we don't need an extra copy of
DWARF just for gdb.
are there any readily usable DWARF reader with BSD license?

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Feb 1, 2013

Comment 2:

For reading line number information, not types: gcc/libbacktrace.  It's in the GCC
source code but it's under a BSD license.
@minux

This comment has been minimized.

Member

minux commented Feb 1, 2013

Comment 3:

can we afford to use it in our runtime library?
how big is it?
@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Feb 1, 2013

Comment 4:

It would take some adjustment for the gc runtime library, of course (I already use it in
the gccgo runtime library).  The DWARF reading code is 3000 lines and compiles to 18,685
bytes on amd64 when compiled with GCC when optimizing.  That includes some error
handling and some generality that may not be necessary.  The ELF reading code, which is
probably unnecessary, is 900 lines, 4269 bytes.
@rsc

This comment has been minimized.

Contributor

rsc commented Feb 1, 2013

Comment 5:

There's a dwarf reader in plan9port too, integrated into its copy of
libmach.
@robpike

This comment has been minimized.

Contributor

robpike commented Mar 7, 2013

Comment 6:

Labels changed: removed go1.1maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Nov 27, 2013

Comment 7:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added release-none, removed go1.3maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@dvyukov

This comment has been minimized.

Member

dvyukov commented Jul 26, 2014

Comment 10:

FWIW we could use the new PC-associated data to store info about inlined functions. I
don't know what will be the amount of duplicated info, though.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc changed the title from cmd/ld: generate debugging information to display inlined functions in backtraces to cmd/link: generate debugging information to display inlined functions in backtraces Jun 8, 2015

@tdewolff

This comment has been minimized.

tdewolff commented Aug 22, 2016

Does this happen to be on anyone's radar for 1.8 or 1.9? Or is this a low-priority feature request?

More aggressive inlining would certainly give a large performance boost to a lot of constructs. For example, inlining thunk functions (#8421) and inlining functions that can't inline all the way down (@dr2chase comment in #11189). The last one would certainly help me in one spot: https://github.com/tdewolff/buffer/blob/master/lexer.go#L158, which is a function that is called very often but only sometimes calls the costly read function. Peek would increase performance for the parsers using this library by 10%-20%, which is a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment