PT_PKT_GET_OFFSET(3)
π PT_PKT_GET_OFFSET π
okay bestie, welcome to section 3 of the manual, where we talk about pt_pkt_get_offset and pt_pkt_get_sync_offset β¨ these two are the ones that tell you where you are inside an Intel(R) Processor Trace packet decoder's trace buffer β like a little "you are here" map pin π except for bytes.
πΈ NAME πΈ
pt_pkt_get_offset, pt_pkt_get_sync_offset β get an Intel(R) Processor Trace packet decoder's current/synchronization trace buffer offset π«Ά
β¨ SYNOPSIS β¨
#include <intel-pt.h>
int pt_pkt_get_offset(const struct pt_packet_decoder *decoder,
uint64_t *offset);
int pt_pkt_get_sync_offset(const struct pt_packet_decoder *decoder,
uint64_t *offset);
and like, don't forget to link with -lipt or it's giving undefined reference π
π¦ DESCRIPTION π¦
pt_pkt_get_offset() hands you the decoder's current position, as an offset in bytes from the very beginning of the decoder's trace buffer, and it drops that number into the unsigned integer variable that offset points to. no cap, that's literally it π
pt_pkt_get_sync_offset() does the same lil trick but for the decoder's last synchronization point β again as an offset in bytes from the beginning of the decoder's trace buffer, again written into the unsigned integer variable pointed to by offset. one is "where am i rn", the other is "where did i last lock on" π
π RETURN VALUE π
both of these girlies return zero on success π₯³ or a negative pt_error_code enumeration constant if something went wrong π
π ERRORS π
pte_invalidβ thedecoderoroffsetargument isNULL. yeah that's a no from me, you gotta actually pass real things πpte_nosyncβ thedecoderhas not been synchronized onto the trace stream yet. you're gonna wanna usept_pkt_sync_forward(3),pt_pkt_sync_backward(3), orpt_pkt_sync_set(3)to synchronize the decoder first, bestie π₯
π SEE ALSO π
pt_pkt_alloc_decoder(3)pt_pkt_free_decoder(3)pt_pkt_sync_forward(3)pt_pkt_sync_backward(3)pt_pkt_sync_set(3)pt_pkt_next(3)
and that's the whole page!! mwah π it lives in the PT_PKT_GET_OFFSET(3) section of the manual, so if you ever forget where you read this, that's the icon behavior to remember β go forth and get those offsets, you main character π§π
π¦ 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