cltp_usrreq.c made separate file in conf/files
[unix-history] / usr / src / sys / netiso / tp_meas.c
CommitLineData
b08d03f0
KS
1/***********************************************************
2 Copyright IBM Corporation 1987
3
4 All Rights Reserved
5
6Permission to use, copy, modify, and distribute this software and its
7documentation for any purpose and without fee is hereby granted,
8provided that the above copyright notice appear in all copies and that
9both that copyright notice and this permission notice appear in
10supporting documentation, and that the name of IBM not be
11used in advertising or publicity pertaining to distribution of the
12software without specific, written prior permission.
13
14IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20SOFTWARE.
21
22******************************************************************/
23
24/*
25 * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
26 */
27/*
28 * $Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $
29 * $Source: /usr/argo/sys/netiso/RCS/tp_meas.c,v $
44f52ea5 30 * @(#)tp_meas.c 7.3 (Berkeley) %G% *
b08d03f0
KS
31 *
32 * tp_meas.c : create a performance measurement event
33 * in the circular buffer tp_Meas[]
34 */
35
36#ifndef lint
37static char *rcsid = "$Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $";
38#endif lint
39
40#include "types.h"
41#include "time.h"
a50e2bc0
KS
42#include "argo_debug.h"
43#include "tp_meas.h"
b08d03f0
KS
44
45extern struct timeval time;
46
47#ifdef TP_PERF_MEAS
48int tp_Measn = 0;
49struct tp_Meas tp_Meas[TPMEASN];
50
51/*
52 * NAME: tpmeas()
53 *
54 * CALLED FROM: tp_emit(), tp_soisdisconecting(), tp_soisdisconnected()
55 * tp0_stash(), tp_stash(), tp_send(), tp_goodack(), tp_usrreq()
56 *
57 * FUNCTION and ARGUMENTS:
58 * stashes a performance-measurement event for the given reference (ref)
59 * (kind) tells which kind of event, timev is the time to be stored
60 * with this event, (seq), (win), and (size) are integers that usually
61 * refer to the sequence number, window number (on send) and
62 * size of tpdu or window.
63 *
64 * RETURNS: Nada
65 *
66 * SIDE EFFECTS:
67 *
68 * NOTES:
69 */
70void
a50e2bc0 71Tpmeas(ref, kind, timev, seq, win, size)
b08d03f0
KS
72 u_int ref;
73 u_int kind;
74 struct timeval *timev;
75 u_int seq, win, size;
76{
77 register struct tp_Meas *tpm;
78 static int mseq;
79
80 tpm = &tp_Meas[tp_Measn++];
81 tp_Measn %= TPMEASN;
82
83 tpm->tpm_kind = kind;
84 tpm->tpm_tseq = mseq++;
85 tpm->tpm_ref = ref;
86 if(kind == TPtime_from_ll)
87 bcopy((caddr_t)timev, (caddr_t)&tpm->tpm_time, sizeof(struct timeval));
88 else
89 bcopy( (caddr_t)&time,
90 (caddr_t)&tpm->tpm_time, sizeof(struct timeval) );
91 tpm->tpm_seq = seq;
92 tpm->tpm_window = win;
93 tpm->tpm_size = size;
94}
95
96#endif TP_PERF_MEAS