Skip to content

Commit 886b852

Browse files
mg12edwintorok
authored andcommitted
CP-51209: db_notification: enable/disable and begin/end hooks for bpftrace
Signed-off-by: Marcus Granado <[email protected]>
1 parent 0b7202d commit 886b852

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ocaml/database/db_cache_types.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,12 @@ module Database = struct
367367
let unregister_callback name x =
368368
{x with callbacks= List.filter (fun (x, _) -> x <> name) x.callbacks}
369369

370+
let[@inline never] [@specialize never] notify_begin () = ()
371+
372+
let[@inline never] [@specialize never] notify_end () = ()
373+
370374
let notify e db =
375+
notify_begin () ;
371376
List.iter
372377
(fun (name, f) ->
373378
try f e db
@@ -376,7 +381,8 @@ module Database = struct
376381
(Printexc.to_string e) name ;
377382
()
378383
)
379-
db.callbacks
384+
db.callbacks ;
385+
notify_end ()
380386

381387
let reindex x =
382388
let g = x.manifest.Manifest.generation_count in

0 commit comments

Comments
 (0)