Re: Tracking wait event for latches

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Tracking wait event for latches
Дата
Msg-id CAPpHfdtvox-A+xROAuPFqBPOw7Bjkj4+UYEcQEHFogx5bSwsuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Tracking wait event for latches  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Ответы Re: Tracking wait event for latches  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Mon, Aug 22, 2016 at 12:09 PM, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
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?

I'm also not sure about handling of secure_read() and secure_write() functions.
In the current patch we're tracking latch event wait inside them.  But we setup latch only for blocking sockets and can do it multiple times in loop.
Would it be better to make separate wait events NETWORK_READ and NETWORK_WRITE and setup them for the whole time spent in secure_read() and secure_write()?

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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: Tracking wait event for latches
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: [Patch] RBTree iteration interface improvement