Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - function instrumentation not working for shared objects: Page 1 of 2 (11 Items)
   
function instrumentation not working for shared objects  
Hi,
today I tried to do some profling of a dll using the "new" Appplication Profiler 2 which is using the -finstrument-
functions.
I already did this for executable binaries and it is working fine.
Trying to apply this to a shared object seams to be not working.
I compiled the sources using -finstrument-functions and added -lprofilingS to the link list.
go ahead to the target side set QPROF_FILE and start a test binary which loads this shared object by forcing it to be 
load using LD_PRELOAD
The binary terminates as expected, but there is no *.ptrace file available as it is set in QPROF_FILE

Is this a bug, or is it expected not to work for shared objects.
give me a ping if to x-post to the IDE forum.

thanks
hp
Re: function instrumentation not working for shared objects  
You instrumented only shared library and not binary right?
Right now profiling is started when instrumented "main" function is hit 
(to avoid dead-lock when actual libc.so is instrumented).
To turn off this behavior you can use env variable QPROF_NO_MAIN=1

Hans-Peter Reicher wrote:
> Hi,
> today I tried to do some profling of a dll using the "new" Appplication
Profiler 2 which is using the -finstrument-functions.
> I already did this for executable binaries and it is working fine.
> Trying to apply this to a shared object seams to be not working.
> I compiled the sources using -finstrument-functions and added -lprofilingS
to the link list.
> go ahead to the target side set QPROF_FILE and start a test binary which
loads this shared object by forcing it to be load using LD_PRELOAD
> The binary terminates as expected, but there is no *.ptrace file available
as it is set in QPROF_FILE
>
> Is this a bug, or is it expected not to work for shared objects.
> give me a ping if to x-post to the IDE forum.
>
> thanks
> hp
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post8423
>
>   
AW: function instrumentation not working for shared objects  
I tried the QPROF_NO_MAIN but no change,
so I tried also the QPROF_AUTO_START which I've seen in the strings output
but that also did not change a thing.
Could it be a problem of the LD_PRELOAD usage? 

>-----Ursprüngliche Nachricht-----
>Von: Laskavaia, Elena 
>Gesendet: Montag, 26. Mai 2008 16:31
>An: general-toolchain
>Betreff: Re: function instrumentation not working for shared objects
>
>You instrumented only shared library and not binary right?
>Right now profiling is started when instrumented "main" 
>function is hit (to avoid dead-lock when actual libc.so is 
>instrumented).
>To turn off this behavior you can use env variable QPROF_NO_MAIN=1
>
>Hans-Peter Reicher wrote:
>> Hi,
>> today I tried to do some profling of a dll using the "new" 
>> Appplication
>Profiler 2 which is using the -finstrument-functions.
>> I already did this for executable binaries and it is working fine.
>> Trying to apply this to a shared object seams to be not working.
>> I compiled the sources using -finstrument-functions and added 
>> -lprofilingS
>to the link list.
>> go ahead to the target side set QPROF_FILE and start a test binary 
>> which
>loads this shared object by forcing it to be load using LD_PRELOAD
>> The binary terminates as expected, but there is no *.ptrace file 
>> available
>as it is set in QPROF_FILE
>>
>> Is this a bug, or is it expected not to work for shared objects.
>> give me a ping if to x-post to the IDE forum.
>>
>> thanks
>> hp
>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post8423
>>
>>   
>
>_______________________________________________
>General
>http://community.qnx.com/sf/go/post8432
>
> 
 
*******************************************
Harman Becker Automotive Systems GmbH
Geschaeftsfuehrung:  Dr. Wolfgang Ptacek  -  Michael Mauser  -  Regis Baudot
Sitz der Gesellschaft: Karlsbad - Registergericht: Mannheim HRB 361395
 
*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat 
sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail
. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have 
received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************
Re: AW: function instrumentation not working for shared objects  
auto-start is on by default (but the start point is usually main).
Can you try to instrument binary (where main is) and try again?
If it works problem with  QPROF_NO_MAIN. Can you copy you command line 
here (including setting env vars?)

Hans-Peter Reicher wrote:
> I tried the QPROF_NO_MAIN but no change,
> so I tried also the QPROF_AUTO_START which I've seen in the strings output
> but that also did not change a thing.
> Could it be a problem of the LD_PRELOAD usage? 
>
>   
>> -----Ursprüngliche Nachricht-----
>> Von: Laskavaia, Elena 
>> Gesendet: Montag, 26. Mai 2008 16:31
>> An: general-toolchain
>> Betreff: Re: function instrumentation not working for shared objects
>>
>> You instrumented only shared library and not binary right?
>> Right now profiling is started when instrumented "main" 
>> function is hit (to avoid dead-lock when actual libc.so is 
>> instrumented).
>> To turn off this behavior you can use env variable QPROF_NO_MAIN=1
>>
>> Hans-Peter Reicher wrote:
>>     
>>> Hi,
>>> today I tried to do some profling of a dll using the "new" 
>>> Appplication
>>>       
>> Profiler 2 which is using the -finstrument-functions.
>>     
>>> I already did this for executable binaries and it is working fine.
>>> Trying to apply this to a shared object seams to be not working.
>>> I compiled the sources using -finstrument-functions and added 
>>> -lprofilingS
>>>       
>> to the link list.
>>     
>>> go ahead to the target side set QPROF_FILE and start a test binary 
>>> which
>>>       
>> loads this shared object by forcing it to be load using LD_PRELOAD
>>     
>>> The binary terminates as expected, but there is no *.ptrace file 
>>> available
>>>       
>> as it is set in QPROF_FILE
>>     
>>> Is this a bug, or is it expected not to work for shared objects.
>>> give me a ping if to x-post to the IDE forum.
>>>
>>> thanks
>>> hp
>>>
>>> _______________________________________________
>>> General
>>> http://community.qnx.com/sf/go/post8423
>>>
>>>   
>>>       
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post8432
>>
>>
>>     
>  
> *******************************************
> Harman Becker Automotive Systems GmbH
> Geschaeftsfuehrung:  Dr. Wolfgang Ptacek  -  Michael Mauser  -  Regis
Baudot
> Sitz der Gesellschaft: Karlsbad - Registergericht: Mannheim HRB 361395
>  
> *******************************************
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und
loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
> This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and delete this e-mail. Any
unauthorized copying, disclosure or distribution of the contents in this
e-mail is strictly forbidden.
> *******************************************
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post8448
>   
AW: AW: function instrumentation not working for shared objects  
Hi Elena,
some time has gone since this was on my list of topics, I guess you know quite well the priority problems ...

I come along this issue again after a colleague had also some problems.
It turns out that this is not only a problem of shared libs,
but instead is a problem in general as long as you don't compile your main() using -finstrument-functions
The specified env variable QPROF_NO_MAIN does not have any effect to this.

any suggestions?

TIA
/hp

>-----Ursprüngliche Nachricht-----
>Von: Laskavaia, Elena 
>Gesendet: Dienstag, 27. Mai 2008 15:21
>An: general-toolchain
>Betreff: Re: AW: function instrumentation not working for 
>shared objects
>
>auto-start is on by default (but the start point is usually main).
>Can you try to instrument binary (where main is) and try again?
>If it works problem with  QPROF_NO_MAIN. Can you copy you 
>command line here (including setting env vars?)
>
>Hans-Peter Reicher wrote:
>> I tried the QPROF_NO_MAIN but no change, so I tried also the 
>> QPROF_AUTO_START which I've seen in the strings output but that also 
>> did not change a thing.
>> Could it be a problem of the LD_PRELOAD usage? 
>>
>>   
>>> -----Ursprüngliche Nachricht-----
>>> Von: Laskavaia, Elena
>>> Gesendet: Montag, 26. Mai 2008 16:31
>>> An: general-toolchain
>>> Betreff: Re: function instrumentation not working for shared objects
>>>
>>> You instrumented only shared library and not binary right?
>>> Right now profiling is started when instrumented "main" 
>>> function is hit (to avoid dead-lock when actual libc.so is 
>>> instrumented).
>>> To turn off this behavior you can use env variable QPROF_NO_MAIN=1
>>>
>>> Hans-Peter Reicher wrote:
>>>     
>>>> Hi,
>>>> today I tried to do some profling of a dll using the "new" 
>>>> Appplication
>>>>       
>>> Profiler 2 which is using the -finstrument-functions.
>>>     
>>>> I already did this for executable binaries and it is working fine.
>>>> Trying to apply this to a shared object seams to be not working.
>>>> I compiled the sources using -finstrument-functions and added 
>>>> -lprofilingS
>>>>       
>>> to the link list.
>>>     
>>>> go ahead to the target side set QPROF_FILE and start a test binary 
>>>> which
>>>>       
>>> loads this shared object by forcing it to be load using LD_PRELOAD
>>>     
>>>> The binary terminates as expected, but there is no *.ptrace file 
>>>> available
>>>>       
>>> as it is set in QPROF_FILE
>>>     
>>>> Is this a bug, or is it expected not to work for shared objects.
>>>> give me a ping if to x-post to the IDE forum.
>>>>
>>>> thanks
>>>> hp
>>>>
>>>> _______________________________________________
>>>> General
>>>> http://community.qnx.com/sf/go/post8423
>>>>
>>>>   
>>>>       
>>> _______________________________________________
>>> General
>>> http://community.qnx.com/sf/go/post8432
>>>
>>>
>>>     
>>  
>> *******************************************
>> Harman Becker Automotive Systems GmbH
>> Geschaeftsfuehrung:  Dr. Wolfgang Ptacek  -  Michael Mauser  -  Regis
>Baudot
>> Sitz der Gesellschaft: Karlsbad - Registergericht: Mannheim 
>HRB 361395
>>  
>> *******************************************
>> Diese E-Mail enthaelt vertrauliche...
View Full Message
RE: AW: function instrumentation not working for shared objects  
Profiling library was changed for GA - QPROF_NO_MAIN does not have any impact anymore.
If you instrument any function - in library or not it should generate events.
How are you running it?

QPROF_KERNEL_TRACE=1 ./app #system wide mode, kernel trace logger has to run in parallel
QPROF_FILE=/tmp/trace ./app #single app trace mode

Make sure you using library (static library libprofilingS.a on host) of latest version

-----Original Message-----
From: Hans-Peter Reichert [mailto:community-noreply@qnx.com] 
Sent: February 11, 2009 10:52 AM
To: general-toolchain
Subject: AW: AW: function instrumentation not working for shared objects

Hi Elena,
some time has gone since this was on my list of topics, I guess you know quite well the priority problems ...

I come along this issue again after a colleague had also some problems.
It turns out that this is not only a problem of shared libs, but instead is a problem in general as long as you don't 
compile your main() using -finstrument-functions The specified env variable QPROF_NO_MAIN does not have any effect to 
this.

any suggestions?

TIA
/hp

>-----Ursprüngliche Nachricht-----
>Von: Laskavaia, Elena
>Gesendet: Dienstag, 27. Mai 2008 15:21
>An: general-toolchain
>Betreff: Re: AW: function instrumentation not working for shared 
>objects
>
>auto-start is on by default (but the start point is usually main).
>Can you try to instrument binary (where main is) and try again?
>If it works problem with  QPROF_NO_MAIN. Can you copy you command line 
>here (including setting env vars?)
>
>Hans-Peter Reicher wrote:
>> I tried the QPROF_NO_MAIN but no change, so I tried also the 
>> QPROF_AUTO_START which I've seen in the strings output but that also 
>> did not change a thing.
>> Could it be a problem of the LD_PRELOAD usage? 
>>
>>   
>>> -----Ursprüngliche Nachricht-----
>>> Von: Laskavaia, Elena
>>> Gesendet: Montag, 26. Mai 2008 16:31
>>> An: general-toolchain
>>> Betreff: Re: function instrumentation not working for shared objects
>>>
>>> You instrumented only shared library and not binary right?
>>> Right now profiling is started when instrumented "main" 
>>> function is hit (to avoid dead-lock when actual libc.so is 
>>> instrumented).
>>> To turn off this behavior you can use env variable QPROF_NO_MAIN=1
>>>
>>> Hans-Peter Reicher wrote:
>>>     
>>>> Hi,
>>>> today I tried to do some profling of a dll using the "new" 
>>>> Appplication
>>>>       
>>> Profiler 2 which is using the -finstrument-functions.
>>>     
>>>> I already did this for executable binaries and it is working fine.
>>>> Trying to apply this to a shared object seams to be not working.
>>>> I compiled the sources using -finstrument-functions and added 
>>>> -lprofilingS
>>>>       
>>> to the link list.
>>>     
>>>> go ahead to the target side set QPROF_FILE and start a test binary 
>>>> which
>>>>       
>>> loads this shared object by forcing it to be load using LD_PRELOAD
>>>     
>>>> The binary terminates as expected, but there is no *.ptrace file 
>>>> available
>>>>       
>>> as it is set in QPROF_FILE
>>>     
>>>> Is this a bug, or is it expected not to work for shared objects.
>>>> give me a ping if to x-post to the IDE forum.
>>>>
>>>> thanks
>>>> hp
>>>>
>>>> _______________________________________________
>>>> General
>>>>...
View Full Message
AW: AW: function instrumentation not working for shared objects  
I am just doing
	export QPROF_KERNEL_TRACE=1
	tracelogger -n0 -w -M -S10M &
	./app -options
my app is linked agains libprofilingS.a
checking app with "strings app|grep QPROF" is howing the env var names
I am using the profiling lib from 1_2.zip file

as soon as I add main.c to the list of files processed with -finstr...
everything is fine.
 

>-----Ursprüngliche Nachricht-----
>Von: Elena Laskavaia [mailto:community-noreply@qnx.com] 
>Gesendet: Mittwoch, 11. Februar 2009 17:46
>An: general-toolchain
>Betreff: RE: AW: function instrumentation not working for 
>shared objects
>
>Profiling library was changed for GA - QPROF_NO_MAIN does not 
>have any impact anymore.
>If you instrument any function - in library or not it should 
>generate events.
>How are you running it?
>
>QPROF_KERNEL_TRACE=1 ./app #system wide mode, kernel trace 
>logger has to run in parallel QPROF_FILE=/tmp/trace ./app 
>#single app trace mode
>
>Make sure you using library (static library libprofilingS.a on 
>host) of latest version
>
>-----Original Message-----
>From: Hans-Peter Reichert [mailto:community-noreply@qnx.com]
>Sent: February 11, 2009 10:52 AM
>To: general-toolchain
>Subject: AW: AW: function instrumentation not working for 
>shared objects
>
>Hi Elena,
>some time has gone since this was on my list of topics, I 
>guess you know quite well the priority problems ...
>
>I come along this issue again after a colleague had also some problems.
>It turns out that this is not only a problem of shared libs, 
>but instead is a problem in general as long as you don't 
>compile your main() using -finstrument-functions The specified 
>env variable QPROF_NO_MAIN does not have any effect to this.
>
>any suggestions?
>
>TIA
>/hp
>
>>-----Ursprüngliche Nachricht-----
>>Von: Laskavaia, Elena
>>Gesendet: Dienstag, 27. Mai 2008 15:21
>>An: general-toolchain
>>Betreff: Re: AW: function instrumentation not working for shared 
>>objects
>>
>>auto-start is on by default (but the start point is usually main).
>>Can you try to instrument binary (where main is) and try again?
>>If it works problem with  QPROF_NO_MAIN. Can you copy you 
>command line 
>>here (including setting env vars?)
>>
>>Hans-Peter Reicher wrote:
>>> I tried the QPROF_NO_MAIN but no change, so I tried also the 
>>> QPROF_AUTO_START which I've seen in the strings output but 
>that also 
>>> did not change a thing.
>>> Could it be a problem of the LD_PRELOAD usage? 
>>>
>>>   
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Laskavaia, Elena
>>>> Gesendet: Montag, 26. Mai 2008 16:31
>>>> An: general-toolchain
>>>> Betreff: Re: function instrumentation not working for 
>shared objects
>>>>
>>>> You instrumented only shared library and not binary right?
>>>> Right now profiling is started when instrumented "main" 
>>>> function is hit (to avoid dead-lock when actual libc.so is 
>>>> instrumented).
>>>> To turn off this behavior you can use env variable QPROF_NO_MAIN=1
>>>>
>>>> Hans-Peter Reicher wrote:
>>>>     
>>>>> Hi,
>>>>> today I tried to do some profling of a dll using the "new" 
>>>>> Appplication
>>>>>       
>>>> Profiler 2 which is using the -finstrument-functions.
>>>>     
>>>>> I already did this for executable binaries and it is working fine.
>>>>> Trying to apply this to a shared object seams to be not working.
>>>>> I compiled the...
View Full Message
RE: AW: function instrumentation not working for shared objects  
This is not latest version then... You need it for 6.3.2? I can pull out latest version from 6.4.0 but it won't link on 
6.3.2, I would have to re-build it...
 

-----Original Message-----
From: Hans-Peter Reichert [mailto:community-noreply@qnx.com] 
Sent: February 11, 2009 11:53 AM
To: general-toolchain
Subject: AW: AW: function instrumentation not working for shared objects

I am just doing
	export QPROF_KERNEL_TRACE=1
	tracelogger -n0 -w -M -S10M &
	./app -options
my app is linked agains libprofilingS.a
checking app with "strings app|grep QPROF" is howing the env var names I am using the profiling lib from 1_2.zip file

as soon as I add main.c to the list of files processed with -finstr...
everything is fine.
 

>-----Ursprüngliche Nachricht-----
>Von: Elena Laskavaia [mailto:community-noreply@qnx.com]
>Gesendet: Mittwoch, 11. Februar 2009 17:46
>An: general-toolchain
>Betreff: RE: AW: function instrumentation not working for shared 
>objects
>
>Profiling library was changed for GA - QPROF_NO_MAIN does not have any 
>impact anymore.
>If you instrument any function - in library or not it should generate 
>events.
>How are you running it?
>
>QPROF_KERNEL_TRACE=1 ./app #system wide mode, kernel trace logger has 
>to run in parallel QPROF_FILE=/tmp/trace ./app #single app trace mode
>
>Make sure you using library (static library libprofilingS.a on
>host) of latest version
>
>-----Original Message-----
>From: Hans-Peter Reichert [mailto:community-noreply@qnx.com]
>Sent: February 11, 2009 10:52 AM
>To: general-toolchain
>Subject: AW: AW: function instrumentation not working for shared 
>objects
>
>Hi Elena,
>some time has gone since this was on my list of topics, I guess you 
>know quite well the priority problems ...
>
>I come along this issue again after a colleague had also some problems.
>It turns out that this is not only a problem of shared libs, but 
>instead is a problem in general as long as you don't compile your 
>main() using -finstrument-functions The specified env variable 
>QPROF_NO_MAIN does not have any effect to this.
>
>any suggestions?
>
>TIA
>/hp
>
>>-----Ursprüngliche Nachricht-----
>>Von: Laskavaia, Elena
>>Gesendet: Dienstag, 27. Mai 2008 15:21
>>An: general-toolchain
>>Betreff: Re: AW: function instrumentation not working for shared 
>>objects
>>
>>auto-start is on by default (but the start point is usually main).
>>Can you try to instrument binary (where main is) and try again?
>>If it works problem with  QPROF_NO_MAIN. Can you copy you
>command line
>>here (including setting env vars?)
>>
>>Hans-Peter Reicher wrote:
>>> I tried the QPROF_NO_MAIN but no change, so I tried also the 
>>> QPROF_AUTO_START which I've seen in the strings output but
>that also
>>> did not change a thing.
>>> Could it be a problem of the LD_PRELOAD usage? 
>>>
>>>   
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Laskavaia, Elena
>>>> Gesendet: Montag, 26. Mai 2008 16:31
>>>> An: general-toolchain
>>>> Betreff: Re: function instrumentation not working for
>shared objects
>>>>
>>>> You instrumented only shared library and not binary right?
>>>> Right now profiling is started when instrumented "main" 
>>>> function is hit (to avoid dead-lock when actual libc.so is 
>>>> instrumented).
>>>> To turn off this behavior you can use env variable QPROF_NO_MAIN=1
>>>>
>>>> Hans-Peter Reicher wrote:
>>>>     
>>>>> Hi,
>>>>> today I tried to do some profling of a dll using the "new"...
View Full Message
AW: AW: function instrumentation not working for shared objects  
I would use my own implementation if you coudl supply me the correct parameters for TraceEvent()

I already tried my own lib defining the __cyg_profile functions with this calls:
TraceEvent( _NTO_TRACE_INSERTSCLASSEVENT, _NTO_TRACE_SYSTEM, _NTO_TRACE_SYS_FUNC_EXIT, (unsigned)this_fn, 
(unsigned)call_site );
TraceEvent( _NTO_TRACE_INSERTSCLASSEVENT, _NTO_TRACE_SYSTEM, _NTO_TRACE_SYS_FUNC_ENTER, (unsigned)this_fn, 
(unsigned)call_site );

But sadly IDE is not displaying is in the right way
Event, Time, Owner, CPU, Type, Data
34940, 2s 470ms 847us, prof_pp (540707) Pong Thread (3), 1, Class 13 Event 10, 
34941, 2s 470ms 848us, prof_pp (540707) Pong Thread (3), 1, Class 13 Event 11, 

are the used defines OK?
or do I have to use different values in 6.3.2?

/hp


>-----Ursprüngliche Nachricht-----
>Von: Elena Laskavaia [mailto:community-noreply@qnx.com] 
>Gesendet: Mittwoch, 11. Februar 2009 17:57
>An: general-toolchain
>Betreff: RE: AW: function instrumentation not working for 
>shared objects
>
>This is not latest version then... You need it for 6.3.2? I 
>can pull out latest version from 6.4.0 but it won't link on 
>6.3.2, I would have to re-build it...
> 
>
>-----Original Message-----
>From: Hans-Peter Reichert [mailto:community-noreply@qnx.com]
>Sent: February 11, 2009 11:53 AM
>To: general-toolchain
>Subject: AW: AW: function instrumentation not working for 
>shared objects
>
>I am just doing
>	export QPROF_KERNEL_TRACE=1
>	tracelogger -n0 -w -M -S10M &
>	./app -options
>my app is linked agains libprofilingS.a
>checking app with "strings app|grep QPROF" is howing the env 
>var names I am using the profiling lib from 1_2.zip file
>
>as soon as I add main.c to the list of files processed with -finstr...
>everything is fine.
> 
>
>>-----Ursprüngliche Nachricht-----
>>Von: Elena Laskavaia [mailto:community-noreply@qnx.com]
>>Gesendet: Mittwoch, 11. Februar 2009 17:46
>>An: general-toolchain
>>Betreff: RE: AW: function instrumentation not working for shared 
>>objects
>>
>>Profiling library was changed for GA - QPROF_NO_MAIN does not 
>have any 
>>impact anymore.
>>If you instrument any function - in library or not it should generate 
>>events.
>>How are you running it?
>>
>>QPROF_KERNEL_TRACE=1 ./app #system wide mode, kernel trace logger has 
>>to run in parallel QPROF_FILE=/tmp/trace ./app #single app trace mode
>>
>>Make sure you using library (static library libprofilingS.a on
>>host) of latest version
>>
>>-----Original Message-----
>>From: Hans-Peter Reichert [mailto:community-noreply@qnx.com]
>>Sent: February 11, 2009 10:52 AM
>>To: general-toolchain
>>Subject: AW: AW: function instrumentation not working for shared 
>>objects
>>
>>Hi Elena,
>>some time has gone since this was on my list of topics, I guess you 
>>know quite well the priority problems ...
>>
>>I come along this issue again after a colleague had also some 
>problems.
>>It turns out that this is not only a problem of shared libs, but 
>>instead is a problem in general as long as you don't compile your
>>main() using -finstrument-functions The specified env variable 
>>QPROF_NO_MAIN does not have any effect to this.
>>
>>any suggestions?
>>
>>TIA
>>/hp
>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: Laskavaia, Elena
>>>Gesendet: Dienstag, 27. Mai 2008 15:21
>>>An: general-toolchain
>>>Betreff: Re: AW: function instrumentation not working for shared 
>>>objects
>>>
>>>auto-start is on by default (but the start point is usually main).
>>>Can you try...
View Full Message
Re: AW: AW: function instrumentation not working for shared objects  
It is on the wiki page:
http://community.qnx.com/sf/wiki/do/viewPage/projects.ide/wiki/IDE4.5ApplicationProfilerTrial

Enter event:
#include <sys/trace.h>
...
void * from = __builtin_return_address(0); // this function address
void * callsite = __builtin_return_address(1); // calling function address
TraceEvent( _NTO_TRACE_INSERTSCLASSEVENT, _TRACE_SYSTEM_C >> 10, _NTO_TRACE_SYS_FUNC_ENTER, (unsigned)from, 
(unsigned)callsite);

Exit event:

TraceEvent( _NTO_TRACE_INSERTSCLASSEVENT, _TRACE_SYSTEM_C >> 10, _NTO_TRACE_SYS_FUNC_EXIT, (unsigned)from, 
(unsigned)callsite);



Hans-Peter Reichert wrote:
> I would use my own implementation if you coudl supply me the correct parameters for TraceEvent()
> 
> I already tried my own lib defining the __cyg_profile functions with this calls:
> TraceEvent( _NTO_TRACE_INSERTSCLASSEVENT, _NTO_TRACE_SYSTEM, _NTO_TRACE_SYS_FUNC_EXIT, (unsigned)this_fn, 
(unsigned)call_site );
> TraceEvent( _NTO_TRACE_INSERTSCLASSEVENT, _NTO_TRACE_SYSTEM, _NTO_TRACE_SYS_FUNC_ENTER, (unsigned)this_fn, 
(unsigned)call_site );
> 
> But sadly IDE is not displaying is in the right way
> Event, Time, Owner, CPU, Type, Data
> 34940, 2s 470ms 847us, prof_pp (540707) Pong Thread (3), 1, Class 13 Event 10, 
> 34941, 2s 470ms 848us, prof_pp (540707) Pong Thread (3), 1, Class 13 Event 11, 
> 
> are the used defines OK?
> or do I have to use different values in 6.3.2?
> 
> /hp
> 
> 
>> -----Ursprüngliche Nachricht-----
>> Von: Elena Laskavaia [mailto:community-noreply@qnx.com] 
>> Gesendet: Mittwoch, 11. Februar 2009 17:57
>> An: general-toolchain
>> Betreff: RE: AW: function instrumentation not working for 
>> shared objects
>>
>> This is not latest version then... You need it for 6.3.2? I 
>> can pull out latest version from 6.4.0 but it won't link on 
>> 6.3.2, I would have to re-build it...
>>
>>
>> -----Original Message-----
>> From: Hans-Peter Reichert [mailto:community-noreply@qnx.com]
>> Sent: February 11, 2009 11:53 AM
>> To: general-toolchain
>> Subject: AW: AW: function instrumentation not working for 
>> shared objects
>>
>> I am just doing
>> 	export QPROF_KERNEL_TRACE=1
>> 	tracelogger -n0 -w -M -S10M &
>> 	./app -options
>> my app is linked agains libprofilingS.a
>> checking app with "strings app|grep QPROF" is howing the env 
>> var names I am using the profiling lib from 1_2.zip file
>>
>> as soon as I add main.c to the list of files processed with -finstr...
>> everything is fine.
>>
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Elena Laskavaia [mailto:community-noreply@qnx.com]
>>> Gesendet: Mittwoch, 11. Februar 2009 17:46
>>> An: general-toolchain
>>> Betreff: RE: AW: function instrumentation not working for shared 
>>> objects
>>>
>>> Profiling library was changed for GA - QPROF_NO_MAIN does not 
>> have any 
>>> impact anymore.
>>> If you instrument any function - in library or not it should generate 
>>> events.
>>> How are you running it?
>>>
>>> QPROF_KERNEL_TRACE=1 ./app #system wide mode, kernel trace logger has 
>>> to run in parallel QPROF_FILE=/tmp/trace ./app #single app trace mode
>>>
>>> Make sure you using library (static library libprofilingS.a on
>>> host) of latest version
>>>
>>> -----Original Message-----
>>> From: Hans-Peter Reichert [mailto:community-noreply@qnx.com]
>>> Sent: February 11, 2009 10:52 AM
>>> To: general-toolchain
>>> Subject: AW: AW: function instrumentation not working for shared 
>>>...
View Full Message