forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfa88928
committed
Generate automatically code and documentation related to wait events
The documentation and the code is generated automatically from a newfile called wait_event_names.txt, formatted in sections dedicated toeach wait event class (Timeout, Lock, IO, etc.) with three tab-separatedfields:- C symbol in enums- Format in the system views- Description in the docsUsing this approach has several advantages, as we have proved to berather bad in maintaining this area of the tree across the years:- The order of each item in the documentation and the code, which shouldbe alphabetical, has become incorrect multiple times, and the scriptgenerating the code and documentation has a few rules to enforce that,making the maintenance a no-brainer.- Some wait events were added to the code, but not documented, so thiscannot be missed now.- The order of the tables for each wait event class is enforced in thedocumentation (the input .txt file does so as well for clarity, thoughthis is not mandatory).- Less code, shaving 1.2k lines from the tree, with 1/3 of the savingscoming from the code, the rest from the documentation.The wait event types "Lock" and "LWLock" still have their own code pathfor their code, hence only the documentation is created for them. Theseclasses are listed with a special marker called WAIT_EVENT_DOCONLY inthe input file.Adding a new wait event now requires only an update ofwait_event_names.txt, with "Lock" and "LWLock" treated as exceptions.This commit has been tested with configure/Makefile, the CI and VPATHbuild. clean, distclean and maintainer-clean were working fine.Author: Bertrand Drouvot, Michael PaquierDiscussion:https://postgr.es/m/77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com1 parent48efb23 commitfa88928
File tree
22 files changed
+757
-2111
lines changed- doc/src/sgml
- src
- backend
- storage/lmgr
- utils
- activity
- adt
- common
- include
- utils
- test/ssl/t
- tools/msvc
22 files changed
+757
-2111
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
| 61 | + | |
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
| 114 | + | |
| 115 | + | |
114 | 116 |
| |
115 | 117 |
| |
116 | 118 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
| 45 | + | |
45 | 46 |
| |
46 | 47 |
| |
47 | 48 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
49 | 61 |
| |
50 | 62 |
| |
51 | 63 |
| |
|
0 commit comments
Comments
(0)