From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 7073A3858D37 for ; Fri, 22 Apr 2022 10:13:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7073A3858D37 Received: by mail-pl1-x635.google.com with SMTP id q3so9847116plg.3 for ; Fri, 22 Apr 2022 03:13:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=qP4yPhIM57xMUsmZyJETdW9Px786JKC4IvI/aTIxH6o=; b=BJvd9BW0pX5P6t7D+wmoCmLKiwhtk8xG4mPFqpS/mNdvnS/tF07i1rI/T/rC2Ob8/7 SwHoFEdS+iBcg3bqL2VXOFiOjX2g4FCvClmb5AofTaHAcDwhDmS7xsvz/mr48slrh7nd MaOt1IIrS58lNxEaB6NXYS0wxSumE6jtrU+jBQuGsJkfy2lalGckWcrw9JeFzmDlbo4s jwxonDjEIwLtyzA1QMVJI6XjfWYgugXoG8nuXdcv5qKRRZTGUu0D3q71dy6HO7nUJC4r uwVASUbzuzvVFcPbzSnyzkR1v8/ZgABZr7e5Q4f/3RLt05KBSyx2DTWZhTRBbMUyBDgE bE6A== X-Gm-Message-State: AOAM533QIpQfiZ0utlXtCGpTpVhYS78AuU1h9ZxXU2ISMoHJxOAbr+FC IgsL2MnqyGY786PWkYnZsw8FJ/QaSSmI8sA0 X-Google-Smtp-Source: ABdhPJwck9s5ZD+wvB+DKgJoGsWkhuF0VvJwh0GPGKibUSeC1bGbnIqe3eFgeScBvH3GQuv6kUjTew== X-Received: by 2002:a17:90b:4f48:b0:1d1:d1ba:2aa5 with SMTP id pj8-20020a17090b4f4800b001d1d1ba2aa5mr15160090pjb.116.1650622418462; Fri, 22 Apr 2022 03:13:38 -0700 (PDT) Received: from [172.16.185.109] ([103.175.111.222]) by smtp.gmail.com with ESMTPSA id n2-20020aa79042000000b005057336554bsm2000222pfo.128.2022.04.22.03.13.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 03:13:38 -0700 (PDT) Message-ID: <80eebd32-cec5-3a6d-dccd-dd0becb720f9@woven-planet.global> Date: Fri, 22 Apr 2022 12:13:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] Add condition coverage profiling Content-Language: en-US To: Sebastian Huber , gcc-patches@gcc.gnu.org References: <1ee43d5d-9c6c-f55b-e5b1-c82a6ff5f653@embedded-brains.de> <135f1f97-9359-f3fa-7718-4384aa9a376f@woven-planet.global> <119d52c0-713a-b55b-8745-53a2307dfd9f@embedded-brains.de> <67e557c7-f03e-9c0b-faf1-fefbecddcac6@woven-planet.global> <14a74c2a-6131-294c-01b5-513bd76f4f52@embedded-brains.de> From: =?UTF-8?Q?J=c3=b8rgen_Kvalsvik?= In-Reply-To: <14a74c2a-6131-294c-01b5-513bd76f4f52@embedded-brains.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2022 10:13:41 -0000 On 22/04/2022 07:37, Sebastian Huber wrote: > > > On 17/04/2022 13:27, Jørgen Kvalsvik wrote: >>> In theory, would it be possible to print the state of the truth table with the >>> information available in the gcda and gcno files? For example: >>> >>> Truth table for: a && (b || c)) && d >>> >>> 0 | 1 | 2 | 3 || covered >>> --+---+---+---++-------- >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 0 | X | X | X || Y >>> 1 | 0 | 0 | X || N >>> 1 | 0 | 0 | X || N >>> 1 | 0 | 1 | 0 || N >>> 1 | 0 | 1 | 1 || N >>> 1 | 1 | X | 0 || Y >>> 1 | 1 | X | 0 || Y >>> 1 | 1 | X | 1 || Y >>> 1 | 1 | X | 1 || Y >> Maybe? We would at least need to store the masking tables too, which right now >> are implicitly stored as in the instrumentation. It's not too bad, but it >> probably means the two functions should return some richer structure, which in >> turn means a little bit of redesign. Computing the truth table itself shouldn't >> be difficult. > > Using the tool in the context of safety-critical application would normally > require also a tool qualification. For GCC, this is a bit unrealistic. It would > help if the tool output can be verified. Being able to inspect the masking > tables could help a reviewer to check what the tool did for a sample set of inputs. > It would be useful for the developer too. Recording the masking vectors isn't hard (they have to be computed after all), maybe it as opt-in behind a flag?