PostgreSQL Source Code  git master
injection_point.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  * injection_point.h
3  * Definitions related to injection points.
4  *
5  * Copyright (c) 2001-2024, PostgreSQL Global Development Group
6  *
7  * src/include/utils/injection_point.h
8  *-------------------------------------------------------------------------
9  */
10 
11 #ifndef INJECTION_POINT_H
12 #define INJECTION_POINT_H
13 
14 /*
15  * Injections points require --enable-injection-points.
16  */
17 #ifdef USE_INJECTION_POINTS
18 #define INJECTION_POINT(name) InjectionPointRun(name)
19 #else
20 #define INJECTION_POINT(name) ((void) name)
21 #endif
22 
23 /*
24  * Typedef for callback function launched by an injection point.
25  */
26 typedef void (*InjectionPointCallback) (const char *name);
27 
28 extern Size InjectionPointShmemSize(void);
29 extern void InjectionPointShmemInit(void);
30 
31 extern void InjectionPointAttach(const char *name,
32  const char *library,
33  const char *function);
34 extern void InjectionPointRun(const char *name);
35 extern void InjectionPointDetach(const char *name);
36 
37 #endif /* INJECTION_POINT_H */
size_t Size
Definition: c.h:605
void InjectionPointShmemInit(void)
Size InjectionPointShmemSize(void)
void(* InjectionPointCallback)(const char *name)
void InjectionPointRun(const char *name)
void InjectionPointDetach(const char *name)
void InjectionPointAttach(const char *name, const char *library, const char *function)
const char * name