PMLOGMETATYPESTR(3)

πŸ“¦
version 7.2.2 Β· 4 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, gather round β€” __pmLogMetaTypeStr and __pmLogMetaTypeStr_r are the girlies that take an archive metadata record type and turn it into a string. that's it, that's the job. converting an archive metadata record type into a string. iconic behavior honestly.


✨ C SYNOPSIS ✨

like, here's the whole vibe, verbatim, don't come for me:

#include <pcp/pmapi.h>
#include <pcp/libpcp.h>

const char *__pmLogMetaTypeStr(int type);
char *__pmLogMetaTypeStr_r(int type, char *buf, int buflen);

cc ... -lpcp

yes you gotta link it with -lpcp, obviously. 🫢


🚨 CAVEAT 🚨

okay so real talk, bestie, this one matters:

This documentation is intended for internal Performance Co-Pilot (PCP) developer use.

so like, it's giving backstage pass, not main-stage energy.

and more importantly β€” these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases. πŸ’€ that means they may not work, or they may provide different semantics at some point in the future. no cap. so don't build your whole personality around them staying the same, fr fr.


🌸 DESCRIPTION 🌸

so here's the tea. you hand __pmLogMetaTypeStr a numeric archive metadata record type (type), and it produces the ASCII name of that record type. cute, right? but if type is not a valid record type, it gives you back UNKNOWN instead. rip, but honest of her.

then there's __pmLogMetaTypeStr_r β€” she does the exact same thing, but instead of handing you back a pointer, she stores the result in a user-supplied buffer called buf of length buflen. ✨ and heads up: that buffer buf should have room for at least 17 bytes. don't skimp on her space, she needs it. πŸ’…

examples of the names you get back? DESC (for type equals 1), INDOM_V2 (for type equals 2), etc. slay. πŸ¦‹


πŸ‘‘ NOTES πŸ‘‘

both of these functions are safe to call from threaded contexts. periodt. multi-threaded besties, you're covered. πŸ”₯


with love from the Performance Co-Pilot crew β€” this was PCP, page PMLOGMETATYPESTR(3) πŸ’– stay curious, stay threaded, and remember: internal interfaces are for the girlies who read the caveats πŸŽ€

πŸ“¦ where this page comes from