From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 1CA0D385782C for ; Fri, 20 Nov 2020 16:14:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1CA0D385782C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sebastian.huber@embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1kg93C-0006Et-5m; Fri, 20 Nov 2020 17:14:18 +0100 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1kg93C-0008Lx-2h; Fri, 20 Nov 2020 17:14:18 +0100 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id E133A2A1610; Fri, 20 Nov 2020 17:10:57 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id MKREMXxfzr80; Fri, 20 Nov 2020 17:10:57 +0100 (CET) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 8E1482A165B; Fri, 20 Nov 2020 17:10:57 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Wl8TPZqKMKUG; Fri, 20 Nov 2020 17:10:57 +0100 (CET) Received: from shuber-nb-linux.eb.localhost (unknown [10.10.171.18]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 58AF52A1610; Fri, 20 Nov 2020 17:10:57 +0100 (CET) Subject: Re: [PATCH] gcov: Add __gcov_info_to_gdca() To: =?UTF-8?Q?Martin_Li=c5=a1ka?= , gcc-patches@gcc.gnu.org References: <20201117095741.3143-1-sebastian.huber@embedded-brains.de> <5d8b78e4-5c8b-3dde-e551-560e077bde5c@suse.cz> <1209b985-8be3-3dc4-9dc5-533d5d410f0e@embedded-brains.de> <261a4706-6670-9f2c-0852-bfab996fbfc0@suse.cz> <2e44e7bd-b70e-2af7-98a7-0544ee7e339c@suse.cz> From: Sebastian Huber Message-ID: <731f88c4-63aa-6038-9740-2f71a8dea5e5@embedded-brains.de> Date: Fri, 20 Nov 2020 17:14:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <2e44e7bd-b70e-2af7-98a7-0544ee7e339c@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.102.4/25994/Fri Nov 20 14:09:26 2020) X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, NICE_REPLY_A, 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 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, 20 Nov 2020 16:14:21 -0000 On 20/11/2020 16:25, Martin Li=C5=A1ka wrote: >>> Apart from these 2 hooks, I bet you will also need gcov_position and=20 >>> gcov_seek functions, >>> can be seen in my sent patch. >> For what do I need them? >> > > I prefer the way with the 2 extra hooks. > Can you please prepare a patch where the newly added functions=20 > __gcov_info_to_gcda and __gcov_fn_info_to_gcda > will be used in libgcov (with the hooks equal to fopen and fwrite?=20 I am not really sure what I should do. Do you mean that write_one_data()=20 should be rewritten to use __gcov_info_to_gcda() with hooks that use=20 gcov_write_unsigned()? The write_one_data() also has a const struct gcov_summary *prg_p=20 pointer. What should an external user provide for this pointer? For=20 example &gi_ptr->summary? The write_one_data() has this code =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (fn_buffer && fn_buffer->fn_ix =3D=3D = f_ix) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Buffered data = from another program.=C2=A0 */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 buffered =3D 1; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gfi_ptr =3D &fn_b= uffer->info; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 length =3D GCOV_T= AG_FUNCTION_LENGTH; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } which uses a global variable /* buffer for the fn_data from another program.=C2=A0 */ static struct gcov_fn_buffer *fn_buffer; For this handling we would need a new hook to do this: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (buffered) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fn_buffer =3D free_fn_data (g= i_ptr, fn_buffer, GCOV_COUNTERS); I don't know for what we need seek and position hooks. --=20 embedded brains GmbH Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de Phone: +49-89-18 94 741 - 16 Fax: +49-89-18 94 741 - 08 PGP: Public key available on request. embedded brains GmbH Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains= .de/datenschutzerklaerung/