Profiling C/C++ Local

Hello,

Profiling C/C++ code should be an easy thing right?

I made a simple test program in C/C++ in the standard IDE. Set project
properties to enable profiling, added profiling project view etc. (Just as
it says in the documentation.)
Small problem: I get no items in the Profiler view (only in the Debug view
from which you appearantly can’t do profiling).

I’m running in the C/C++ local configuration (on a single PC).
Is it necesary for profiling to have a QNX remote session?
Can I do this on a single PC??

Thanks a lot!

Joost.

Joost de Folter <joost.defolter@innovamedica.com.mx> wrote:

Hello,

Profiling C/C++ code should be an easy thing right?

I made a simple test program in C/C++ in the standard IDE. Set project
properties to enable profiling, added profiling project view etc. (Just as
it says in the documentation.)
Small problem: I get no items in the Profiler view (only in the Debug view
from which you appearantly can’t do profiling).

I’m running in the C/C++ local configuration (on a single PC).
Is it necesary for profiling to have a QNX remote session?
Can I do this on a single PC??

2 choices.

  1. Post-mortem profiling: compile with profiling enabled, run the program,
    call exit() to exit() and the data will be dumped to a gmon.out file (or,
    you can set PROFDIR and the file will be in progname.pid). Copy this into
    your project, rename (if neccessary) to something.gmon.out, and right click
    on this (C/C++ projects view) → Open with QNX Profiler.

  2. Use a QNX Qconn (IP) launch not a C/C++ local launch. You will need
    a TCP/IP stack (which you probably have) and qconn running on your local
    machine. You’ll need to create a target project (if you haven’t already
    for using system information, etc) for the launch, and launch with
    profiling. qconn collects the profiling information and ships it back
    to the IDE. Yes, the qconn can be on the same machine as the IDE. BUT,
    if you want to do this, you may want to make sure the program your
    profiling (should it use close to 100% of the CPU) is running at a
    lower priority than the IDE.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Hi,

I tried the post-mortem gmon.out file procedure, and it worked!

I would like to do the real time profiling as well, but am having trouble
setting up the local target. It doesn’t connect (it keeps having an X in
it). Any sugestions on this?

Thanks a lot!

Joost.


“David Gibbs” <dagibbs@qnx.com> escribió en el mensaje
news:cvl3fv$18p$1@inn.qnx.com

Joost de Folter <> joost.defolter@innovamedica.com.mx> > wrote:
Hello,

Profiling C/C++ code should be an easy thing right?

I made a simple test program in C/C++ in the standard IDE. Set project
properties to enable profiling, added profiling project view etc. (Just
as
it says in the documentation.)
Small problem: I get no items in the Profiler view (only in the Debug
view
from which you appearantly can’t do profiling).

I’m running in the C/C++ local configuration (on a single PC).
Is it necesary for profiling to have a QNX remote session?
Can I do this on a single PC??

2 choices.

  1. Post-mortem profiling: compile with profiling enabled, run the program,
    call exit() to exit() and the data will be dumped to a gmon.out file (or,
    you can set PROFDIR and the file will be in progname.pid). Copy this into
    your project, rename (if neccessary) to something.gmon.out, and right
    click
    on this (C/C++ projects view) → Open with QNX Profiler.

  2. Use a QNX Qconn (IP) launch not a C/C++ local launch. You will need
    a TCP/IP stack (which you probably have) and qconn running on your local
    machine. You’ll need to create a target project (if you haven’t already
    for using system information, etc) for the launch, and launch with
    profiling. qconn collects the profiling information and ships it back
    to the IDE. Yes, the qconn can be on the same machine as the IDE. BUT,
    if you want to do this, you may want to make sure the program your
    profiling (should it use close to 100% of the CPU) is running at a
    lower priority than the IDE.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Joost de Folter <joost.defolter@innovamedica.com.mx> wrote:

Hi,

I tried the post-mortem gmon.out file procedure, and it worked!

I would like to do the real time profiling as well, but am having trouble
setting up the local target. It doesn’t connect (it keeps having an X in
it). Any sugestions on this?

Is qconn actually running? You need qconn running.

(Try a pidin at the command line and look for it.)

Did you fill in the IP address properly?

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Hi,

Indeed, after running qconn manually the local target works.

Thanks a lot!

Joost.

“David Gibbs” <dagibbs@qnx.com> escribió en el mensaje
news:cvnomh$2qb$1@inn.qnx.com

Joost de Folter <> joost.defolter@innovamedica.com.mx> > wrote:
Hi,

I tried the post-mortem gmon.out file procedure, and it worked!

I would like to do the real time profiling as well, but am having trouble
setting up the local target. It doesn’t connect (it keeps having an X in
it). Any sugestions on this?

Is qconn actually running? You need qconn running.

(Try a pidin at the command line and look for it.)

Did you fill in the IP address properly?

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Joost de Folter wrote:

Indeed, after running qconn manually the local target works.

If you’re forgetful (like me), add this to /etc/rc.d/rc.local so qconn
starts automatically when the machine boots:

/usr/sbin/qconn


Chris Herborth (cherborth@qnx.com)
Never send a monster to do the work of an evil scientist.