Sampling profiler updated - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Sampling profiler updated
Date
Msg-id 20090714183127.946A.52131E4D@oss.ntt.co.jp
Whole thread Raw
Responses Re: Sampling profiler updated
Re: Sampling profiler updated
Re: Sampling profiler updated
List pgsql-hackers
I updated Sampling profiler patch to be applied to HEAD cleanly.

Basic concept of the patch is same as DTrace probes:
Call pgstat_push_condition(condition) before a operation and call
pgstat_pop_condition() at the end of the operation. Those functions
should be light-weight because they only change a variable on shared
memory without any locks.

Stats collector process checks those shard variables periodically and
sums the status in collector's local memory. We cannot know exact
numbers of each operation, but can expect the sampling numbers reflect
the tendency of times spend in each operation. The sampling result
can be retrived with pg_profiles system view.


Of course the profiler could be implemented on the top of DTrace or
SystemTap, but it is not so easy if we try to avoid any performance
regressions and to provide the information by VIEW-like interface.
Also, this approach is platform-independent.


A new feature compared with previous patch is function
pgstat_register_condition(condition, name).
We can add user-defined conditions in extended modules.

Comments welcome.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachment

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Comments on automatic DML routing and explicit partitioning subcommands
Next
From: Tsutomu Yamada
Date:
Subject: [PATCH] "could not reattach to shared memory" on Windows