PT_QRY_GET_OFFSET(3)

πŸ“¦ version 2.1.2, in fedora 43, fedora 44

✨ PT_QRY_GET_OFFSET(3) ✨

okay bestie, pull up a chair πŸͺ‘ because we're talking about pt_qry_get_offset and pt_qry_get_sync_offset β€” the two little functions that tell you where your Intel(R) Processor Trace query decoder is currently vibing in its trace buffer. and like, also where it last synced up. it's giving "where am I" but for a decoder. main character energy fr fr πŸ’…


πŸŽ€ NAME πŸŽ€

pt_qry_get_offset</purl>, pt_qry_get_sync_offset** β€” get an Intel(R) Processor Trace query decoder's current / synchronization trace buffer offset. πŸ¦‹

🌸 SYNOPSIS 🌸

like, here's the literal tea, copy it exactly bestie:

#include <intel-pt.h>
int pt_qry_get_offset(const struct pt_query_decoder *decoder,
                      uint64_t *offset);
int pt_qry_get_sync_offset(const struct pt_query_decoder *decoder,
                           uint64_t *offset);

Link with -lipt. 🫢


πŸ’– DESCRIPTION πŸ’–

pt_qry_get_offset() hands you the decoder's current position, expressed as an offset in bytes from the beginning of the decoder's trace buffer, and it drops it into the unsigned integer variable that offset points to. that's it. that's the whole thing. iconic. ✨

pt_qry_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. so like, "where did we last lock in?" 🎯

both of them: unsigned integer variable, pointed to by offset, offset in bytes, from the beginning of the decoder's trace buffer. no cap. πŸ’œ


πŸ”₯ RETURN VALUE πŸ”₯

Both functions return zero on success πŸŽ‰ or a negative pt_error_code enumeration constant if something went wrong 😭.


πŸ’€ ERRORS πŸ’€

  • pte_invalid β€” the decoder or offset argument is NULL. yeah. you passed a nothing. πŸ™ˆ
  • pte_nosync β€” decoder has not been synchronized onto the trace stream. like it's just floating there, unmoored, no sync, no thoughts, head empty 🧚. go fix that with pt_qry_sync_forward(3), pt_qry_sync_backward(3), or pt_qry_sync_set(3) to synchronize decoder. periodt.

🌈 SEE ALSO 🌈

your reading list, bestie, go be nosy πŸ‘‘:


and that's the whole page, babe 🫢 the footer at the bottom just says PT_QRY_GET_OFFSET(3) right back at you β€” the title again, doing its little echo thing πŸ’« β€” so shoutout to the source, version and date hiding down there keeping the whole thing officially official. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from