[][src]Function libipt_sys::pt_enc_next

pub unsafe extern "C" fn pt_enc_next(
    encoder: *mut pt_encoder,
    packet: *const pt_packet
) -> c_int

Encode an Intel PT packet.

Writes @packet at @encoder's current position in the Intel PT buffer and advances the @encoder beyond the written packet.

The @packet.size field is ignored.

In case of errors, the @encoder is not advanced and nothing is written into the Intel PT buffer.

Returns the number of bytes written on success, a negative error code otherwise.

Returns -pte_bad_opc if @packet.type is not known. Returns -pte_bad_packet if @packet's payload is invalid. Returns -pte_eos if @encoder reached the end of the Intel PT buffer. Returns -pte_invalid if @encoder or @packet is NULL.