1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
'\"macro stdmacro
.\" Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" for more details.
.\"
.TH QMC_CONTEXT 3 "SGI" "Performance Co-Pilot"
.SH NAME
\f3QmcContext\f1 \- container for a PMAPI context and its metrics
.SH "C++ SYNOPSIS"
.ft 3
#include <QmcContext.h>
.sp
CC ... \-lqmc \-lpcp
.ft 1
.SH DESCRIPTION
A
.B QmcContext
object is a container for a single
.BR PMAPI (3)
context. The object maintains a list of all the metric descriptors
.RB ( QmcDesc ),
instance domains
.RB ( QmcIndom )
and
metrics
.RB ( QmcMetric )
using the context to minimize the duplication of these objects.
.SH "CONSTRUCTORS"
A
.B QmcContext
object should be constructed through the
.B QmcGroup::use
interface.
.SH "DESCRIPTOR LOOKUP"
The metric and instance domain descriptors are cached by the
.B QmcContext
object to reduce duplicate
.BR QmcDesc (3)
and
.BR QmcIndom (3)
objects and
.BR PMAPI (3)
calls required to create them. Also the mapping from metrics names to
.BR pmID s
is also maintained to avoid
.BR pmLookupName (3)
calls.
.TP 4
.B "int lookupDesc(const char *name, pmID& id);"
Search for the metric
.I name
in the name list and set
.B id
to the known
.BR pmID .
If not found, use
.BR pmLookupName (3)
to get the mapping. If this call fails, the
.BR PMAPI (3)
error code will be returned.
.TP
.B "int lookupDesc(const char *name, uint_t& desc, uint_t& indom);"
Find the index
.I desc
and
.I indom
to the
.B QmcDesc
object and the
.B QmcIndom
object for the metric
.IR name .
The indexes can then be used with
.B QmcContext::desc
and
.B QmcContext::indom
to obtain references to the real objects.
The methods will return a
.BR PMAPI (3)
error code if the metric descriptor or instance domain could not be obtained.
.TP
.B "int lookupDesc(pmID pmid, uint_t& desc, uint_t& indom);"
Find the index
.I desc
and
.I indom
to the
.B QmcDesc
object and the
.B QmcIndom
object for the metric
.IR pmid .
The indexes can then be used with
.B QmcContext::desc
and
.B QmcContext::indom
to obtain references to the real objects.
The methods will return a
.BR PMAPI (3)
error code if the metric descriptor or instance domain could not be obtained.
.SH SEE ALSO
.BR PMAPI (3),
.BR QMC (3),
.BR QmcDesc (3),
.BR QmcGroup (3),
.BR QmcIndom (3),
.BR QmcMetric (3),
.BR pmflush (3),
.BR pmLookupName (3)
and
.BR pmprintf (3).
.SH DIAGNOSTICS
Error messages are generated using
.BR pmprintf (3)
but are not flushed. It is the responsibility of the user to call
.BR pmflush (3)
to output any messages.
.PP
Additional diagnostics may be activated by adding
.B DBG_TRACE_PMC
and
.B DBG_TRACE_OPTFETCH
to the global
.IR pmDebug .
|