Re: Tracking wait event for latches

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Tracking wait event for latches
Дата
Msg-id CAB7nPqTeUSj-Sqp9VOXiKbUc58-JbUd+x0j4A1HW_TQsgXYjCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Tracking wait event for latches  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
On Wed, Sep 21, 2016 at 1:03 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> Yeah but that's at run time.  I meant you could help developers
> discover ASAP if they add a new item to one place but not the other
> with a compile time assertion:
>     const char *
>     GetWaitEventIdentifier(uint16 eventId)
>     {
>         StaticAssertStmt(lengthof(WaitEventNames) == WE_LAST_TYPE + 1,
>                          "WaitEventNames must match WaitEventIdentifiers");
>         if (eventId > WE_LAST_TYPE)
>             return "???";
>         return WaitEventNames[eventId];
>     }

Ah, OK, good idea. I had AssertStmt in mind, not StaticAssertStmt.

> You missed a couple that are hiding inside #ifdef WIN32:
>
> From pgstat.c:
> +   EVENT_PGSTAT_MAIN);
>
> From syslogger.c:
> + EVENT_SYSLOGGER_MAIN);

Oops. Fixed those ones and checked the builds on WIN32.
--
Michael

Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Tracking wait event for latches
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [HACKERS] Error running custom plugin: “output plugins have to declare the _PG_output_plugin_init symbol”