Re: Where does the time go?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Where does the time go?
Дата
Msg-id 12156.1143143736@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Where does the time go?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> I've never used gprof before, and from a quick scan of the info, it
> appears that I need to compile and link a special version of the
> software to generate the file that gprof needs.  Is this correct?  Does
> it work on a Windows build, or will I need to use Linux?  Any tips?

I dunno anything about profiling on Windows.  If you don't mind moving
the test case to Linux it's pretty easy:
./configure --enable-debug --whatever-other-optionsmake PROFILE="-pg -DLINUX_PROFILE"install postgres executable

(On non-Linux Unixen you can omit that -D flag, but otherwise the recipe
is the same.)

Run the test case (you'll want a test script that does the same thing over
and over, enough times to build up a decent set of statistics; I like to
have about a minute's worth of accumulated CPU time in a profile run).
Exit the session --- the gmon.out file will only be dumped at backend
process exit.  Then do
gprof /path/to/postgres-executable $PGDATA/gmon.out >outfile

BTW, in 8.1 you want to be sure to do this with autovacuum off, else
exit of the autovacuum process might clobber the gmon.out file before
you can run gprof.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Static build of psql with readline support
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Static build of psql with readline support