Skip to content

Commit 753940f

Browse files
author
Sergey Shinderuk
committed
Clean includes with include-what-you-use
1 parent e3b1e15 commit 753940f

File tree

4 files changed

+31
-33
lines changed

4 files changed

+31
-33
lines changed

collector.c

+12-11
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
*/
1010
#include "postgres.h"
1111

12-
#include "catalog/pg_type.h"
13-
#if PG_VERSION_NUM >= 130000
12+
#include <signal.h>
13+
1414
#include "common/hashfn.h"
15-
#endif
16-
#include "funcapi.h"
15+
#include "compat.h"
1716
#include "miscadmin.h"
17+
#include "pg_wait_sampling.h"
18+
#include "pgstat.h"
1819
#include "postmaster/bgworker.h"
1920
#include "postmaster/interrupt.h"
2021
#include "storage/ipc.h"
21-
#include "storage/procarray.h"
22+
#include "storage/latch.h"
23+
#include "storage/lock.h"
24+
#include "storage/lwlock.h"
25+
#include "storage/proc.h"
2226
#include "storage/procsignal.h"
2327
#include "storage/shm_mq.h"
24-
#include "storage/shm_toc.h"
25-
#include "storage/spin.h"
28+
#include "utils/guc.h"
29+
#include "utils/hsearch.h"
2630
#include "utils/memutils.h"
2731
#include "utils/resowner.h"
28-
#include "pgstat.h"
29-
30-
#include "compat.h"
31-
#include "pg_wait_sampling.h"
32+
#include "utils/timestamp.h"
3233

3334
static volatile sig_atomic_t shutdown_requested = false;
3435

compat.h

-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010
#ifndef __COMPAT_H__
1111
#define __COMPAT_H__
1212

13-
#include "postgres.h"
14-
15-
#include "access/tupdesc.h"
1613
#include "miscadmin.h"
1714
#include "storage/shm_mq.h"
18-
#include "utils/guc_tables.h"
1915

2016
static inline shm_mq_result
2117
shm_mq_send_compat(shm_mq_handle *mqh, Size nbytes, const void *data,

pg_wait_sampling.c

+16-14
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,34 @@
99
*/
1010
#include "postgres.h"
1111

12+
#include <limits.h>
13+
1214
#include "access/htup_details.h"
13-
#include "access/twophase.h"
14-
#include "catalog/pg_type.h"
15-
#include "fmgr.h"
15+
#include "catalog/pg_type_d.h"
16+
#include "executor/executor.h"
1617
#include "funcapi.h"
1718
#include "miscadmin.h"
1819
#include "optimizer/planner.h"
20+
#include "pg_wait_sampling.h"
1921
#include "pgstat.h"
20-
#include "postmaster/autovacuum.h"
21-
#include "replication/walsender.h"
2222
#include "storage/ipc.h"
23-
#include "storage/pg_shmem.h"
24-
#include "storage/procarray.h"
23+
#include "storage/latch.h"
24+
#include "storage/lock.h"
25+
#include "storage/lwlock.h"
26+
#include "storage/proc.h"
2527
#include "storage/shm_mq.h"
2628
#include "storage/shm_toc.h"
27-
#include "storage/spin.h"
29+
#include "storage/shmem.h"
2830
#include "tcop/utility.h"
2931
#include "utils/builtins.h"
30-
#include "utils/datetime.h"
31-
#include "utils/guc_tables.h"
3232
#include "utils/guc.h"
33-
#include "utils/memutils.h" /* TopMemoryContext. Actually for PG 9.6 only,
34-
* but there should be no harm for others. */
33+
#include "utils/memutils.h"
34+
#include "utils/timestamp.h"
3535

36-
#include "compat.h"
37-
#include "pg_wait_sampling.h"
36+
#if PG_VERSION_NUM < 150000
37+
#include "postmaster/autovacuum.h"
38+
#include "replication/walsender.h"
39+
#endif
3840

3941
PG_MODULE_MAGIC;
4042

pg_wait_sampling.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
#ifndef __PG_WAIT_SAMPLING_H__
1111
#define __PG_WAIT_SAMPLING_H__
1212

13-
#include "postgres.h"
14-
15-
#include "storage/proc.h"
13+
#include "datatype/timestamp.h"
14+
#include "storage/latch.h"
15+
#include "storage/lock.h"
1616
#include "storage/shm_mq.h"
17-
#include "utils/timestamp.h"
1817

1918
#define PG_WAIT_SAMPLING_MAGIC 0xCA94B107
2019
#define COLLECTOR_QUEUE_SIZE (16 * 1024)

0 commit comments

Comments
 (0)