Gentoo Archives: gentoo-portage-dev

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

Replies

Subject Author
Re: [gentoo-portage-dev] src_profile() request for comments Bastian Balthazar Bux <BastianBalthazarBux@×××××××××.it>