Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/backend/utils/probes.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
5 changes: 5 additions & 0 deletions src/include/utils/wait_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

/* ----------
Expand All @@ -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();
}


Expand Down