views:

596

answers:

1

when using gprof: gprof options [executable-file [profile-data-files...]] [> outfile]

if you have options to pass to the executable like: gprof a.out --varfred=32

then gprof assumes that i am passing an invalid option to gprof instead of the a.out.

Any way to get around this?

+4  A: 

You don't run your executable with gprof, so you only specify it so gprof can load symbols. You run the executable first, on its own just as normal, and it then emits profiling data. This data is loaded, along with the executable, by gprof later.

This is all explained in the gprof manual, of course.

unwind