PMCONNECTLOGGER(3)
π PMCONNECTLOGGER π
okay bestie, welcome to the Library Functions Manual page for __pmConnectLogger β yes it's a C function, yes it's in the libpcp zone, and yes we're gonna get through it together. grab a strawberry π
β¨ NAME β¨
__pmConnectLogger β connect to a performance metrics logger control port π
πΈ C SYNOPSIS πΈ
like literally just this:
#include "pmapi.h"
#include "libpcp.h"
int __pmConnectLogger(const char *hostname, int pid);
cc ... -lpcp
no cap, that's the whole signature π
β οΈ CAVEAT β οΈ
bestie. listen. this documentation is intended for internal Performance Co-Pilot (PCP) developer use. it's giving backstage-pass energy, not public-API energy. π
these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases, and they may not work, or may provide different semantics at some point in the future. so likeβ¦ don't build your whole personality on them, fr fr. π
π¦ DESCRIPTION π¦
so every single instance of the Performance Co-Pilot (PCP) archive creation program pmlogger(1) supports a control port, right? and on that control port, __pmControlLog(3) requests come in and responses go out. it's giving customer service desk. π
and optionally, a pmlogger(1) instance may be designated the ``primary'' logger. main character energy, honestly. β
__pmConnectLogger is the function you use to establish a control port connection to the pmlogger(1) instance identified by process id pid on the host hostname. that's the whole vibe check. β¨
and there's one special case that's supported, lowkey iconic: for the reserved pid value of PM_LOG_PRIMARY_PORT, the requested connection is to the control port for the ``primary'' logger β whatever its process id might be. you don't have to know who it is. it just knows. π
on success, __pmConnectLogger returns a non-negative integer, which is a file descriptor that may be used in subsequent communication with the pmlogger(1) instance, e.g. for __pmControlLog(3). slay. π
β οΈ important!! as the control port topmlogger(1)is not multiplexed, applications using__pmConnectLoggershould useclose(2)to terminate the connection topmlogger(1)as soon as they have finished communicating. like, hang up the phone when you're done talking, bestie. π
and if the application connects, and the pmlogger(1) instance subsequently terminates β e.g. because the associated pmcd(1) instance is terminated β the application will have to explicitly re-establish connection to a restarted pmlogger(1) instance by calling __pmConnectLogger again. no auto-reconnect, no safety net, it's giving you-have-to-text-first. π
π DIAGNOSTICS π
here's what it yells at you when things go sideways:
PM_ERR_PERMISSIONβ no permission to connect to the specifiedpmlogger(1)instance. it's giving bouncer-at-the-club. π«-ECONNREFUSEDβ the designatedpmlogger(1)instance does not exist. ghosted, literally. π»-EADDRINUSEβ the requested control port is already in use. somebody's already in that seat bestie, sit somewhere else. π
π SEE ALSO π
pmcd(1), pmlc(1), pmlogger(1), PMAPI(3) and __pmControlLog(3).
go read those too, iykyk π
and that's the whole page!! brought to you by the good people of Performance Co-Pilot / PCP β the collection itself, the whole source-and-version moment, wrapped up with a lil bow. π no date stamp to shout about here, just vibes and a manpage that lives in the PCP house. mwah, bye bestie πβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms