PT_ENC_GET_CONFIG(3)

📦 version 2.1.2, in fedora 43, fedora 44

✨ PT_ENC_GET_CONFIG(3) ✨

okay bestie, welcome to PT_ENC_GET_CONFIG — the section 3 page about getting an Intel(R) Processor Trace encoder/decoder's configuration 💅 six whole functions, one very chill job.


💖 NAME 💖

pt_enc_get_config, pt_pkt_get_config, pt_evt_get_config, pt_qry_get_config, pt_insn_get_config, pt_blk_get_config — get an Intel(R) Processor Trace encoder/decoder's configuration 🦋


🌸 SYNOPSIS 🌸

#include <intel-pt.h>
const struct pt_config *
pt_enc_get_config(const struct pt_encoder *encoder);
const struct pt_config *
pt_pkt_get_config(const struct pt_packet_decoder *decoder);
const struct pt_config *
pt_evt_get_config(const struct pt_event_decoder *decoder);
const struct pt_config *
pt_qry_get_config(const struct pt_query_decoder *decoder);
const struct pt_config *
pt_insn_get_config(const struct pt_insn_decoder *decoder);
const struct pt_config *
pt_blk_get_config(const struct pt_block_decoder *decoder);

Link with -lipt.

six functions. same shape. different friend. you pass in your encoder or your decoder, you get back a pointer to its config. that's the whole vibe check 🎀

and fr fr, don't forget: Link with -lipt. no -lipt, no link, no slay 💀


🫶 DESCRIPTION 🫶

so here's the tea ☕ these functions return a pointer to their argument's configuration. that's it. that's the function.

but lowkey the important part is the ownership rules, and bestie you have to remember these:

  • The returned configuration object must not be freed. not yours. hands off. 🙈
  • It is valid as long as their argument is not freed.

so like… the config is riding shotgun with the encoder/decoder it came from. the moment that thing gets freed, your pointer is giving expired-milk energy 😭 don't touch it after that.


⭐ RETURN VALUE ⭐

  • these functions return a pointer to a pt_config object 👑
  • the returned pointer is NULL if their argument is NULL — so if you hand it nothing, it hands you nothing back. fair. balanced. iconic. 💅
(also yes, the original really does say "returns" instead of "return". we love a typo that ate. periodt.)

🌈 SEE ALSO 🌈

go read these next, i'm obsessed with them:


and that's the page, bestie!! you just read PT_ENC_GET_CONFIG(3), section 3 of the manual, top to bottom, no skips, main character energy only 🧚💖 mwah, go forth and get your config 🎀

📦 where this page comes from