Jump to content
merijnb

how to filter on source files using VTune?

Recommended Posts

Inspired by @Stefan Glienke's talk on the Delphi Summit in Amsterdam I've tried using the v-tune profiler.

 

We had a performance issue and solved it, and I tried using that case to 'reverse test' using v-tune. In other words, I already know what the issue was, how could I have found this using v-tune?

 

The issue I'm running into is that there is too much noise to see what I'm looking for, I understand that (for example) EurekaGetMem (from Eurekalog) is called many times, but that's -at this point- not interesting to me.

I'd like to filter on certain source files, like tell me what took the most times if you only look at the code I've written, nothing from Delphi, Eurekalog, FastMM, etc. Is this possible?

Share this post


Link to post

Assuming you're using map2pdb to generate the PDB-file for VTune, you can specify on the map2pdb command line which units to include and which to exclude. For example, I often use these filters (excludes DevExpress, the VCL, Indy, etc.):

-include:0001 -exclude:dx*;cx*;winapi.*;vcl.*;data.*;firedac.*;soap.*;web.*;datasnap.*;id*;vcltee.*

 

However, that will not prevent VTune from profiling that code. It just can't resolve the addresses in those units.

 

As far as I know, the only way to filter data in VTune is to either use the filter fields at the bottom of the Window or to select the lines you'd like to exclude/include, right click and then select Filter In by Selection/Filter Out by Selection from the context menu.

https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2024-2/context-menu-grid.html

Share this post


Link to post

Changing anything with the map file will only remove the names, the functions being called will still be in the sampling result because VTune is a sampling profiler.

Given that obviously, your performance problem was not with these functions they should not be a significant part of the result percentage-wise - if they are, they are part of the issue.

Share this post


Link to post

Well even if they are part of the problem, it might be to deep in the call stack to make sense. If most of the time goes to allocating memory, I'd like to know which parts of my code is allocating memory. I can look at all the calls tot GetMem and check their callstacks, but I'd rather just filter out system.pas overall.

 

V-Tune does know which unit the call came from, so I'm surprised that it doesn't seem possible to filter in that way?

Share this post


Link to post

Well, if you are looking at the bottom-up view then you will get the result ordered by the call tree leaf nodes. As I understand it, you want to trim the tree to remove the low level entries.

 

I think the closest thing to what you're after is to simply use the top-down view instead and drill down to the desired detail level.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×