public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC -ftime-trace
@ 2023-02-11 19:36 Basile Starynkevitch
  2023-02-13  8:14 ` Richard Biener
  2023-02-13 16:44 ` NightStrike
  0 siblings, 2 replies; 3+ messages in thread
From: Basile Starynkevitch @ 2023-02-11 19:36 UTC (permalink / raw)
  To: khareshivansh03; +Cc: gcc

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                  <basile@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GCC -ftime-trace
  2023-02-11 19:36 GCC -ftime-trace Basile Starynkevitch
@ 2023-02-13  8:14 ` Richard Biener
  2023-02-13 16:44 ` NightStrike
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2023-02-13  8:14 UTC (permalink / raw)
  To: Basile Starynkevitch; +Cc: khareshivansh03, gcc

On Sat, Feb 11, 2023 at 8:37 PM Basile Starynkevitch
<basile@starynkevitch.net> 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                  <basile@starynkevitch.net>
> (only mine opinions / les opinions sont miennes uniquement)
> 92340 Bourg-la-Reine, France
> web page: starynkevitch.net/Basile/
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GCC -ftime-trace
  2023-02-11 19:36 GCC -ftime-trace Basile Starynkevitch
  2023-02-13  8:14 ` Richard Biener
@ 2023-02-13 16:44 ` NightStrike
  1 sibling, 0 replies; 3+ messages in thread
From: NightStrike @ 2023-02-13 16:44 UTC (permalink / raw)
  To: Basile Starynkevitch; +Cc: khareshivansh03, gcc

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

On Sat, Feb 11, 2023, 14:37 Basile Starynkevitch <basile@starynkevitch.net>
wrote:

> 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


Since we can now use c++11, std::chrono::high_resolution_clock::now() would
call that without being platform specific.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-13 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-11 19:36 GCC -ftime-trace Basile Starynkevitch
2023-02-13  8:14 ` Richard Biener
2023-02-13 16:44 ` NightStrike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).