I've been tasked with writing an automated profile utility for our project. It seems that using the script interface is the way to go, as the command line utility limits us to "sample" activities only. (Using a script allows us to re-run the call graph activity, which might have changed for the application.)
Problem I have is that though I've a fair amount of experience at optimization, I'm pretty much an idiot w/scripts (VBScript, PerlScript, whatever-no experience) and I've got a two-day deadline, so it seems writing a simple C++ console app to controlVTune viaCOM is appropriate.
Documentation on how to do this is pretty sparse, however. There's a sample w/VBScript in the documentation. Is there a similar example available for controlling from C++?
Basically, you don't want to go there. Trying to write a script for the COM interfaces with C++ is going to take way too much effort, IMHO. Just copy the VBScript example and start tweaking it.
BTW, if you are using version 7.1, while call graph is not "officially" supported from the command line, it is there! Just type: vtl query -lc (for list collectors) and you will see "call graph". It means you have to use double-quotes around "call graph" on the command line, but it will work.
You could probably generate the header files by importing the DLLs, but you would have to know which DLLs, or import them all! :-(
And, they aren't all designed to be scripted, anyway. Basically, what is shown in the example is all that is really available for use.
In the past, I put together a VB6 app that used one of the common interfaces and found that it had not been designed to be used via VB (unsupported parameter type). :-( So, you kind of have to stick with what is documented.
With VB, at least, you can view the objects via the object browser or the tooltips that are displayed in the editor for objects. This is how I searched for the support I needed. Again, this isn't really encouraged, since you may find a method or property that looks like what you want but either doesn't work the way you expect or doesn't use a supported parameter type.