aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-05-15 00:17:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-05-15 00:17:41 +0000
commit93c701edc6c6f065cd25f77f63ab31aff085d6ac (patch)
tree7eaa06d9c2b64ec7f5647bcf3851281180c783e1 /src/backend/utils/misc
parent3bc25384d7a698f25e418bdc5aa7cdd038477d9c (diff)
downloadpostgresql-93c701edc6c6f065cd25f77f63ab31aff085d6ac.tar.gz
postgresql-93c701edc6c6f065cd25f77f63ab31aff085d6ac.zip
Add support for tracking call counts and elapsed runtime for user-defined
functions. Note that because this patch changes FmgrInfo, any external C functions you might be testing with 8.4 will need to be recompiled. Patch by Martin Pihlak, some editorialization by me (principally, removing tracking of getrusage() numbers)
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r--src/backend/utils/misc/guc.c19
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample1
2 files changed, 18 insertions, 2 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index c4b07aad2a4..f4466ddb141 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.453 2008/05/12 08:35:05 mha Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.454 2008/05/15 00:17:40 tgl Exp $
*
*--------------------------------------------------------------------
*/
@@ -169,7 +169,6 @@ static char *config_enum_get_options(struct config_enum *record,
const char *prefix, const char *suffix);
-
/*
* Options for enum values defined in this module.
*/
@@ -241,6 +240,13 @@ static const struct config_enum_entry syslog_facility_options[] = {
};
#endif
+static const struct config_enum_entry track_function_options[] = {
+ {"none", TRACK_FUNC_OFF},
+ {"pl", TRACK_FUNC_PL},
+ {"all", TRACK_FUNC_ALL},
+ {NULL, 0}
+};
+
static const struct config_enum_entry xmlbinary_options[] = {
{"base64", XMLBINARY_BASE64},
{"hex", XMLBINARY_HEX},
@@ -2525,6 +2531,15 @@ static struct config_enum ConfigureNamesEnum[] =
},
{
+ {"track_functions", PGC_SUSET, STATS_COLLECTOR,
+ gettext_noop("Collects function-level statistics on database activity."),
+ gettext_noop("Valid values are: NONE, PL, and ALL.")
+ },
+ &pgstat_track_functions,
+ TRACK_FUNC_OFF, track_function_options, NULL, NULL
+ },
+
+ {
{"wal_sync_method", PGC_SIGHUP, WAL_SETTINGS,
gettext_noop("Selects the method used for forcing WAL updates to disk."),
NULL
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index ce784530832..fdc6f39fc29 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -363,6 +363,7 @@
#track_activities = on
#track_counts = on
+#track_functions = none # none, pl, all
#update_process_title = on