PT_ISCACHE_SET_LIMIT(3)

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

✨ PT_ISCACHE_SET_LIMIT β€” bestie edition ✨

okay so this is pt_iscache_set_limit(3), and it's literally the "how much RAM are we letting the cache eat" button for the Intel PT image section cache. yes queen, we're doing memory budgeting today πŸ’…


🌸 NAME 🌸

pt_iscache_set_limit β€” set the mapped image section cache limit πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <intel-pt.h>
int pt_iscache_set_limit(struct pt_image_section_cache *iscache,
                         uint64_t limit);

Link with -lipt. don't forget it or it's giving undefined reference energy 😭


πŸ’– DESCRIPTION πŸ’–

pt_iscache_set_limit() sets the mapped image section cache limit, periodt. so here's the tea:

  • the iscache argument points to the pt_image_section_cache object β€” that's your girl, the thing we're configuring 🫢
  • the limit argument gives the limit in bytes

and here's the actual vibe: the image section cache will spend at most limit bytes to keep image sections mapped, instead of mapping and unmapping them every single time it reads from them. no cap, that's the whole tradeoff β€” keep stuff mapped and cozy, or churn through map/unmap like it's got somewhere to be.

and the receipts include the memory for any caches associated with the mapped section too, so like, the number you give it is the real total, not just the section bytes 🌈

🚨 and listen: a limit of zero disables caching and clears the cache. zero is not "unlimited", bestie, zero is "we're done here, pack it up" πŸ’€

πŸ‘‘ RETURN VALUE πŸ‘‘

pt_iscache_set_limit() returns zero on success, or a negative pt_error_code enumeration constant in case of an error. negative = bad vibes, zero = slay ✨


πŸ“ ERRORS πŸ“

  • pte_invalid β€” the iscache argument is NULL. girl. you passed nothing. πŸ™ˆ

🧚 SEE ALSO 🧚


and that's the whole page, fr fr β€” PT_ISCACHE_SET_LIMIT(3), the manual name herself, signing off πŸ’œ go set that limit and go be iconic πŸŽ€

πŸ“¦ where this page comes from