PT_QRY_GET_OFFSET(3)
β¨ 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β thedecoderoroffsetargument isNULL. yeah. you passed a nothing. πpte_nosyncβdecoderhas not been synchronized onto the trace stream. like it's just floating there, unmoored, no sync, no thoughts, head empty π§. go fix that withpt_qry_sync_forward(3),pt_qry_sync_backward(3), orpt_qry_sync_set(3)to synchronizedecoder. periodt.
π SEE ALSO π
your reading list, bestie, go be nosy π:
pt_qry_alloc_decoder(3)pt_qry_free_decoder(3)pt_qry_sync_forward(3)pt_qry_sync_backward(3)pt_qry_sync_set(3)pt_qry_get_config(3)pt_qry_cond_branch(3)pt_qry_indirect_branch(3)pt_qry_event(3)pt_qry_time(3)pt_qry_core_bus_ratio(3)
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
- 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