On 04.02.2009, at 21:03, Rick Altherr wrote:
On Feb 4, 2009, at 11:12 AM, Dieter Oberkofler wrote:
On 04.02.2009, at 19:03, Rick Altherr wrote:
On Feb 4, 2009, at 1:49 AM, Dieter Oberkofler wrote:
Thank you!
On 03.02.2009, at 19:47, Rick Altherr wrote:
On Feb 3, 2009, at 8:43 AM, Dieter Oberkofler wrote:
Still stuck with Saturn:
1) After initializing the application with initSaturn(""), it seems as if the profiling would already have started and within a few seconds around 500MB of data is collected.
If you use -pg, the moninit() method in libSaturn calls initSaturn() and startSaturn(). That means that Saturn will start tracing as soon as the bundle is loaded.
If you use -finstrument-functions, any function not decorated with "__attribute__((__no_instrument_function__))" will call into Saturn to record data. If that happens before a call to initSaturn() is made, initSaturn() and startSaturn() are called for you. If you decorate your bundle's initializer method with that, then it won't accidentally start Saturn automatically.
I'm using -finstrument-functions because this is the only one available on ppc and intel.
Could you please elaborate on how to "decorate your bundle's initializer method"?
I have not not found any documentation on how to do so in general and "__attribute__((__no_instrument_function__))" specifically. Is there any?
Simply put __attribute__((__no_instrument_function__)) between the return type and the function name. This is mentioned in the description of -finstrument-functions in the gcc man page.
...and how would I decorate the "bundle's initializer method"? I cannot find any information about a bundle initializer.
I was assuming you were building a plugin of some sort. I'm simply referring to the first method that will be run in your binary.
1) I have a main in my application but when trying to "decorate" main like:
---
int __attribute__((__no_instrument_function__)) main(int argc, char* argv[])
{
// ...
}
---
I get the following compiler error:
error: can't set '__no_instrument_function__' attribute after definition.
What does work, is to put it in a declaration before the actual implementation.
---
int __attribute__((__no_instrument_function__)) main(int argc, char* argv[]);
int main(int argc, char* argv[])
{
// ...
}
---
Is this how it is supposed to be used?
2) Unfortunately this also does not seem to help with my problems:
2.1) I still get two Saturn directories but only one start/stopSaturn was used
2.2) I still see no functions in the Saturn front end as if there is no debug information
3) I have now been using
3.1) The __attribute__((__no_instrument_function__)) decorator in main
3.2) initSaturn("/Saturn"); once as the first command in main
3.3) in one singlelocation in the application I invoke startSaturn() and endSaturn() to profile this specific section of code
--
Rick Altherr
Architecture and Performance Group
email@hidden