/usr/src/openafs-1.6.1/include/des/stats.h is in openafs-modules-dkms 1.6.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | /*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
/* Some Cheap statistics which should be shared with the rxkad definitions, but
* aren't. The layout should match the layout in rxkad/rxkad.p.h. */
#ifndef OPENAFS_DES_STATS_H
#define OPENAFS_DES_STATS_H
/* this is an optimization for pthreads environments. Instead of having global
rxkad statistics, make them thread-specific, and only perform aggregation on
the stats structures when necessary. Furthermore, don't do any locking, and
live with the nearly accurate aggregation (e.g. you might miss a few increments,
but the resulting aggregation should be almost correct). */
#ifdef AFS_PTHREAD_ENV
typedef struct rxkad_stats_t {
#else
struct rxkad_stats {
#endif
afs_uint32 connections[3]; /* client side only */
afs_uint32 destroyObject; /* client security objects */
afs_uint32 destroyClient; /* client connections */
afs_uint32 destroyUnused; /* unused server conn */
afs_uint32 destroyUnauth; /* unauthenticated server conn */
afs_uint32 destroyConn[3]; /* server conn per level */
afs_uint32 expired; /* server packets rejected */
afs_uint32 challengesSent; /* server challenges sent */
afs_uint32 challenges[3]; /* challenges seen by client */
afs_uint32 responses[3]; /* responses seen by server */
afs_uint32 preparePackets[6];
afs_uint32 checkPackets[6];
afs_uint32 bytesEncrypted[2]; /* index just by type */
afs_uint32 bytesDecrypted[2];
afs_uint32 fc_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
afs_uint32 fc_key_scheds; /* key schedule creations */
afs_uint32 des_encrypts[2]; /* DECRYPT==0, ENCRYPT==1 */
afs_uint32 des_key_scheds; /* key schedule creations */
afs_uint32 des_randoms; /* random blocks generated */
afs_uint32 clientObjects;
afs_uint32 serverObjects;
long spares[8];
#ifdef AFS_PTHREAD_ENV
struct rxkad_stats_t * next;
struct rxkad_stats_t * prev;
} rxkad_stats_t; /* put these here for convenience */
#else /* AFS_PTHREAD_ENV */
};
#ifdef AFS_NT40_ENV
struct rxkad_stats rxkad_stats; /* put this here for convenience */
#endif
#endif /* AFS_PTHREAD_ENV */
#ifdef AFS_PTHREAD_ENV
struct rxkad_global_stats {
rxkad_stats_t * first;
rxkad_stats_t * last;
};
#include <pthread.h>
extern pthread_mutex_t rxkad_global_stats_lock;
extern pthread_key_t rxkad_stats_key;
extern void rxkad_global_stats_init(void);
extern rxkad_stats_t * rxkad_thr_stats_init(void);
extern int rxkad_stats_agg(rxkad_stats_t *);
#ifndef BEGIN
#define BEGIN do {
#define END } while(0)
#endif
#define RXKAD_GLOBAL_STATS_LOCK osi_Assert(pthread_mutex_lock(&rxkad_global_stats_lock)==0)
#define RXKAD_GLOBAL_STATS_UNLOCK osi_Assert(pthread_mutex_unlock(&rxkad_global_stats_lock)==0)
#define GET_RXKAD_STATS(stats) rxkad_stats_agg(stats)
#define GET_RXKAD_THR_STATS(rxkad_stats) \
BEGIN \
(rxkad_stats) = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
if ((rxkad_stats) == NULL) { \
osi_Assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
} \
END
#define INC_RXKAD_STATS(stats_elem) \
BEGIN \
rxkad_stats_t * rxkad_stats; \
rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
if (rxkad_stats == NULL) { \
osi_Assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
} \
rxkad_stats->stats_elem++; \
END
#define DEC_RXKAD_STATS(stats_elem) \
BEGIN \
rxkad_stats_t * rxkad_stats; \
rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
if (rxkad_stats == NULL) { \
osi_Assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
} \
rxkad_stats->stats_elem--; \
END
#ifndef AFS_OBSD38_ENV
#define ADD_RXKAD_STATS(stats_elem, inc_value) \
BEGIN \
rxkad_stats_t * rxkad_stats; \
rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
if (rxkad_stats == NULL) { \
osi_Assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
} \
rxkad_stats->stats_elem += inc_value; \
END
#define SUB_RXKAD_STATS(stats_elem, dec_value) \
BEGIN \
rxkad_stats_t * rxkad_stats; \
rxkad_stats = ((rxkad_stats_t*)pthread_getspecific(rxkad_stats_key)); \
if (rxkad_stats == NULL) { \
osi_Assert(((rxkad_stats) = rxkad_thr_stats_init()) != NULL); \
} \
rxkad_stats->stats_elem -= dec_value; \
END
#else /* AFS_OBSD38_ENV */
/* segfaults but we don't know why */
#define ADD_RXKAD_STATS(stats_elem, inc_value)
#define SUB_RXKAD_STATS(stats_elem, dec_value)
#endif /* AFS_OBSD38_ENV */
#else /* AFS_PTHREAD_ENV */
#define INC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem++
#define DEC_RXKAD_STATS(stats_elem) rxkad_stats.stats_elem--
#define ADD_RXKAD_STATS(stats_elem, inc_value) rxkad_stats.stats_elem += (inc_value)
#define SUB_RXKAD_STATS(stats_elem, dec_value) rxkad_stats.stats_elem -= (dec_value)
#define GET_RXKAD_STATS(stats) memcpy((stats), &rxkad_stats, sizeof(rxkad_stats))
#endif /* AFS_PTHREAD_ENV */
#if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
#ifndef RXKAD_STATS_DECLSPEC
#define RXKAD_STATS_DECLSPEC __declspec(dllimport) extern
#endif
#else
#define RXKAD_STATS_DECLSPEC extern
#endif
#ifdef AFS_PTHREAD_ENV
RXKAD_STATS_DECLSPEC struct rxkad_global_stats rxkad_global_stats;
#else /* AFS_PTHREAD_ENV */
RXKAD_STATS_DECLSPEC struct rxkad_stats rxkad_stats;
#endif
#endif /* OPENAFS_DES_STATS_H */
|