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