I wanted to be able to output to a file other than gmon.out, and this environment variable did the trick. However the manual didn't tell me about it -- I had to go rummaging through the code. I will be following up with a patch.
Created attachment 1652 [details] add note about GMON_OUT_PREFIX to the manual (first iteration) Here's my first try at a patch that fixes this problem.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bbd47c1230b3fbc25e6292ea3f2f5d275d4d459a commit bbd47c1230b3fbc25e6292ea3f2f5d275d4d459a Author: Ben Asselstine <benasselstine@gmail.com> Date: Thu Jun 3 21:25:15 2021 +0930 PR4283, update gprof manual with note about GMON_OUT_PREFIX PR 4283 * gprof.texi (Executing): Note GMON_OUT_PREFIX environment variable.
Slightly modified patch pushed.