From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 6171D3858C50 for ; Thu, 31 Mar 2022 06:58:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6171D3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 240EF21900; Thu, 31 Mar 2022 06:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648709908; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RIHHKOzOfpFcnIBRhPzErVBaPyTgbIGMrj9gJIfBueo=; b=cukj1Hzrx/9022pTGvzLBlgBBtVDyGFc3mKw6nkHU6DwP9dpkpDLs/ikqPhHgr2EUrBgkp eNo6M24Fd4iEbvEf9g4CKKJnxpTTxE0n7MScuy2ASi/GOZJoDdN0rTjK+waHX/m4U0lKTg tIZOC+hNmAyQSEPJ4aQK5N+mSKsPHXk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648709908; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RIHHKOzOfpFcnIBRhPzErVBaPyTgbIGMrj9gJIfBueo=; b=YtG3cPDvafHp8RPB+n4utUwE61Ru/qlHehSki6Tx4M9G5Vu3Zcw/CeLDWDGJiYTpulKsz2 a75pECOyHjZbezDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 11EFC139C2; Thu, 31 Mar 2022 06:58:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bVVOAxRRRWJnVAAAMHmgww (envelope-from ); Thu, 31 Mar 2022 06:58:28 +0000 Message-ID: <3d4f4f22-6c4c-1a32-a994-d9c2e8417121@suse.cz> Date: Thu, 31 Mar 2022 08:58:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] gcov-tool: Allow merging of empty profile lists Content-Language: en-US To: Sebastian Huber , gcc-patches@gcc.gnu.org References: <20220323093404.13225-1-sebastian.huber@embedded-brains.de> <0b4c9c67-0810-4521-2cca-522dbed52bb8@suse.cz> <76777016-d1d4-6e44-59f6-fbe3ff8249ac@embedded-brains.de> <930c7bec-aea5-9491-94cd-a4e8c86f9bfe@suse.cz> <262bfcbc-dfd7-722f-e06a-b7fb7dbbe977@embedded-brains.de> <9b3bc65d-be92-0a99-d5c3-c96b9fec881c@embedded-brains.de> <4c890c8b-4665-41ab-c584-6f25aac01e04@suse.cz> <12e8e121-2c66-0b15-ea65-4c35cf6a1b5e@embedded-brains.de> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: <12e8e121-2c66-0b15-ea65-4c35cf6a1b5e@embedded-brains.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Thu, 31 Mar 2022 06:58:30 -0000 On 3/30/22 16:48, Sebastian Huber wrote: > > > On 30/03/2022 15:30, Sebastian Huber wrote: >> On 30/03/2022 13:56, Martin Liška wrote: >>>> Example: >>>> >>>> base64 -d log.txt | gcov-tool merge-stream >>>> >>>> The gcov-tool uses a new tag which contains the filename of the associated gcov info file: >>>> >>>> gcov-dump b-xilinx_zynq_a9_qemu/init.gcda >>>> b-xilinx_zynq_a9_qemu/init.gcda:data:magic `gcda':version `B20 ' >>>> b-xilinx_zynq_a9_qemu/init.gcda:stamp 3496756572 >>>> b-xilinx_zynq_a9_qemu/init.gcda:checksum 137326246 >>>> b-xilinx_zynq_a9_qemu/init.gcda:  a5000000:  62:FILENAME `/home/EB/sebastian_h/src/lwip/b-xilinx_zynq_a9_qemu/init.gcda' >>>> b-xilinx_zynq_a9_qemu/init.gcda:  a1000000:   8:OBJECT_SUMMARY runs=0, sum_max=0 >>>> b-xilinx_zynq_a9_qemu/init.gcda:  01000000:  12:FUNCTION ident=1016818396, lineno_checksum=0xd31791e7, cfg_checksum=0x4529789a >>>> b-xilinx_zynq_a9_qemu/init.gcda:    01a10000: 232:COUNTERS arcs 29 counts >>>> >>>> Should I generate this filename tag to all configurations or just in case inhibit_libc is defined? >>> >>> I would emit it unconditionally. Btw. why do you need the tag? >> >> The tag was the easiest way to add the filename to the gcov information. >> >> We need some gcov defined way to get the filename associated with a gcov information, so that the gcov-tool can generate the gcov files from the gcov information itself. In a hosted environment, it is not necessary to include the filename in the gcov information, since the instrumented executable already creates the gcov files. In a freestanding environment, the gcov information is not automatically stored to files since no file system may be available. Here, we can dump the gcov information through __gcov_info_to_gcda(). This dump is basically a concatenation of several gcov files. >> >> An alternative to a tag inside the gcov data would be a header which is dumped before the gcov data and understood by the gcov-tool: >> >> header : int32:filename-magic int32:version string >> >> #define GCOV_FILENAME_MAGIC ((gcov_unsigned_t)0x6763666e) /* "gcfn" */ > > Thanks for asking the question. The alternative with the header is much less intrusive. I will work on this approach now. Agreed. > > Another question, I would like to add an option to gcov-tool to transform the filenames using regular expressions (for example, remove or add a prefix). Can I use the C++ for this? Sure, use it! Thanks, Martin