Add PgStat_KindInfo.init_shmem_cb

Michael Paquier <michael@paquier.xyz>

Commit: 21471f18e9d9aa3383314ed8bc9163bc369109ae
Author: Michael Paquier <michael@paquier.xyz>
Date: 2024-07-11T00:21:40Z
Releases: 18.0
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

Files

Discussion