Skip to main content

Crate hitrace

Crate hitrace 

Source
Expand description

HiTrace

Safe bindings for the HiTrace tracing system on OpenHarmony. This crate does nothing if not compiled for OpenHarmony (target_env = ohos).

§Usage

HiTrace allows tracing Spans in a synchronous and stack based fashion.

§Examples

§

fn load_website() {
    start_trace(&c"step1");
    step1();
    finish_trace();
    start_trace(&CString::new("step2").unwrap());
    step2();
    finish_trace();
}
start_trace(&c"LoadingWebsite");
load_website();
finish_trace();

Structs§

ScopedTrace

Traits§

SaturatingIntoI64

Functions§

finish_trace
Finishes the most recently started trace span
start_trace
trace_metric_saturating
Logs a count trace event with a name and an integer count, using saturating conversion to i64.
trace_metric_saturating_str
Logs a count trace event with a &str name and an integer count, using saturating conversion to i64.
trace_metric_str
Logs a count trace event with a &str name and an integer count that can be converted to i64.