diff --git a/plprofiler.c b/plprofiler.c index 24a39eb..a30f024 100755 --- a/plprofiler.c +++ b/plprofiler.c @@ -681,7 +681,6 @@ profiler_shmem_startup(void) hash_ctl.hash = line_hash_fn; hash_ctl.match = line_match_fn; functions_shared = ShmemInitHash("plprofiler functions", - profiler_max_functions, profiler_max_functions, &hash_ctl, HASH_ELEM | HASH_FUNCTION | HASH_COMPARE); @@ -693,7 +692,6 @@ profiler_shmem_startup(void) hash_ctl.hash = callgraph_hash_fn; hash_ctl.match = callgraph_match_fn; callgraph_shared = ShmemInitHash("plprofiler callgraph", - profiler_max_callgraph, profiler_max_callgraph, &hash_ctl, HASH_ELEM | HASH_FUNCTION | HASH_COMPARE); diff --git a/plprofiler.h b/plprofiler.h index 8158454..8ac4d49 100644 --- a/plprofiler.h +++ b/plprofiler.h @@ -40,6 +40,8 @@ #include "pgstat.h" #include "plpgsql.h" #include "storage/ipc.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" #include "storage/spin.h" #include "utils/array.h" #include "utils/builtins.h" @@ -49,6 +51,7 @@ #include "utils/memutils.h" #include "utils/palloc.h" #include "utils/syscache.h" +#include "utils/tuplestore.h" PG_MODULE_MAGIC; @@ -161,7 +164,7 @@ typedef struct callGraphEntry typedef struct { - LWLockId lock; + LWLock *lock; bool profiler_enabled_global; int profiler_enabled_pid; int profiler_collect_interval;