aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/injection_point.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/misc/injection_point.c')
-rw-r--r--src/backend/utils/misc/injection_point.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backend/utils/misc/injection_point.c b/src/backend/utils/misc/injection_point.c
index 84ad5e470d7..8ad0c27bc8a 100644
--- a/src/backend/utils/misc/injection_point.c
+++ b/src/backend/utils/misc/injection_point.c
@@ -553,3 +553,20 @@ InjectionPointRun(const char *name)
elog(ERROR, "Injection points are not supported by this build");
#endif
}
+
+/*
+ * Execute an injection point directly from the cache, if defined.
+ */
+void
+InjectionPointCached(const char *name)
+{
+#ifdef USE_INJECTION_POINTS
+ InjectionPointCacheEntry *cache_entry;
+
+ cache_entry = injection_point_cache_get(name);
+ if (cache_entry)
+ cache_entry->callback(name, cache_entry->private_data);
+#else
+ elog(ERROR, "Injection points are not supported by this build");
+#endif
+}