Skip to main content

dr_mark_trace_head

Function dr_mark_trace_head 

Source
pub unsafe extern "C" fn dr_mark_trace_head(
    drcontext: *mut c_void,
    tag: *mut c_void,
) -> bool_
Expand description

Marks the fragment associated with tag \p tag as a trace head. The fragment need not exist yet – once it is created it will be marked as a trace head.

DR associates a counter with a trace head and once it passes the -hot_threshold parameter, DR begins building a trace. Before each fragment is added to the trace, DR calls the client’s end_trace callback to determine whether to end the trace. (The callback will be called both for standard DR traces and for client-defined traces.)

\note Some fragments are unsuitable for trace heads. DR will ignore attempts to mark such fragments as trace heads and will return false. If the client marks a fragment that doesn’t exist yet as a trace head and DR later determines that the fragment is unsuitable for a trace head it will unmark the fragment as a trace head without notifying the client.

\note Some fragments’ notion of trace heads is dependent on which previous block targets them. For these fragments, calling this routine will only mark as a trace head for targets from the same memory region.

Returns true if the target fragment is marked as a trace head.