From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by sourceware.org (Postfix) with ESMTPS id 3003A3858CDB for ; Sat, 11 Feb 2023 19:36:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3003A3858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=starynkevitch.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=starynkevitch.net Received: (Authenticated sender: basile@starynkevitch.net) by mail.gandi.net (Postfix) with ESMTPSA id 1D257FF802; Sat, 11 Feb 2023 19:36:53 +0000 (UTC) Message-ID: <06594032-1183-8c05-2e03-0c8c37f3106c@starynkevitch.net> Date: Sat, 11 Feb 2023 20:36:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: khareshivansh03@gmail.com Cc: gcc@gcc.gnu.org From: Basile Starynkevitch Subject: GCC -ftime-trace Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello all, Shivansh Khare wrote: > I have looked into the different starter projects that are offered in the > [Wiki GSoC page](https://gcc.gnu.org/wiki/SummerOfCode) and I was > particularly interested in the `-ftime-trace` project. The following is > what is given as a short description about the problematic: > "Implement something similar to Clang's -ftime-trace feature which > generates performance reports that show where the compiler spends compile > time. For more information, please check the following blog post. Are you aware of the existing -ftime-report option to GCC 12 or later? On Linux (and probably many other POSIX) systems, at least in straight (non-cross) x86-64 GCC compilers, implementing that should be not very difficult. Here are some insights. Read carefully https://man7.org/linux/man-pages/man7/time.7.html First, you could experiment by writing a GCC plugin doing that timing (in some experimental way). https://gcc.gnu.org/onlinedocs/gccint/Plugins.html Maybe consider later providing such a "standard" GCC plugin to do the timing. Modifying the pass manager https://gcc.gnu.org/onlinedocs/gccint/Pass-manager.html#Pass-manager to use clock_gettime system call. See https://man7.org/linux/man-pages/man2/clock_gettime.2.html It is related to plugin gate functions... Regards. BTW, my pet open source project is http://refpersys.org/ (symbolic inference engine, work in progress). -- Basile Starynkevitch (only mine opinions / les opinions sont miennes uniquement) 92340 Bourg-la-Reine, France web page: starynkevitch.net/Basile/