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/zot5bxopyds7y...@paquier.xyz Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/21471f18e9d9aa3383314ed8bc9163bc369109ae Modified Files -------------- src/backend/utils/activity/pgstat.c | 6 ++++++ src/backend/utils/activity/pgstat_archiver.c | 8 ++++++++ src/backend/utils/activity/pgstat_bgwriter.c | 8 ++++++++ src/backend/utils/activity/pgstat_checkpointer.c | 8 ++++++++ src/backend/utils/activity/pgstat_io.c | 9 +++++++++ src/backend/utils/activity/pgstat_shmem.c | 21 +++++++++++---------- src/backend/utils/activity/pgstat_slru.c | 8 ++++++++ src/backend/utils/activity/pgstat_wal.c | 8 ++++++++ src/include/utils/pgstat_internal.h | 13 +++++++++++++ 9 files changed, 79 insertions(+), 10 deletions(-)