1PMCONNECTLOGGER(3) Library Functions Manual PMCONNECTLOGGER(3)
2
3
4
6 __pmConnectLogger - connect to a performance metrics logger control
7 port
8
10 #include "pmapi.h"
11 #include "libpcp.h"
12
13 int __pmConnectLogger(const char *hostname, int pid);
14
15 cc ... -lpcp
16
18 This documentation is intended for internal Performance Co-Pilot (PCP)
19 developer use.
20
21 These interfaces are not part of the PCP APIs that are guaranteed to
22 remain fixed across releases, and they may not work, or may provide
23 different semantics at some point in the future.
24
26 Each instance of the Performance Co-Pilot (PCP) archive creation pro‐
27 gram pmlogger(1) supports a control port on which __pmControlLog(3) re‐
28 quests are received, and responses sent. Optionally, the pmlogger(1)
29 instance may be designated the ``primary'' logger.
30
31 __pmConnectLogger may be used to establish a control port connection to
32 the pmlogger(1) instance identified by process id pid on the host host‐
33 name.
34
35 One special case is supported; for the reserved pid value of
36 PM_LOG_CONTROL_PORT the requested connection is to the control port for
37 the ``primary'' logger, whatever its process id might be.
38
39 On success, __pmConnectLogger returns a non-negative integer, that is a
40 file descriptor that may be used in subsequent communication with the
41 pmlogger(1) instance, e.g. for __pmControlLog(3).
42
43 As the control port to pmlogger(1) is not mulitplexed, applications us‐
44 ing __pmConnectLogger should use close(2) to terminate the connection
45 to pmlogger(1) as soon as they have finished communicating.
46
47 If the application connects, and the pmlogger(1) instance subsequently
48 terminates, e.g. because the associated pmcd(1) instance is terminated,
49 the application will have to explicitly re-establish connection to a
50 re-started pmlogger(1) instance by calling __pmConnectLogger again.
51
53 PM_ERR_PERMISSION
54 no permission to connect to the specified pmlogger(1) instance
55
56 -ECONNREFUSED
57 the designated pmlogger(1) instance does not exist
58
59 -EEADDRINUSE
60 the requested control port is already in use
61
63 pmcd(1), pmlc(1), pmlogger(1), PMAPI(3) and __pmControlLog(3).
64
65
66
67Performance Co-Pilot PCP PMCONNECTLOGGER(3)