Autogenerate some wait events code and documentation
От | Drouvot, Bertrand |
---|---|
Тема | Autogenerate some wait events code and documentation |
Дата | |
Msg-id | 77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com обсуждение исходный текст |
Ответы |
Re: Autogenerate some wait events code and documentation
|
Список | pgsql-hackers |
Hi hackers, In another thread [1], Thomas had the idea to $SUBJECT in a similar way to what is currently done with src/backend/storage/lmgr/lwlocknames.txt. Doing so, like in the attached patch proposal, would help to avoid: - wait event without documentation like observed in [2] - orphaned wait event like observed in [3] The patch relies on a new src/backend/utils/activity/waiteventnames.txt file that contains on row per wait event, with this format: <ENUM NAME> <WAIT EVENT ENUM> <WAIT EVENT NAME> <WAIT EVENT DOC SENTENCE> Then, a new perl script (src/backend/utils/activity/generate-waiteventnames.pl) generates the new: - waiteventnames.c - waiteventnames.h - waiteventnames.sgml files. Remarks: - The new src/backend/utils/activity/waiteventnames.txt file has been created with (a quickly written, non polished and not part of the patch) generate_waiteventnames_txt.sh script attached. Then, the proposal for the 2 wait events missing documentation (non committed yet) done in [2] has been added manually to waiteventnames.txt. - The patch does take care of wait events that currently are linked to enums, means: - PG_WAIT_ACTIVITY - PG_WAIT_CLIENT - PG_WAIT_IPC - PG_WAIT_TIMEOUT - PG_WAIT_IO so that PG_WAIT_LWLOCK, PG_WAIT_LOCK, PG_WAIT_BUFFER_PIN and PG_WAIT_EXTENSION are not autogenerated. This result to having the wait event part of the documentation "monitoring-stats" not ordered as compared to the "Wait EventTypes" Table. This is due to the fact that the new waiteventnames.sgml that contains the documentation for the autogenerated ones listed above is "included" into doc/src/sgml/monitoring.sgml and then breaks the alphabetical ordering with the ones not autogenerated. To fix this I've in mind to also autogenerate enums for PG_WAIT_BUFFER_PIN and PG_WAIT_EXTENSION and split the current documentation "Wait Event Types" Table in 2 tables: one for the autogenerated ones and one (then for PG_WAIT_LWLOCK, PG_WAIT_LOCK) for the non autogenerated "lock" related ones. Looking forward to your feedback, Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com [1]: https://www.postgresql.org/message-id/CA%2BhUKG%2BewEpxm%3DhPNXyupRUB_SKGh-6tO86viaco0g-P_pm_Cw%40mail.gmail.com [2]: https://www.postgresql.org/message-id/CA%2BhUKGJixAHc860Ej9Qzd_z96Z6aoajAgJ18bYfV3Lfn6t9%3D%2BQ%40mail.gmail.com [3]: https://www.postgresql.org/message-id/CA%2BhUKGK6tqm59KuF1z%2Bh5Y8fsWcu5v8%2B84kduSHwRzwjB2aa_A%40mail.gmail.com
Вложения
В списке pgsql-hackers по дате отправления: