PT_ENC_GET_OFFSET(3)
π PT_ENC_GET_OFFSET β bestie edition π
okay so real talk, this page is about pt_enc_get_offset and pt_enc_sync_set from the intel-pt crew β they're the ones who get and set an Intel(R) Processor Trace packet encoder's current trace buffer offset. two little functions, one big vibe, let's go β¨
β¨ NAME β¨
pt_enc_get_offset, pt_enc_sync_set β get/set an Intel(R) Processor Trace packet encoder's current trace buffer offset π
πΈ SYNOPSIS πΈ
#include <intel-pt.h>
int pt_enc_get_offset(const struct pt_packet_encoder *encoder,
uint64_t *offset);
int pt_enc_sync_set(const struct pt_packet_encoder *encoder,
uint64_t offset);
Link with -lipt.
no cap, that Link with -lipt. is not optional, bestie, that's literally how you get these functions at all π
π¦ DESCRIPTION π¦
okay so pt_enc_get_offset() is the little gossip girl of the pair: it tells you the encoder's current position, expressed as an offset in bytes from the beginning of the encoder's trace buffer, and it drops that number into the unsigned integer variable that offset points to. it's giving "where am i right now, be honest" π
then pt_enc_sync_set() is the main character move: it sets the encoder's current position to offset bytes from the beginning of its trace buffer. like, we're manifesting a new location. periodt β¨
π₯ RETURN VALUE π₯
both of these return zero on success, or a negative pt_error_code enumeration constant if something went wrong π that negative is your sign, bestie.
π ERRORS π
pte_invalidβ theencoderargument isNULL, or (forpt_enc_sync_set()only) theoffsetargument isNULL. someone passed a whole nothing. πpte_eosβ theoffsetargument is too big, and the resulting position would land outside of the encoder's trace buffer. heads up, this one ispt_enc_sync_set()only. you tried to sync somewhere that doesn't exist, and the encoder said no π«
fr fr, don't go setting offsets past the end of the buffer and expect it to just work. pte_eos is waiting for you.
π SEE ALSO π
pt_enc_alloc_encoder(3)pt_enc_free_encoder(3)pt_enc_next(3)
go read those next, iykyk π§
and that's the whole page, babe β the footer at the bottom is just PT_ENC_GET_OFFSET(3) again, waving goodbye like the icon it is ππ
π¦ where this page comes from
- fedora 43: libipt-devel 2.1.2-3.fc43 Β· BSD-3-Clause
- fedora 43: libipt-devel 2.1.2-3.fc43 Β· BSD-3-Clause
- fedora 44: libipt-devel 2.1.2-4.fc44 Β· BSD-3-Clause
- fedora 44: libipt-devel 2.1.2-4.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms