gprof: get empty output

Bug #1678510 reported by Eldar Khayrullin on 2017-04-01
74
This bug affects 16 people
Affects Status Importance Assigned to Milestone
gcc-5 (Ubuntu)
Undecided
Unassigned
gcc-6 (Ubuntu)
Undecided
Unassigned
gcc-7 (Ubuntu)
Undecided
Unassigned

Bug Description

OS: Ubuntu 16.10 x64.
Version: GNU gprof (GNU Binutils for Ubuntu) 2.27

Steps:
gcc tst.c -g -pg -o tst
./tst # produced gmon.out file
gprof ./tst

*************************Output****************************
Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  % cumulative self self total
 time seconds seconds calls Ts/call Ts/call name

 % the percentage of the total running time of the
time program used by this function.

cumulative a running sum of the number of seconds accounted
 seconds for by this function and those listed above it.

 self the number of seconds accounted for by this
seconds function alone. This is the major sort for this
           listing.

calls the number of times this function was invoked, if
           this function is profiled, else blank.

 self the average number of milliseconds spent in this
ms/call function per call, if this function is profiled,
    else blank.

 total the average number of milliseconds spent in this
ms/call function and its descendents per call, if this
    function is profiled, else blank.

name the name of the function. This is the minor sort
           for this listing. The index shows the location of
    the function in the gprof listing. If the index is
    in parenthesis it shows where it would appear in
    the gprof listing if it were to be printed.

Copyright (C) 2012-2016 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.

Eldar Khayrullin (eldar) on 2017-04-01
summary: - gprof: get empty list
+ gprof: get empty output
Eldar Khayrullin (eldar) on 2017-04-02
tags: added: profile
tags: added: profiler
removed: profile
Eldar Khayrullin (eldar) on 2017-04-02
no longer affects: binutils (Ubuntu)
Eldar Khayrullin (eldar) wrote :

Affected:
gcc-5 (Ubuntu 5.4.1-2ubuntu2) 5.4.1 20160929
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005

Works fine:
gcc-4.9 (Ubuntu 4.9.4-2ubuntu1) 4.9.4

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-5 (Ubuntu):
status: New → Confirmed
Changed in gcc-6 (Ubuntu):
status: New → Confirmed
Max Staff (max-staff) wrote :

Is there a workaround?

Eldar Khayrullin (eldar) wrote :

@max-staff As workarount use gcc 4.9 for profilling. I don't know another ways yet.

Max Staff (max-staff) wrote :

@eldar unfortunately I can't use gcc 4.9 because I'm using C++ language features that are not supported in that version. If anybody has a workaround using a newer compiler that would be nice.

Karel Pánek (empyreum) wrote :

You can use gcc -no-pie option as a workaround.

Paul Smith (pjsanfil) wrote :

Looks like this is fixed in glibc 2.27.
https://sourceware.org/bugzilla/show_bug.cgi?id=22284

Paul Smith (pjsanfil) wrote :

Oops, this problem still occurs with glibc 2.27, my mistake.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-7 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.