Generate pgstat_count_slru*() functions for slru using macros

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Generate pgstat_count_slru*() functions for slru using macros
Date: 2025-08-29 15:02:23
Message-ID: aLHA//gr4dTpDHHC@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I was looking at pgstat_slru.c (I've in mind to provide some of those metrics
per backend), and realized that the same code pattern is repeated 7 times.

PFA a patch to $SUBJECT, removing a few lines of originally-duplicated
code patterns. In passing, some functions have to be renamed to match their
associated counter.

This is the same idea as 850f4b4, 8018ffb or 83a1a1b.

Looking forward to your feedback,

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Generate-pgstat_count_slru-functions-for-slru-usi.patch text/x-diff 5.6 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-08-29 15:04:13 Re: Unused parameter in ProcessSlotSyncInterrupts()
Previous Message Tom Lane 2025-08-29 14:57:08 Re: [PATCH] Generate random dates/times in a specified range