Add PgStat_KindInfo.init_shmem_cb
authorMichael Paquier <michael@paquier.xyz>
Thu, 11 Jul 2024 00:21:40 +0000 (09:21 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 11 Jul 2024 00:21:40 +0000 (09:21 +0900)
commit21471f18e9d9aa3383314ed8bc9163bc369109ae
treeba62b94e3c4a735dbb3b1924381f73bb024fa0d5
parentcc2236854e2bb4f2120927c390c63cc2aad77762
Add PgStat_KindInfo.init_shmem_cb

This new callback gives fixed-numbered stats the possibility to take
actions based on the area of shared memory allocated for them.

This removes from pgstat_shmem.c any knowledge specific to the types
of fixed-numbered stats, and the initializations happen in their own
files.  Like b68b29bc8fec, this change is useful to make this area of
the code more pluggable, so as custom fixed-numbered stats can take
actions after their shared memory area is initialized.

Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Zot5bxoPYdS7yaoy@paquier.xyz
src/backend/utils/activity/pgstat.c
src/backend/utils/activity/pgstat_archiver.c
src/backend/utils/activity/pgstat_bgwriter.c
src/backend/utils/activity/pgstat_checkpointer.c
src/backend/utils/activity/pgstat_io.c
src/backend/utils/activity/pgstat_shmem.c
src/backend/utils/activity/pgstat_slru.c
src/backend/utils/activity/pgstat_wal.c
src/include/utils/pgstat_internal.h