diff --git a/src/backend/utils/probes.d b/src/backend/utils/probes.d index 1929521c6a56a..8b65353ea37fc 100644 --- a/src/backend/utils/probes.d +++ b/src/backend/utils/probes.d @@ -91,4 +91,7 @@ provider postgresql { probe wal__switch(); probe wal__buffer__write__dirty__start(); probe wal__buffer__write__dirty__done(); + + probe wait__event__start(unsigned int); + probe wait__event__end(); }; diff --git a/src/include/utils/wait_event.h b/src/include/utils/wait_event.h index 34c27cc3dc3e1..ca1af4b1c1fb4 100644 --- a/src/include/utils/wait_event.h +++ b/src/include/utils/wait_event.h @@ -12,6 +12,7 @@ /* enums for wait events */ #include "utils/wait_event_types.h" +#include "utils/probes.h" extern const char *pgstat_get_wait_event(uint32 wait_event_info); extern const char *pgstat_get_wait_event_type(uint32 wait_event_info); @@ -73,6 +74,8 @@ pgstat_report_wait_start(uint32 wait_event_info) * four-bytes, updates are atomic. */ *(volatile uint32 *) my_wait_event_info = wait_event_info; + + TRACE_POSTGRESQL_WAIT_EVENT_START(wait_event_info); } /* ---------- @@ -86,6 +89,8 @@ pgstat_report_wait_end(void) { /* see pgstat_report_wait_start() */ *(volatile uint32 *) my_wait_event_info = 0; + + TRACE_POSTGRESQL_WAIT_EVENT_END(); }