PMPARSEDEBUG(3)

πŸ“¦
version 6.3.8 Β· 2 versions
, in centos-stream 9, debian trixie, ubuntu questing

πŸ’– PMPARSEDEBUG(3) β€” the library functions girlies πŸ’–

okay so bestie, welcome to PMPARSEDEBUG(3), living in the Library Functions Manual section of the PCP docs. grab a snack, we're doing bit-fields πŸ“


✨ NAME ✨

__pmParseDebug, __pmSetDebugBits β€” manipulate old-style PCP debugging control bit-fields πŸ’…


🌸 C SYNOPSIS 🌸

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

int __pmParseDebug(const char *spec);
void __pmSetDebugBits(int value);

cc ... -lpcp

πŸ¦‹ DESCRIPTION πŸ¦‹

ngl, these routines have been deprecated and may be removed in a future Performance Co-Pilot (PCP) release 😭 so please, for your own sake, go look at pmSetDebug(3) and pmClearDebug(3) for the replacement functionality. they're the glow-up versions, fr fr.

__pmParseDebug parses spec, and it's assuming that thing is a comma separated list of PCP debug flags. like a lil roster of flags, one after another πŸ’–

each flag can be given as either an integer, or as the trailing portion of the symbolic name of the corresponding flag, exactly as reported by pmdbg(1). the symbolic names get stripped of the `DBG_TRACE_` prefix, and they can show up in either case β€” uppercase, lowercase, doesn't matter, it ate both ways πŸ‘‘

special case alert 🚨 the values `-1` and `ALL` are treated as synonyms for turning on all bits except the sign bit in the result, i.e. INT_MAX from <limits.h>. iconic behaviour honestly.

for example: the debug option fetch is defined in the output from pmdbg(3) with the -L option, and it may be specified in spec as 2, FETCH or fetch. three ways, same vibe ✨

__pmSetDebugBits lets you set the bit-fields directly using the encoding in value. and listen, the effect is additive, so consecutive calls to __pmSetDebugBits will set the conjunction of the bits in the value arguments. they stack, bestie πŸ“š and if you wanna clear the bit-fields instead? see pmClearDebug(3) 🧚


πŸ’€ DIAGNOSTICS πŸ’€

if it slays (i.e. succeeds), __pmParseDebug returns the value computed by the bit-wise `or` of each flag in the spec β€” perfect for assigning to the global debug trace control variable pmDebug πŸ’–

otherwise the return value is less than 0, which is the code's way of saying "parsing error, girl" 😭


🫢 SEE ALSO 🫢

pmdbg(1), pmSetDebug(3) and pmClearDebug(3).


and that's the whole page, no cap πŸŽ€ this one came to you from Performance Co-Pilot (PCP), filed under PMPARSEDEBUG(3) β€” go drink some water and clear your debug bits, ily πŸ’œπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from