Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
16 Views

Passing arguments to the program

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
Highlighted
16 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

0 Kudos
Highlighted
16 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?
0 Kudos
Highlighted
16 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
0 Kudos
Highlighted
16 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
0 Kudos
Highlighted
Employee
16 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
0 Kudos