make tags for header file too
[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 $
30 *
31 * tp_meas.c : create a performance measurement event
32 * in the circular buffer tp_Meas[]
33 */
34
35#ifndef lint
36static char *rcsid = "$Header: tp_meas.c,v 5.2 88/11/18 17:28:04 nhall Exp $";
37#endif lint
38
39#include "types.h"
40#include "time.h"
a50e2bc0
KS
41#include "argo_debug.h"
42#include "tp_meas.h"
b08d03f0
KS
43
44extern struct timeval time;
45
46#ifdef TP_PERF_MEAS
47int tp_Measn = 0;
48struct tp_Meas tp_Meas[TPMEASN];
49
50/*
51 * NAME: tpmeas()
52 *
53 * CALLED FROM: tp_emit(), tp_soisdisconecting(), tp_soisdisconnected()
54 * tp0_stash(), tp_stash(), tp_send(), tp_goodack(), tp_usrreq()
55 *
56 * FUNCTION and ARGUMENTS:
57 * stashes a performance-measurement event for the given reference (ref)
58 * (kind) tells which kind of event, timev is the time to be stored
59 * with this event, (seq), (win), and (size) are integers that usually
60 * refer to the sequence number, window number (on send) and
61 * size of tpdu or window.
62 *
63 * RETURNS: Nada
64 *
65 * SIDE EFFECTS:
66 *
67 * NOTES:
68 */
69void
a50e2bc0 70Tpmeas(ref, kind, timev, seq, win, size)
b08d03f0
KS
71 u_int ref;
72 u_int kind;
73 struct timeval *timev;
74 u_int seq, win, size;
75{
76 register struct tp_Meas *tpm;
77 static int mseq;
78
79 tpm = &tp_Meas[tp_Measn++];
80 tp_Measn %= TPMEASN;
81
82 tpm->tpm_kind = kind;
83 tpm->tpm_tseq = mseq++;
84 tpm->tpm_ref = ref;
85 if(kind == TPtime_from_ll)
86 bcopy((caddr_t)timev, (caddr_t)&tpm->tpm_time, sizeof(struct timeval));
87 else
88 bcopy( (caddr_t)&time,
89 (caddr_t)&tpm->tpm_time, sizeof(struct timeval) );
90 tpm->tpm_seq = seq;
91 tpm->tpm_window = win;
92 tpm->tpm_size = size;
93}
94
95#endif TP_PERF_MEAS