Analyzers
Support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
4559 Discussions

Passing arguments to the program

yurly_malipurly
Beginner
251 Views
Hello,

I am having problems passing arguments to the program under vtune. Apparently, VTune either skips some arguments or does not take them at all. Here is the program:
#include
int main(int argc, char *argv[])
{
for (int i=0;i printf("%s,",argv);
printf(" ");
return 0;
}

compiled as "gcc -g space.C" into a.out. All this program does is print arguments, for example
>a.out -Fa home
prints
a.out,-Fa,home

Running a.out under vtl (vtl activity ex6 -c callgraph -app ./a.out,-Fa,home -moi ./a.out run) gives
a.out,-Fa

- the last argument is eaten away. There is no spaces before or after commas in -app. It gets only worse from there. This command simply fails:
vtl activity ex6 -c callgraph -app ./a.out,hh,-Fa,home -moi ./a.out run
with "Syntax error. Try vtl -help..." message.

Any suggestions? Does anybody else have this problem?
0 Kudos
5 Replies
Daniel_B_Intel2
Employee
251 Views
Hi,

You are not alone one, who was confused with passing arguments to the vtl :-(

In you case:
vtl activity ex6 -c callgraph -app ./a.out,"hh -Fa home" -moi ./a.out run

should give the expected results.

Please tell me if it does.

-Daniel

yurly_malipurly
Beginner
251 Views
Hello,

This solution works - thank you very much.

The solution suggested by Intel (Supplying args for app to run under this analyzer - http://support.intel.com/support/performancetools/vtune/linux/v1/sb/cs-005866-prd941.htm) is totally bogus.
Can somebody from Intel update this page?
Daniel_B_Intel2
Employee
251 Views
happy you can continue working with "vtl"
looking forward for your new questions.

thank you also for pointing to the bogus page! I sent main to Jeff - the Host of this forum. Hope he will take care of this page.

-Daniel
Daniel_B_Intel2
Employee
251 Views
happy you can continue working with "vtl"
looking forward for your new questions.

thank you also for pointing to the bogus page! I sent main to Jeff - the Host of this forum. Hope he will take care of this page.

-Daniel
Aaron_L_Intel
Employee
251 Views
Yurly,

FYI, the information posted at http://support.intel.com/support/performancetools/vtune/linux/v1/sb/cs-005866-prd941.htm is correct for the documented example, although it is not a general purpose solution. If only one argument need be passed into the application, then the documented approach is sufficient. With more than one argument, however, it is necessary to wrap them in double-quotes.

Aaron Levinson
Reply