- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am analyze my workload which has a very hot function. I wonder if I can use Vtune to report what arguments are passed into this function? For example, if I have a function func() take one character as an input,
argument "a" : 10 times
argument "b" : 100 times
argument "c": 50 times
I try to google the answer but there seems to be no such solution, no matter in Vtune or other tools.The problem is I want to do this without changing the source code.
Thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
VTune doesn't provide such capabilities.
It sounds more like an automated debugging which can be done via GDB scripts. See examples here: http://stackoverflow.com/questions/10748501/what-are-the-best-ways-to-automate-a-gdb-debugging-session
A very simple gdb script file reporting all func invocations with arguments might look as below:
set width 0 set height 0 set verbose off start # runs to main, so shared libraries are loaded break func commands 2 cont end run
Then it can be run via GDB as:
>gdb --batch --command=./script --args <your workload>
Then you can grep -c the output to count number of particular argument values.
Regards, Katya
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
VTune doesn't provide such capabilities.
It sounds more like an automated debugging which can be done via GDB scripts. See examples here: http://stackoverflow.com/questions/10748501/what-are-the-best-ways-to-automate-a-gdb-debugging-session
A very simple gdb script file reporting all func invocations with arguments might look as below:
set width 0 set height 0 set verbose off start # runs to main, so shared libraries are loaded break func commands 2 cont end run
Then it can be run via GDB as:
>gdb --batch --command=./script --args <your workload>
Then you can grep -c the output to count number of particular argument values.
Regards, Katya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Ekaterina!
I am not too familiar with GDB so it took me a while to write and debug my GDB script. It works for me now.
Thanks!
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page