Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - The application profiler doesn't show call count information: (8 Items)
   
The application profiler doesn't show call count information  
Hi all,

The application profiler doesn't show call count information in the Execution Time view inside Momentics (see attached 
screenshot).  Here are the steps I've taken, can you please tell me where I've gone wrong, or what I've missed?

I'm compiling using a Makefile using the -g -p switches.  I refresh the IDE so it knows about the new binary files.  I 
right-click on the debug binary and select Profile As-->Profile Configurations.  I create a new profile under C/C++ QNX 

Attach to Remote Process via QCONN (IP).  I'm connecting to my target on port 8000.  Inside the tools menu, I've added 
the Application Profiler and selected Sampling and Call Count Instrumentation.

I've tried setting the QCONN_PROFILER to /dev/profiler as suggested here:
http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.ide.userguide%2Ftopic%
2Fprofiler_profile_already_running_.html

I'm using Momentics IDE version 4.7.0, running QNX version 6.5.0SP1.

Any suggestions or tips would be greatly appreciated.

Thanks,
Andrey
Re: The application profiler doesn't show call count information  
Hi Andrey,

There's a few steps that are missing from your description that make things a little unclear (I also don't see any 
attachments). I will assume that you want to profile an executable from launch and not attaching to an already running 
executable. Let me know if this is an incorrect assumption.

Based on your description, it appears that compiling and linking worked fine.

Here's a verbose step-by-step of how to get things up and running from the IDE:

From the IDE, right click on the debug binary and select "C/C++ QNX Application Dialog..." (not strictly required, but 
it saves a couple steps).

In the Profile Configurations, the executable should be listed under "C/C++ QNX QConn (IP)." Select the "Tools" tab and 
then select the "Add/Delete Tool..." button. Check the checkbox for Application Profiler and press "Okay."

This should give you the Application Profiler tool. Activate the "Sampling and Call Count Instrumentation" radio button.


Hit the "Profile" button and you should be able to switch to the Application Profiling perspective and see your results 
"live."

Take care,

Shawn Unger
Re: The application profiler doesn't show call count information  
One quick edit (pulled the trigger a little fast):

Change:
From the IDE, right click on the debug binary and select "C/C++ QNX Application Dialog..." (not strictly required, but 
it saves a couple steps).

To:
From the IDE, right click on the debug binary and select "C/C++ QNX Application Dialog..." from the "Profile As..." menu
 option.
Re: The application profiler doesn't show call count information  
Hi Shawn,

I want to profile by attaching to the running process. I've created a profiler configuration for Sampling and Call 
Counting, provided path th the shared libraries and source code files.

What happens after I start profiling session is that I do see a live profiling process, with all the function names and 
their location into the source files. After compiling with -gdwarf-2 flag I'm even able to switch to the particular 
source and see CPU time distribution over the code lines (though to me it looks to be improper).

What's missing is the call graph and hit count information. The latter is present but only for the node named <filtered>
 so I would assume it's rather some code from uninstrumented library or a kernel one. Concerning call count I must add 
that among other functions listed in profiling results there ones called _mcount_ and mcount, which I interpret as a 
sign that the code does have instrumentation.

For me it's completely a mistery what's going on behind the IDE. As far as I understand after setting a QCONN_PROFILER 
variable to /de/profiler I should have redirected profiling statistics to the IDE, but how can I check that this is 
really the case and I'm not still dealing with a plain Sampling profiler approach?

Thank you & regards,
Andrey
Re: The application profiler doesn't show call count information  
/de/profiler is of course a /dev/profiler

P.S. My application has multiple threads and runs on a dual core processor (shown as CPU 0 & 1 in kernel traces). 
Probably this could lead to some side effecst? If I'm not wrong I saw a "know issue" with running sampling and call 
count profiling on multiprocessor systems. Though even if it's the case the worst thing I can expect is that I won't see
 profiling info for the code, which was executed on the second CPU core...
Re: The application profiler doesn't show call count information  
I tested different options and it all works from me - running from IDE, 
attaching to a process, or doing postmortem.
Make sure that pass -p option to both compiler and linker.
If it still does not work use postmortem import (set var PRODIR instead, 
then import gmon.out.* file in IDE).
If you still don't see call graph if doing postmortem - it means 
something really went wrong with instrumentation.

On 14-10-21 04:22 PM, Andrey Dobrovolskiy wrote:
> Hi Shawn,
>
> I want to profile by attaching to the running process. I've created a profiler configuration for Sampling and Call 
Counting, provided path th the shared libraries and source code files.
>
> What happens after I start profiling session is that I do see a live profiling process, with all the function names 
and their location into the source files. After compiling with -gdwarf-2 flag I'm even able to switch to the particular 
source and see CPU time distribution over the code lines (though to me it looks to be improper).
>
> What's missing is the call graph and hit count information. The latter is present but only for the node named <
filtered> so I would assume it's rather some code from uninstrumented library or a kernel one. Concerning call count I 
must add that among other functions listed in profiling results there ones called _mcount_ and mcount, which I interpret
 as a sign that the code does have instrumentation.
>
> For me it's completely a mistery what's going on behind the IDE. As far as I understand after setting a QCONN_PROFILER
 variable to /de/profiler I should have redirected profiling statistics to the IDE, but how can I check that this is 
really the case and I'm not still dealing with a plain Sampling profiler approach?
>
> Thank you & regards,
> Andrey
>
>
>
> _______________________________________________
>
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post112090
> To cancel your subscription to this discussion, please e-mail momentics-community-unsubscribe@community.qnx.com

Re: The application profiler doesn't show call count information  
Anyone?
Re: The application profiler doesn't show call count information  
Did you link with -p as well?

IDE Should have a sample project that has makefile with options for call count instrumentation, does this work?

In general samping works only on 1st core, this is unrelated to your problem, but to have correct info, you have to bind
 all your threads
to cpu0