[Gllug] Compiling a Kernel

Nix nix at esperi.demon.co.uk
Mon May 27 19:16:56 UTC 2002


On Mon, 27 May 2002, Dave Jones mused:
> On Sun, May 26, 2002 at 11:31:54PM +0100, Nix wrote:
> 
>  > (hacking up a little script to profile GCC with oprofile, test-coverage
>  > analyze it with gcov and profile it with -pg in succession... about 140
>  > hours for a single run, but this is what computer time is for,
>  > surely... ;} )
> 
> Reminds me, gcc 3.1's optimiser now has profile driven feedback, which looks quite fun.
> You compile with --profile-arcs, run the app, and then recompile with -fbranch-probabilities

This has been true since I think 2.6.something.

The addition in 3.1 is that the arc-frequency counts are used for more
than merely a bit of branch prediction help, and there's infrastructure
to use them in more places yet.

Unfortunately statistics collection is quite inconvenient (it dumps the
stats files in the program's cwd-at-exit, and it slows the programs down
a lot, and you need to compile with special options), so I expect it'll
only get used for programs which need every last tiny bit of speed to be
squeezed out. i.e., this is a niche feature. A cool feature, but still a
niche feature.

As such, it's likely to rot, as happened to the old branch-probs code
(the compiler often crashed when compiling with
-fbranch-probabilities)...

(The probabilistic/random part, now, I expect that to get used a lot
more. For every other binary, for starters. So maybe that'll keep the
core branch-probs code from rotting too much.)

> Also, going off on a complete tangent, if you're a C/C++ programmer, and you
> haven't seen valgrind yet, run (don't walk) to the homepage[1] immediately and

I've seen it (about a month back), and it really is quite amazingly cool
and fantastically useful. valgrind and oprofile are my meat and drink
these days ;}

-- 
`Well, if you think about it, Andrew is a strategic part of the Internet.'
                                      --- Kieran on Andrew Gierth


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list