Passing arguments to the program

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?

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

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-0...) is totally bogus.
Can somebody from Intel update this page?

Yurly,

FYI, the information posted at http://support.intel.com/support/performancetools/vtune/linux/v1/sb/cs-0... 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

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

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

Login to leave a comment.