From 886b85279056240589fdd32ff8ca0d4017a54146 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ocaml/database/db_cache_types.ml b/ocaml/database/db_cache_types.ml index d081dbd674..be73b91958 100644 --- a/ocaml/database/db_cache_types.ml +++ b/ocaml/database/db_cache_types.ml @@ -367,7 +367,12 @@ 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,7 +381,8 @@ module Database = struct (Printexc.to_string e) name ; () ) - db.callbacks + db.callbacks ; + notify_end () let reindex x = let g = x.manifest.Manifest.generation_count in