Bug 1290759 - gcov takes up to 36hours to process xfs_sb.gcda on Intel Xeon [NEEDINFO]
gcov takes up to 36hours to process xfs_sb.gcda on Intel Xeon
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc (Show other bugs)
7.3
All Linux
unspecified Severity high
: rc
: ---
Assigned To: Jakub Jelinek
qe-baseos-tools
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-11 06:18 EST by Jan Stancek
Modified: 2016-11-22 13:40 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-22 13:40:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
mnewsome: needinfo? (jakub)


Attachments (Terms of Use)
reproducer 1 (7.14 KB, application/octet-stream)
2015-12-11 06:21 EST, Jan Stancek
no flags Details
reproducer 2 (C source example) (726 bytes, application/octet-stream)
2015-12-11 06:24 EST, Jan Stancek
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 67992 None None None 2016-11-22 13:39 EST

  None (edit)
Description Jan Stancek 2015-12-11 06:18:39 EST
Description of problem:
gcov performance is really bad when processing kernel file "xfs_sb.c", specifically this construct takes days to process when running with --all-blocks:

xfs_mount_validate_sb@fs/xfs/libxfs/xfs_sb.c:
...
        if (unlikely(
            sbp->sb_agcount <= 0                                        ||
            sbp->sb_sectsize < XFS_MIN_SECTORSIZE                       ||
            sbp->sb_sectsize > XFS_MAX_SECTORSIZE                       ||
            sbp->sb_sectlog < XFS_MIN_SECTORSIZE_LOG                    ||
            sbp->sb_sectlog > XFS_MAX_SECTORSIZE_LOG                    ||
            sbp->sb_sectsize != (1 << sbp->sb_sectlog)                  ||
            sbp->sb_blocksize < XFS_MIN_BLOCKSIZE                       ||
            sbp->sb_blocksize > XFS_MAX_BLOCKSIZE                       ||
            sbp->sb_blocklog < XFS_MIN_BLOCKSIZE_LOG                    ||
            sbp->sb_blocklog > XFS_MAX_BLOCKSIZE_LOG                    ||
            sbp->sb_blocksize != (1 << sbp->sb_blocklog)                ||
            sbp->sb_dirblklog > XFS_MAX_BLOCKSIZE_LOG                   ||
            sbp->sb_inodesize < XFS_DINODE_MIN_SIZE                     ||
            sbp->sb_inodesize > XFS_DINODE_MAX_SIZE                     ||
            sbp->sb_inodelog < XFS_DINODE_MIN_LOG                       ||
            sbp->sb_inodelog > XFS_DINODE_MAX_LOG                       ||
            sbp->sb_inodesize != (1 << sbp->sb_inodelog)                ||
            sbp->sb_logsunit > XLOG_MAX_RECORD_BSIZE                    ||
            sbp->sb_inopblock != howmany(sbp->sb_blocksize,sbp->sb_inodesize) ||
            (sbp->sb_blocklog - sbp->sb_inodelog != sbp->sb_inopblog)   ||
            (sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE)  ||
            (sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE)  ||
            (sbp->sb_imax_pct > 100 /* zero sb_imax_pct is valid */)    ||
            sbp->sb_dblocks == 0                                        ||
            sbp->sb_dblocks > XFS_MAX_DBLOCKS(sbp)                      ||
            sbp->sb_dblocks < XFS_MIN_DBLOCKS(sbp)                      ||
            sbp->sb_shared_vn != 0)) {
                xfs_notice(mp, "SB sanity check failed");
                return -EFSCORRUPTED;
        }


Version-Release number of selected component (if applicable):
gcc-4.8.5-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
run gcov on gcov enabled kernel in fs/xfs with --all-blocks
-or-
run attached reproducer

Actual results:
it takes days for gcov to complete

Expected results:
gcov should complete in more reasonable time (minutes)

Additional info:
[GCC] Bug 67992 - GCOV takes an absurdly long time to process a file 
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67992
Comment 1 Jan Stancek 2015-12-11 06:21 EST
Created attachment 1104615 [details]
reproducer 1

1. unpack
2. run "make"
# make
time gcov -b -c -d -a ./xfs_sb.gcda
Processing file 1 out of 1
Comment 2 Jan Stancek 2015-12-11 06:24 EST
Created attachment 1104616 [details]
reproducer 2 (C source example)

1. unpack
2. run "make"
3. run "./a.out"
4. run "make gcov"

# make
gcc -O2 -fprofile-arcs -ftest-coverage test1.c
# ./a.out 
# make gcov
gcov -b -c -d -a test1.gcda
Processing file 1 out of 1

Note You need to log in before you can comment on or make changes to this bug.