Thread: Using OProfile

Using OProfile

From
Reydan Cankur
Date:
Hi,

I tried to profile postgresql queries with OProfile but I could not do. 
OProfile version: 0.9.5
PostgreSQL version: 8.4.0
OS: CentOS 5

I compiled OProfile with "./configure --with-kernel-support", "make" and "make install"; also I created a user and a group both named as "oprofile". User oprofile's default group is oprofile.

PostgreSQL was installed, and there is a db named "test". I ran below commands with "reydan" user;

sudo opcontrol --init
sudo opcontrol --setup --no-vmlinux
mkdir opdeneme (for profile files)
sudo opcontrol --session-dir=/path/to/opdeneme
sudo opcontrol --start
sudo opcontrol --reset
psql -f deneme.sql test
sudo opcontrol --dump
sudo opcontrol --shutdown
opreport --long-filenames | more (after this command I get below error)
error: no sample files found: profile specification too strict ?
And I could not profile with oprofile, what is my fault, please advice..

content of deneme.sql:
"create table deneme1 as
select  sid,
             md5((sid*10)::text),
             ((substring(random()::text from 3 for 5))::int+10000) as a
from generate_series(1,1000000) sid;"

Regards,
--Reydan

Re: Using OProfile

From
Tom Lane
Date:
Reydan Cankur <reydan.cankur@gmail.com> writes:
> I tried to profile postgresql queries with OProfile but I could not do.

You would be better off asking this of the oprofile people, as I suspect
your problem is "oprofile doesn't work at all" not "oprofile doesn't
work with postgres".

FWIW, oprofile requires kernel support which I think is not there in
RHEL5/CentOS 5.  If it is there, then there would also be an oprofile
package available; there should be no need for you to build your own.

            regards, tom lane