Bug 1290759

Summary: gcov takes up to 36hours to process xfs_sb.gcda on Intel Xeon
Product: Red Hat Enterprise Linux 7 Reporter: Jan Stancek <jstancek>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: qe-baseos-tools-bugs
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: bfoster, eguan, fhrbata, jakub, jburke, jstancek, law, mnewsome, mpolacek, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-22 18:40:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer 1
none
reproducer 2 (C source example) none

Description Jan Stancek 2015-12-11 11:18:39 UTC
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 11:21:08 UTC
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 11:24:57 UTC
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

Comment 8 Red Hat Bugzilla 2023-09-14 03:14:39 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days