Re: Tracking wait event for latches - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Tracking wait event for latches
Date
Msg-id CAPpHfdsUKLZ5t33p93R2MJwOWuPcZSRiqFAAUfgHa+LXGq7OBg@mail.gmail.com
Whole thread Raw
In response to Re: Tracking wait event for latches  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Tracking wait event for latches  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: Tracking wait event for latches  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi, Michael!

On Thu, Aug 4, 2016 at 8:26 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Tue, Aug 2, 2016 at 10:31 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> Attached is an updated patch.

Updated version for 2 minor issues:
1) s/stram/stream/
2) Docs used incorrect number

I took a look at your patch. Couple of notes from me.

const char *
GetEventIdentifier(uint16 eventId)
{
const char *res;
switch (eventId)
{
case EVENT_ARCHIVER_MAIN:
res = "ArchiverMain";
break;
... long long list of events ...
case EVENT_WAL_SENDER_WRITE_DATA:
res = "WalSenderWriteData";
break;
default:
res = "???";
}
return res;
}

Would it be better to use an array here?

typedef enum EventIdentifier
{

EventIdentifier seems too general name for me, isn't it?  Could we name it WaitEventIdentifier? Or WaitEventId for shortcut?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Showing parallel status in \df+
Next
From: Alexander Korotkov
Date:
Subject: Re: Tracking wait event for latches