package tracy-client
Client bindings to the Tracy profiler (v0.10)
Install
Dune Dependency
Authors
Maintainers
Sources
tracy-client-0.5.2.tbz
sha256=7ceabb63bd7ce9af4d6f24f84b79497838d3b4e9803d66ef4e4b3ca042b45599
sha512=896a736a1e872bf7b0d5b36d693dc24e4ecac97b3219074472876a04c17a73435da12678d4d026b23afadf25bc3c32ef2a2b61c43f665fe628efcc8e97be0689
doc/src/tracy-client/tracy_client.ml.html
Source file tracy_client.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
type span = int (* technically, [span] is [(bool,uint32)], but since tracy required 64 bits, it always fits *) external _tracy_enter : file:string -> fun_:string -> line:int -> name:string -> depth:int -> span = "ml_tracy_enter" [@@noalloc] external _tracy_exit : span -> unit = "ml_tracy_exit" [@@noalloc] external _tracy_name_thread : string -> unit = "ml_tracy_name_thread" external _tracy_msg : string -> unit = "ml_tracy_msg" [@@noalloc] external _tracy_plot : string -> float -> unit = "ml_tracy_plot" [@@noalloc] (* TODO external _tracy_set_plot_unit : string -> float -> unit = "ml_tracy_plot" *) external _tracy_app_info : string -> unit = "ml_tracy_app_info" external _tracy_span_text : span -> string -> unit = "ml_tracy_span_text" [@@noalloc] external _tracy_span_value : span -> int64 -> unit = "ml_tracy_span_value" [@@noalloc] external _tracy_span_color : span -> int -> unit = "ml_tracy_span_color" [@@noalloc] let enter ?cs_depth ~__FILE__:file ~__LINE__:line ?(__FUNCTION__ = "<fun>") name : span = let depth = match cs_depth with | None -> 0 | Some i -> i in _tracy_enter ~file ~fun_:__FUNCTION__ ~line ~name ~depth (* TODO: in enter/tracy_enter, use ___tracy_emit_zone_value/color/text for bonus items *) let exit = _tracy_exit let name_thread = _tracy_name_thread let message = _tracy_msg let plot = _tracy_plot let set_color = _tracy_span_color let add_value = _tracy_span_value let add_text = _tracy_span_text let set_app_info = _tracy_app_info let message_f k = k (fun fmt -> Format.kasprintf message fmt) let add_text_f sp k = k (fun fmt -> Format.kasprintf (add_text sp) fmt) let[@inline] with_ ?cs_depth ~__FILE__ ~__LINE__ ?__FUNCTION__ name f = let _sp = enter ?cs_depth ~__FILE__ ~__LINE__ ?__FUNCTION__ name in try let x = f _sp in exit _sp; x with e -> exit _sp; raise e
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>