Re: profiling on win32

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: profiling on win32
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3417DD1E0@Herge.rcsinc.local
обсуждение исходный текст
Ответ на profiling on win32  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
Ответы Re: profiling on win32  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers-win32
Finally got profiling going on windows.  Just a little FYI for other
win32 developers/users who might be interested.  gprof is probably the
easiest way to do it.  gprof is the gnu profiler which is built into
gcc.

Some quick observations:

1. no timings, just function call counts were output until I upgraded to
mingw 4.1 current

2. make sure you use mingw provided gprof, not cygwin etc.  Make sure
gprof version matches gcc version.

3. syntax to get profile graph is
gprof postgres.exe gmon.out
this actually tripped me up for a bit due to confusing error message
from gprof.

4. to compile postgresql for profiling (assumes you already have mingw,
etc. installed).
a. do make clean, make, and make install as normal.
b. edit makefile.global and add -pg to the end of cflags line.
c. do make clean, and make, and make install of just the backend.  you
can do this by running make from backend folder.

5. profile file (gmon.out) is dumped into database folder when
postgresql is run as a service.

That's it! I'm sure the unix people are thinking, 'duh!' but it took me
a bit of effort to get profiling going so I'd thought I'd pass the
information along.

Merlin

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: profiling on win32
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: profiling on win32