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 Nov 13, 2024
1 parent 44767bb commit cc329dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ocaml/database/db_cache_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -376,6 +380,7 @@ module Database = struct
()
)
db.callbacks
;notify_end ()

let reindex x =
let g = x.manifest.Manifest.generation_count in
Expand Down

0 comments on commit cc329dc

Please sign in to comment.