From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 8BAAF384FB63 for ; Tue, 21 Feb 2023 16:30:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BAAF384FB63 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-pj1-x1034.google.com with SMTP id qi12-20020a17090b274c00b002341621377cso5376096pjb.2 for ; Tue, 21 Feb 2023 08:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=b6xvHKe2L5NP1UmT4/tUCe/m7sU6l42xrzYA1hI0fW0=; b=Z7i8KOlMcQ13B0CeUUKI7Cb0/MH1pVaNPiqOIVUgAHlieqw8AbSB4HcE/IKcZIgmb1 oXCNhs7Qf4QRCfumfGMGxDaS0rp98VlnRnYYom6V1ok4krLeSgpo3EASt58xiq8iuFgP RtFdnaA7zvjUQGHfvvdBqkwKO86dGh4ribxvqTuD4alavb0X8jFYVggURQH4GE7oVoWY nGssEopZxIZz4SwURVwJtyEJVD+kcry4sIAZNIOg8Desf0z4pn5zko8oLSewOI/3Dv88 qm0yP61KRdA2vHntxiRXYCStjFHZKcqZARCyBMm6iwNPvd9YMhb6fghPeIUQDBoR/fvq nSJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=b6xvHKe2L5NP1UmT4/tUCe/m7sU6l42xrzYA1hI0fW0=; b=FzPffCztpmGRyOnbVYdzP2YUC8dJScjqQOrItXpEiQJv763L08xT+TJWHZv0Oor2EW Qm3Zhy1CiTgD+istYtobjDZN5yhETjmbgkAFooRFoubvwO8ovoF160HoOxNQ1yWRmG8a 8Ry/et5Bc3jZHcUFLG4OWdoK9bvQs4VLYP4ROYZ+r+ysQYGCuy3jwcq4nBDnMJ41puyP 8qVaGCEGO/4wc9fY2q9nqMELoy/LSFUJnD6Q5wWIt1xxS18WqEFCX2G656AjmzWr7y+X aIZkcYR/zuMW1pJv/UW0/fSa8cbpusly7CET4U7mV5ZQl94kF5AvgEemFXD6JpbIW2DW NhRw== X-Gm-Message-State: AO0yUKUpfMyo+jbBT8DjF6Dca3liQwdFL/RyvSuqktuSpKxzf4qs9IMc 4KPAeROD9Gu8iONdWFHG0Vcv591YG6pOuzSNwGzbQSy2D3Y= X-Google-Smtp-Source: AK7set8eWV0psDHxIr/PwcJwuRtKeNi6YeQRCzsZb4QUcuxdL+EZ5wv1YgdoWuLZfHUK7+qA6yTSn9X7q/650PfWsHA= X-Received: by 2002:a17:902:f815:b0:19a:9605:b958 with SMTP id ix21-20020a170902f81500b0019a9605b958mr794049plb.32.1676997027415; Tue, 21 Feb 2023 08:30:27 -0800 (PST) MIME-Version: 1.0 From: Roy Jacobson Date: Tue, 21 Feb 2023 18:30:15 +0200 Message-ID: Subject: A plugin for -ftime-trace like tracing in GCC To: gcc@gcc.gnu.org Content-Type: multipart/alternative; boundary="0000000000001bcc0205f5384cf2" X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,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: --0000000000001bcc0205f5384cf2 Content-Type: text/plain; charset="UTF-8" There were some discussions here about -ftime-trace. I've written a GCC plugin with similar functionality last year: https://github.com/royjacobson/externis. It works at least on GCC11 and GCC12. It was written by practically reverse engineering the GCC AST and can only make use of the GCC plugin callbacks, which are very limited, so the information it provides is sometimes inaccurate and heuristic. But maybe it can help by providing something to iterate on. Cheers, Roy --0000000000001bcc0205f5384cf2--