From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 250C4385781F for ; Wed, 7 Apr 2021 20:36:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 250C4385781F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-ej1-x633.google.com with SMTP id n2so23592030ejy.7 for ; Wed, 07 Apr 2021 13:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j5g5osudjbAbs1dDomSqZGrJiRm/ts1qLQJAKKOcp1c=; b=PfVdiRGPxkeiShUDsKAuJ+Cwjbrbn0PNr9snVTyPpbmvT7fsbfnmS6lGXNUEjTSWVN rQ5ZWdB0ZPOU4TxoMbwPQdTibEVARBVGIYVcr0LdjKylD/zU8aZnVadkSfIExVGECnLu 5Bb/J+MWI40WzGK+ndRLab/SwT/aOaCU1TICIU1yR8BPQ7LdpmPQCleySfB4hdmHUOhy IPCbJVRxThPLGIESSdc7NeXgKzg3oI6P5+PpylnqpYkcHYfttBrjDR1nK/BL3IONBP+m bfpPQt3C2t5EsKWVSDf7iNEOa/j73OPSlnWOfY2+HcwLHZK3Q/EzIZt03VXTlMSOoF6I 99xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j5g5osudjbAbs1dDomSqZGrJiRm/ts1qLQJAKKOcp1c=; b=EgoTk5JtxUPTlHcy8dkwkhk19RwRUdtQfgyrmaluuedbNzqGvDHntKr0JaKy/IOnBH mNVj4DPvu6cfvAbtvw3oTUU4cKi6xMJQEvmQP6+OAxCaemXYa67IHW2ol3Q7Y58CEMfT nLrr4/PDEHEvpOQ2wKRlZFLK83SWIQSwlI76ihHgTTIu9fKVJ3uewuIivsrsdU0qvAEB 3rZVgeUvKim5ZSSvtqw82w0BIjGXXYGsTH4IAriZ3PQQSo0IOnRnniF9CDQzfko108E0 DmYiUYCMJlGtU2yFOO7eHVFaKZ2sVlpeif8Ul8hWUeCO4T0ZItc30wimWYZ4AoAz4CPY Vfcg== X-Gm-Message-State: AOAM530T55Y20k6VJ3bWNwHmEtbidZLj3MaGs+YSr4ofU9iXGCttNLnN IoTttvqEfadJQWJGKebHjJ2o2dz2iJMGj4Pi4VKlzw== X-Google-Smtp-Source: ABdhPJwLs/o39Zgvd3TdzxUOo+zDPpqDDIy5APd8idYAkIQ0NbwwAqVbeAGyjVIInarjgUytIQvhriaaQdZrZYtV40s= X-Received: by 2002:a17:906:4fcd:: with SMTP id i13mr5966821ejw.341.1617827760188; Wed, 07 Apr 2021 13:36:00 -0700 (PDT) MIME-Version: 1.0 References: <1A5BA72E-3209-430D-95F5-66AEAC541757@gmail.com> <85B58B5E-BA94-4FA3-9EF9-BB4F389109A1@gmail.com> In-Reply-To: <85B58B5E-BA94-4FA3-9EF9-BB4F389109A1@gmail.com> From: Jim Wilson Date: Wed, 7 Apr 2021 13:35:48 -0700 Message-ID: Subject: Re: Question about the coverage statistics of Gcov To: heng zhang Cc: gcc-help X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 20:36:02 -0000 On Tue, Apr 6, 2021 at 8:34 AM heng zhang wrote: > As you said=EF=BC=8C the 8th line has some unexecuted parts, i.e., =E2=80= =9C i++ =E2=80=9D so why > is not the execution time of the 8th line 1*? > The process of mapping source lines to object file basic blocks and back again is very complicated, depends on compiler optimizations and the source code, and we don't always do a perfect job of it. The gcov output should always be considered reasonable estimates. If you want better answers, try lowering the optimization level, or adding more newlines to your code so you have fewer statements on each source line. Jim