From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id F4038385085A for ; Wed, 8 Mar 2023 13:20:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F4038385085A Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 7500B28A09F; Wed, 8 Mar 2023 14:19:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1678281599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jB/jlxvQbr2Y7fIVyMCKTvZBXdMf+5wGhWTT4Y/45fo=; b=LyV+U03b6n1nFbHu41LRQULagMYzrYnsQdyRvjVhf6yXPXRZzNWIa/+z4+aAAPouU0jhBG 7gVFOCGXribJeenwyb8keENMdHNChyT4hkcx5PDLGTxng8EOjop4BNvlN8P5KF9hvZWH0l jjSOn3HWN4hBgRwPe93NWQOawrT3M+8= Date: Wed, 8 Mar 2023 14:19:59 +0100 From: Jan Hubicka To: Qing Zhao Cc: gcc Patches Subject: Re: HELP: Questions on multiple PROGRAM_SUMMARY sections in a profiling data file Message-ID: References: <520B12AE-711B-48B1-926F-A543131F8095@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <520B12AE-711B-48B1-926F-A543131F8095@oracle.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Hi, Jan, > > I am studying one profiling feedback ICE bug with GCC8 recently. > It’s an assertion failure inside the routine “compute_working_sets”of gcov-io.c: > > gcov_nonruntime_assert (ws_ix == NUM_GCOV_WORKING_SETS); > > After some debugging and study, I found that the corresponding .gcda file has two PROGRAM_SUMMARY sections: > > foo.gcda: a3000000: 202:PROGRAM_SUMMARY checksum=0x91f3e3ae > foo.gcda: counts=10831, runs=0, sum_all=478965, run_max=125615, sum_max=201126 > foo.gcda: counter histogram: > foo.gcda: 0: num counts=10187, min counter=0, cum_counter=0 > … > foo.gcda: 51: num counts=1, min counter=14524, cum_counter=14524 > foo.gcda: 63: num counts=1, min counter=125615, cum_counter=125615 > foo.gcda: a3000000: 137:PROGRAM_SUMMARY checksum=0xcf9f0896 > foo.gcda: counts=10502, runs=1, sum_all=48618, run_max=13999, sum_max=14046 > foo.gcda: counter histogram: > foo.gcda: 0: num counts=9821, min counter=0, cum_counter=0 > … > foo.gcda: 43: num counts=1, min counter=3830, cum_counter=3830 > foo.gcda: 50: num counts=1, min counter=13999, cum_counter=13999 > > Looks like the 2nd PROGRAM_SUMMARY has some issue. If I manually change gcc/coverage.c > to ignore the 2nd PROGRAM_SUMMARY section, the ICE disappears. > > I have several questions for the profiling feedback data file: > > 1. Under what situation, there will be multiple PROGRAM_SUMMARY sections for one module? This is itended to resolve situations where one object file is linked into multiple final binaries (just like libbackend is linked into multiple FEs). The overall binary checksum is known to the runtime and it creates entry for each checksum. > 2. How to check whether one of the PROGRAM_SUMMARY has issue? The histograms was added by google to get better threshold for hot/cold partitioning. They never worked too well, because it is hard to merge histograms from multipe runs meaningfully, so we dropped them some time ago. With LTO it is easier to produce the histogram after reading all profiles together and without LTO we use easier heuristics that only computes constant fraction of maximum number of iterations. What confuses me is the first summary having runs=0. I wonder how with zero runs it even has an entry? What is the assert that fials in gcov-io.c? Honza > > Thanks a lot for any help. > > Qing