Gentoo Archives: gentoo-portage-dev

From: Paul de Vrieze <pauldv@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] src_profile() request for comments
Date: Wed, 28 Sep 2005 15:28:51
Message-Id: 200509281727.18243.pauldv@gentoo.org
In Reply to: Re: [gentoo-portage-dev] src_profile() request for comments by Jason Stubbs
1 On Wednesday 28 September 2005 17:10, Jason Stubbs wrote:
2 > On Wednesday 28 September 2005 23:42, Bastian Balthazar Bux wrote:
3 > > with src_profile() responsible to do basically two things:
4 > > - run the builded app with some fake data
5 > > - rebuild the source using the gathered profile info.
6 > >
7 > > The first step within some ebuilds could be done by src_test, the
8 > > second is basically a reduced src_compile.
9 > >
10 > > any thoughts ?
11 >
12 > -fno-guess-branch-probability
13 > Do not guess branch probabilities using a randomized model.
14 >
15 > Sometimes GCC will opt to use a randomized model to guess
16 > branch probabilities, when none are available from either profiling
17 > feed- back (-fprofile-arcs) or __builtin_expect. This means that
18 > differ- ent runs of the compiler on the same program may produce
19 > different object code.
20 >
21 > In a hard real-time system, people don't want different runs
22 > of the compiler to produce code that has different behavior; minimizing
23 > non-determinism is of paramount import. This switch allows users to
24 > reduce non-determinism, possibly at the expense of inferior
25 > optimization.
26 >
27 > The default is -fguess-branch-probability at levels -O, -O2,
28 > -O3, -Os.
29 >
30 > Any "test data" that could be used to automatically profile is
31 > essentially just a randomized model. So it would seem gcc has it
32 > inbuilt already.
33
34 The difference is that the randomized model used by gcc is not based on
35 possible input to the program (as that might be very big), but on
36 possible input to more lowlevel concepts such as functions (or even the
37 condition statement). As such test data, if reasonably representative of
38 actual data for the application, would give a rather accurate profile of
39 the branching probabilities and program paths. The more data the better
40 of course.
41
42 Paul
43
44 --
45 Paul de Vrieze
46 Gentoo Developer
47 Mail: pauldv@g.o
48 Homepage: http://www.devrieze.net

Replies

Subject Author
Re: [gentoo-portage-dev] src_profile() request for comments Jason Stubbs <jstubbs@g.o>