From cc329dc3efbb0ca83e80cc05a31b4d6d43af8d5a Mon Sep 17 00:00:00 2001 From: Marcus Granado Date: Tue, 12 Nov 2024 13:34:37 +0000 Subject: [PATCH] CP-51209: db_notification: enable/disable and begin/end hooks for bpftrace Signed-off-by: Marcus Granado --- ocaml/database/db_cache_types.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ocaml/database/db_cache_types.ml b/ocaml/database/db_cache_types.ml index 99190201ffa..805ea4bebab 100644 --- a/ocaml/database/db_cache_types.ml +++ b/ocaml/database/db_cache_types.ml @@ -366,7 +366,11 @@ module Database = struct let unregister_callback name x = {x with callbacks= List.filter (fun (x, _) -> x <> name) x.callbacks} + let [@inline never][@specialize never] notify_begin () = () + let [@inline never][@specialize never] notify_end () = () + let notify e db = + notify_begin (); List.iter (fun (name, f) -> try f e db @@ -376,6 +380,7 @@ module Database = struct () ) db.callbacks + ;notify_end () let reindex x = let g = x.manifest.Manifest.generation_count in