Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Profiling: (8 Items)
   
Profiling  
I'm playing around with profiling.  I got 6.4.0 IDE under windows configure for 6.3.2. I create a new C++ project that I
 configured to use gcc 3.3.5 and I specify as a build options "Build for Profiling (Call Count Instrumentation)".

I manually start the executable but can't find the gmon.out file anywhere. That the first problem ( could be something I
 missed configure ). The second problem is if I select "Build for Profiling (Functions Instrumentation)" I get a problem
 at link time "cannot find -lprofilingS". My guess is this option should not be present if the compiler is 3.3.5 as it's
 not supported.

Re: Profiling  

Mario Charest wrote:
> I'm playing around with profiling.  I got 6.4.0 IDE under windows configure for 6.3.2. I create a new C++ project that
 I configured to use gcc 3.3.5 and I specify as a build options "Build for Profiling (Call Count Instrumentation)".
> 
> I manually start the executable but can't find the gmon.out file anywhere. That the first problem ( could be something
 I missed configure ). 
If you start it from command line you need to specify some env variables to enable it, it should be in doc.
http://www.qnx.com/developers/docs/6.3.2/ide_en/user_guide/profiler.html#profile_postmortem



> The second problem is if I select "Build for Profiling (Functions Instrumentation)" I get a problem at link time "
cannot find -lprofilingS". My guess is this option should not be present if the compiler is 3.3.5 as it's not supported.

It is not about compiler. You need profiler patch for 6.3.2, which you need to install on host (see 4.5 instructions 
page on wiki). It does work with 6.3.2.
http://community.qnx.com/sf/wiki/do/viewPage/projects.ide/wiki/Builds_Tau_Integration (Before you install IDE section)




> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post20425
> 
RE: Profiling  
> Mario Charest wrote:
> > I'm playing around with profiling.  I got 6.4.0 IDE under windows
> configure for 6.3.2. I create a new C++ project that I configured to
> use gcc 3.3.5 and I specify as a build options "Build for Profiling
> (Call Count Instrumentation)".
> 
> > I manually start the executable but can't find the gmon.out file
> anywhere. That the first problem ( could be something I missed
> configure ).

> If you start it from command line you need to specify some env
> variables to enable it, it should be in doc.
> http://www.qnx.com/developers/docs/6.3.2/ide_en/user_guide/profiler.htm
> l#profile_postmortem
> 

Found my problem, need to run as root, running with +s flag is not enough.

> 
> 
> > The second problem is if I select "Build for Profiling (Functions
> Instrumentation)" I get a problem at link time "cannot find -
> lprofilingS". My guess is this option should not be present if the
> compiler is 3.3.5 as it's not supported.
> It is not about compiler. You need profiler patch for 6.3.2, which you
> need to install on host (see 4.5 instructions page on wiki). It does
> work with 6.3.2.
> http://community.qnx.com/sf/wiki/do/viewPage/projects.ide/wiki/Builds_T
> au_Integration (Before you install IDE section)
> 


Ok thanks.

> 
> 
> 
> >
> >
> >
> > _______________________________________________
> > General
> > http://community.qnx.com/sf/go/post20425
> >
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post20429
> 
Re: RE: Profiling  
> 
> Found my problem, need to run as root, running with +s flag is not enough.

The problem is was QCONN_PROFILER must not be set for gmon.out to be created
Re: Profiling  
yes this one would redirect it to IDE. You need to set PROFDIR instead.

Mario Charest wrote:
>> Found my problem, need to run as root, running with +s flag is not enough.
> 
> The problem is was QCONN_PROFILER must not be set for gmon.out to be created
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post20437
> 
Re: Profiling  
I'm a QNX newbie, and after wrestling for a huge amount of time attempting to build all our dependencies with the IDE, I
 had a lot more luck directly building under native neutrino with command-line GNU "./configure; make..." etc.

However, now I need to profile my code, and I guess the only way is to insert my own traceevent()s throughout.
(traceparser?? traceprinter??)

Is there a simple example that takes things all the way from the user code, through traceparse(), etc for user-level 
code?  At some point soon it will have to marry up to a BSP, and presumably new devices and drivers, at which point 
(hopefully!) I can get my user-level trace events with the new kernel stuff...

thanks in advance!
Chris
AW: Profiling  
If you want to do full application profiling, just take a look at "Application Profiler" which is *not* gprof
take a look at function instrumentation
http://community.qnx.com/sf/wiki/do/viewPage/projects.ide/wiki/IDE4.5ApplicationProfilerTrial

to use TraceEvent() and traceparser() just go to "System Analysis Toolkit"
http://www.qnx.com/developers/docs/6.4.0/instr_en/instr/functions.html

to use your own TraceEvent() in your code just use one of the three basic ones
   TraceEvent(_NTO_TRACE_INSERTSUSEREVENT,  1, int_1, int_2);
   TraceEvent(_NTO_TRACE_INSERTUSRSTREVENT, 2, "your message");		
   TraceEvent(_NTO_TRACE_INSERTCUSEREVENT,  3, intArray, numInts);

I'm assuming that you work on traceparser source ...
you will have to register your event callback handler either for a range
or for single events, in this example it is done for a range using the given macros

   TP_CSR(traceparser_cs_range(tp_state, NULL, usr_ev, _NTO_TRACE_USER, _NTO_TRACE_USERFIRST, _NTO_TRACE_USERLAST));

your callback function has to look like this:
static int usr_ev(tp_state_t tp_state, void* d, unsigned h, unsigned t, unsigned* p, unsigned l) {
   // switch over your handled user evnet ids
   switch (_NTO_TRACE_GETEVENT(h)) {
      case 33 : // your event ids here
         (void) fprintf
         (
         g_out_stream,
         "t:0x%08x CPU:%02d USREVENT:EVENT:%d TYPE:MALLOC IP:0x%08x SIZE:%08d PTR:0x%08x\n",
         t,
         _NTO_TRACE_GETCPU(h),
         _NTO_TRACE_GETEVENT(h),
         CS32(p[0]),
         CS32(p[1]),
         CS32(p[2])
         );
         return (0);
....

HTH
/hp



>-----Ursprüngliche Nachricht-----
>Von: Chris Nicholas [mailto:community-noreply@qnx.com] 
>Gesendet: Samstag, 7. Februar 2009 00:31
>An: general-ide
>Betreff: Re: Profiling
>
>I'm a QNX newbie, and after wrestling for a huge amount of 
>time attempting to build all our dependencies with the IDE, I 
>had a lot more luck directly building under native neutrino 
>with command-line GNU "./configure; make..." etc.
>
>However, now I need to profile my code, and I guess the only 
>way is to insert my own traceevent()s 
>throughout.(traceparser?? traceprinter??)
>
>Is there a simple example that takes things all the way from 
>the user code, through traceparse(), etc for user-level code?  
>At some point soon it will have to marry up to a BSP, and 
>presumably new devices and drivers, at which point 
>(hopefully!) I can get my user-level trace events with the new 
>kernel stuff...
>
>thanks in advance!
>Chris
>
>_______________________________________________
>General
>http://community.qnx.com/sf/go/post21690
>
> 
 
*******************************************
Harman Becker Automotive Systems GmbH
Management Board: Dr. Klaus Blickle (Chairman), Dr. Udo Hüls, Michael Mauser
Chairman of the Supervisory Board: Ansgar Rempp | Domicile: Karlsbad | 
Local Court Mannheim: Register No. 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: Profiling  
Hans-Peter Reichert wrote:
> If you want to do full application profiling, just take a look at "Application Profiler" which is *not* gprof
> take a look at function instrumentation
> http://community.qnx.com/sf/wiki/do/viewPage/projects.ide/wiki/IDE4.5ApplicationProfilerTrial
>
> to use TraceEvent() and traceparser() just go to "System Analysis Toolkit"
> http://www.qnx.com/developers/docs/6.4.0/instr_en/instr/functions.html
>
> to use your own TraceEvent() in your code just use one of the three basic ones
>    TraceEvent(_NTO_TRACE_INSERTSUSEREVENT,  1, int_1, int_2);
>    TraceEvent(_NTO_TRACE_INSERTUSRSTREVENT, 2, "your message");		
>    TraceEvent(_NTO_TRACE_INSERTCUSEREVENT,  3, intArray, numInts)
>   
Actually .. even easier is to start using the trace_* functions put in 
in 6.4.0 that make this insertion a little bit more
straightforward:
  
http://sendreceivereply.wordpress.com/2009/02/07/making-tracing-even-easier/

Thomas