Skip to content

Commit

Permalink
CP-51209: db_notification: enable/disable and begin/end hooks for bpf…
Browse files Browse the repository at this point in the history
…trace

Signed-off-by: Marcus Granado <[email protected]>
  • Loading branch information
mg12 authored and edwintorok committed Dec 12, 2024
1 parent 0b7202d commit 886b852
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ocaml/database/db_cache_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 886b852

Please sign in to comment.