fixing #2125: redirecting profiling output to a file

Added a new config parameter to enable redirecting the output of profiling to a file. By default output is posted on stderr.
You have trailing whitespaces here.