From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 3C7973858D33 for ; Mon, 13 Feb 2023 08:14:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C7973858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x134.google.com with SMTP id y25so17737799lfa.9 for ; Mon, 13 Feb 2023 00:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jsd17yJfStpxcAPAYBE/l9/Lv91hRgBFPQZr8GzNxuQ=; b=cATNFiFXUzYHOF4s8KVPOP3IdhGGElt576S4gv7fs2w2wG84Mdb/J0r7W8QD2GZ3MK Y4xE6/6d/Ab2vnUfPoORHWbh0bsHOCCFeYhkagS7qLskhEQOwGrZdXx63+S4yQdrElI4 72P+QcRE+CJorIEDQR7k8w341lHgLrJLil+tFnM5wvMWEKvYIn4hbLFjaZZcT+t8HtnM ZG5ixGm/rfXFITCg0cuOm4Kp3aUuX3N1NfbkyGRPoqBXPQk+kkrL4sDm9LlWLaE3Q6hW tyhR+4CcI/2kq6FQ6u324102J59tzhF9Is84sK91/xo67uQr37LTj2dTnj4XIyYA0KVi DZKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jsd17yJfStpxcAPAYBE/l9/Lv91hRgBFPQZr8GzNxuQ=; b=kiVk6DfXo6+T71jEduheM5rsBoXJQED3/vrb9NS5KOa65379Q923mj/qWlLtY59Msu Bsn0iMKasCg5fBNqEP6/vPLqDNpJcrWRhRxkCH8v+XBboCgm2PacFtJfrp1UksSemwIh CKImBufmgggrJ3QfVKCRA2SeuOQxzwKyckISzg+hr5dQ+qKrzOQSIyZpO/kMlh+3jm3t OJwqnUHtzPLclYR6G7dI+EuJZUszgIEIwRiA9eC42ILnaZfx+ftHkgr1d4lDdv+rPW5Q fj8j9AJHmCJ7JTMuwJOVE0Rc8mhwSnicLbaLorf5fu0jsQ8ikQYsP98kP591DArMf/qi vAJg== X-Gm-Message-State: AO0yUKX6EXyygkA2Ov7KeXCPszHfro27K0LSKfGqAzHePqfP5bSX9Mmj mF1oSB0G2upUcipBpizk4sRGMnxI3fmb3vwIGoc= X-Google-Smtp-Source: AK7set8+yvz0y0yG+FuCTe2IFr4I9APsBBwJmS6Z6DHRKJs6F/DE54jdPSBqaIIHeVoRiMaQjfdJETmaQhTRlpejwns= X-Received: by 2002:a19:f002:0:b0:4da:ffb1:9870 with SMTP id p2-20020a19f002000000b004daffb19870mr4041902lfc.4.1676276057569; Mon, 13 Feb 2023 00:14:17 -0800 (PST) MIME-Version: 1.0 References: <06594032-1183-8c05-2e03-0c8c37f3106c@starynkevitch.net> In-Reply-To: <06594032-1183-8c05-2e03-0c8c37f3106c@starynkevitch.net> From: Richard Biener Date: Mon, 13 Feb 2023 09:14:04 +0100 Message-ID: Subject: Re: GCC -ftime-trace To: Basile Starynkevitch Cc: khareshivansh03@gmail.com, gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,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: On Sat, Feb 11, 2023 at 8:37 PM Basile Starynkevitch wrote: > > 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? It looks like -ftime-trace can be implemented ontop of the existing time tracking that's reported with -ftime-report and -ftime-report-details, possibly a first step would be to make the raw data more accessible. We've now not alternate output for various auxiliary data for example in JSON format, so implementing -ftime-report=json plus an external visualization tool/script might be a good start for the project. Richard. > 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/ >