Bug 12468 - Missing functions and call counts
Summary: Missing functions and call counts
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gprof (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-05 14:53 UTC by Vincent Rivière
Modified: 2011-02-09 20:19 UTC (History)
1 user (show)

See Also:
Host:
Target: m68k-aout
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Rivière 2011-02-05 14:53:50 UTC
There has been a regression between the binutils 2.19.1 and 2.20.
Now gprof sees only functions having "self seconds" greater than 0. Other functions are not shown at all.
Also, for the visible functions, the the "calls" column is empty.

Given a correct gmon.out, gprof-2.19.1 displays it fine, while gprof-2.20 and higher have the problem described above.

I believe this bug affects all a.out targets.
I have tested this on the unofficial m68k-atari-mint target, since it is the only one for which I can run executables and produce a suitable gmon.out.
Comment 1 Vincent Rivière 2011-02-05 14:58:23 UTC
This bug comes from gprof/corefile.c, in the function core_create_function_syms().

Old code was:
symtab.limit->is_func = TRUE;

But the new code is:
symtab.limit->is_func = (core_syms[i]->flags & BSF_FUNCTION) != 0;

If I'm not wrong, the BSF_FUNCTION flag is not available on a.out targets, so the symbols are never considered as functions.

It works fine when I revert to TRUE unconditionally.
Ideally, the BSF_FUNCTION flag should be tested only if it is available on the target.
Comment 2 cvs-commit@gcc.gnu.org 2011-02-06 23:38:40 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2011-02-06 23:38:38

Modified files:
	gprof          : ChangeLog corefile.c 

Log message:
	PR gprof/12468
	* corefile.c (core_create_function_syms): Set is_func for targets
	that have no BSF_FUNCTION syms.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gprof/ChangeLog.diff?cvsroot=src&r1=1.296&r2=1.297
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gprof/corefile.c.diff?cvsroot=src&r1=1.40&r2=1.41
Comment 3 cvs-commit@gcc.gnu.org 2011-02-06 23:39:56 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_21-branch
Changes by:	amodra@sourceware.org	2011-02-06 23:39:54

Modified files:
	gprof          : ChangeLog corefile.c 

Log message:
	PR gprof/12468
	* corefile.c (core_create_function_syms): Set is_func for targets
	that have no BSF_FUNCTION syms.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gprof/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.290.2.4&r2=1.290.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gprof/corefile.c.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.40&r2=1.40.2.1
Comment 4 Alan Modra 2011-02-06 23:42:42 UTC
fixed
Comment 5 Vincent Rivière 2011-02-09 20:19:04 UTC
Thanks, it works :-)