Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7395a90

Browse files
committed
Add WAIT_EVENT_{CLASS,ID}_MASK in wait_event.c
These are useful to extract the class ID and the event ID associated toa single uint32 wait_event_info. Only two code paths use them now, butan upcoming patch will extend their use.Discussion:https://postgr.es/m/ZMcJ7F7nkGkIs8zP@paquier.xyz
1 parentf1e9f6b commit7395a90

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/backend/utils/activity/wait_event.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ static const char *pgstat_get_wait_io(WaitEventIO w);
3939
staticuint32local_my_wait_event_info;
4040
uint32*my_wait_event_info=&local_my_wait_event_info;
4141

42+
#defineWAIT_EVENT_CLASS_MASK0xFF000000
43+
#defineWAIT_EVENT_ID_MASK0x0000FFFF
4244

4345
/*
4446
* Configure wait event reporting to report wait events to *wait_event_info.
@@ -82,7 +84,7 @@ pgstat_get_wait_event_type(uint32 wait_event_info)
8284
if (wait_event_info==0)
8385
returnNULL;
8486

85-
classId=wait_event_info&0xFF000000;
87+
classId=wait_event_info&WAIT_EVENT_CLASS_MASK;
8688

8789
switch (classId)
8890
{
@@ -138,8 +140,8 @@ pgstat_get_wait_event(uint32 wait_event_info)
138140
if (wait_event_info==0)
139141
returnNULL;
140142

141-
classId=wait_event_info&0xFF000000;
142-
eventId=wait_event_info&0x0000FFFF;
143+
classId=wait_event_info&WAIT_EVENT_CLASS_MASK;
144+
eventId=wait_event_info&WAIT_EVENT_ID_MASK;
143145

144146
switch (classId)
145147
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp