Re: profiling on win32
"Dave Page" <[email protected]> Thu, 25 Aug 2005 21:42:48 +0100
| Newsgroups | gmane.comp.db.postgresql.devel.win32 |
|---|---|
| Message-ID | <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC9C8F@ratbert.vale-housing.co.uk> |
Thanks for posting this Merlin. Bruce, perhaps this should be added to "Compiling PostgreSQL On Native Win32 FAQ" for reference? Regards, Dave. > -----Original Message----- > From: [email protected]=20 > [mailto:[email protected]] On Behalf=20 > Of Merlin Moncure > Sent: 25 August 2005 21:36 > To: [email protected] > Subject: Re: [pgsql-hackers-win32] profiling on win32 >=20 > 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. >=20 > Some quick observations: >=20 > 1. no timings, just function call counts were output until I=20 > upgraded to > mingw 4.1 current >=20 > 2. make sure you use mingw provided gprof, not cygwin etc. Make sure > gprof version matches gcc version. >=20 > 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. >=20 > 4. to compile postgresql for profiling (assumes you already=20 > 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. >=20 > 5. profile file (gmon.out) is dumped into database folder when > postgresql is run as a service. >=20 > That's it! I'm sure the unix people are thinking, 'duh!' but=20 > it took me > a bit of effort to get profiling going so I'd thought I'd pass the > information along. >=20 > Merlin >=20 > ---------------------------(end of=20 > broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? >=20 > http://www.postgresql.org/docs/faq >=20 ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org