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.
*******************************************