7964 Want usba hcdi manual pages
[unleashed.git] / usr / src / man / man3lgrp / lgrp_latency.3lgrp
blobc197215a31b9e7081a7c2c526103b4d7bf6aa2b3
1 '\" te
2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LGRP_LATENCY 3LGRP "April 9, 2016"
7 .SH NAME
8 lgrp_latency, lgrp_latency_cookie \- get latency between two lgroups
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR... ] \fIfile\fR... \fB-llgrp\fR [ \fIlibrary\fR... ]
13 #include <sys/lgrp_user.h>
15 \fBint\fR \fBlgrp_latency_cookie\fR(\fBlgrp_cookie_t\fR \fIcookie\fR, \fBlgrp_id_t\fR \fIfrom\fR,
16      \fBlgrp_id_t\fR \fIto\fR, \fBlgrp_lat_between_t\fR \fIbetween\fR);
17 .fi
19 .LP
20 .nf
21 \fBint\fR \fBlgrp_latency\fR(\fBlgrp_id_t\fR \fIfrom\fR, \fBlgrp_id_t\fR \fIto\fR);
22 .fi
24 .SH DESCRIPTION
25 .LP
26 The \fBlgrp_latency_cookie()\fR function takes a cookie representing a snapshot
27 of the lgroup hierarchy obtained from \fBlgrp_init\fR(3LGRP) and returns the
28 latency value between a hardware resource in the \fIfrom\fR lgroup to a
29 hardware resource in the \fIto\fR lgroup. If \fIfrom\fR is the same lgroup as
30 \fIto\fR, the latency value within that lgroup is returned.
31 .sp
32 .LP
33 The \fIbetween\fR argument should be set to the following value to specify
34 between which hardware resources the latency should be measured:
35 .sp
36 .in +2
37 .nf
38 LGRP_LAT_CPU_TO_MEM     /* latency from CPU to memory */
39 .fi
40 .in -2
42 .sp
43 .LP
44 The latency value is defined by the operating system and is platform-specific.
45 It can be used only for relative comparison of lgroups on the running system.
46 It does not necessarily represent the actual latency between hardware devices,
47 and it might not be applicable across platforms.
48 .sp
49 .LP
50 The \fBlgrp_latency()\fR function is similar to the
51 \fBlgrp_latency_cookie()\fR function, but returns the latency between the given
52 lgroups at the given instant in time. Since lgroups can be freed and
53 reallocated, this function might not be able to provide a consistent answer
54 across calls. For that reason, the \fBlgrp_latency_cookie()\fR function should
55 be used in its place.
56 .SH RETURN VALUES
57 .LP
58 Upon successful completion, the latency value is returned. Otherwise \(mi1 is
59 returned and \fBerrno\fR is set to indicate the error.
60 .SH ERRORS
61 .LP
62 The \fBlgrp_latency_cookie()\fR and \fBlgrp_latency()\fR functions will fail
63 if:
64 .sp
65 .ne 2
66 .na
67 \fB\fBEINVAL\fR\fR
68 .ad
69 .RS 10n
70 The specified cookie, lgroup ID, or value given for the \fIbetween\fR argument
71 is not valid.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fBESRCH\fR\fR
78 .ad
79 .RS 10n
80 The specified lgroup ID was not found, the \fIfrom\fR lgroup does not contain
81 any CPUs, or the \fIto\fR lgroup does not have any memory.
82 .RE
84 .SH ATTRIBUTES
85 .LP
86 See \fBattributes\fR(5) for descriptions of the following attributes:
87 .sp
89 .sp
90 .TS
91 box;
92 c | c
93 l | l .
94 ATTRIBUTE TYPE  ATTRIBUTE VALUE
96 Interface Stability     Evolving
98 MT-Level        MT-Safe
99 .TE
101 .SH SEE ALSO
103 \fBlgrp_init\fR(3LGRP), \fBlgrp_parents\fR(3LGRP), \fBlgrp_children\fR(3LGRP),
104 \fBliblgrp\fR(3LIB), \fBattributes\fR(5)