/*
* 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
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
+#include <roken.h>
-#ifdef RXDEBUG
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#include <io.h>
-#else
-#include <sys/file.h>
-#include <unistd.h>
+#ifndef RXDEBUG
+char rxi_tracename[80] = "\0Tracing not compiled in";
+#ifdef DUMPTRACE
+int
+main(int argc, char **argv)
+{
+ return 0;
+}
#endif
+#else
+
#include "rx.h"
+#include "rx_atomic.h"
#include "rx_globals.h"
+#include "rx_internal.h"
#include "rx_trace.h"
+#include "rx_conn.h"
+#include "rx_call.h"
+
#ifdef RXTRACEON
char rxi_tracename[80] = "/tmp/rxcalltrace";
#else
};
void
-rxi_flushtrace()
+rxi_flushtrace(void)
{
- if (rxi_logfd >= 0)
- write(rxi_logfd, rxi_tracebuf, rxi_tracepos);
+ afs_uint32 len = rxi_tracepos;
+
rxi_tracepos = 0;
+ if (rxi_logfd < 0)
+ return;
+ if (write(rxi_logfd, rxi_tracebuf, len) < 0) {
+ /* don't care */
+ }
}
void
-rxi_calltrace(event, call)
- unsigned int event;
- struct rx_call *call;
+rxi_calltrace(unsigned int event, struct rx_call *call)
{
struct clock now;
struct rx_trace rxtinfo;
rxtinfo.now = now.sec * 1000 + now.usec / 1000;
rxtinfo.cid = call->conn->cid;
rxtinfo.call = *(call->callNumber);
- rxtinfo.qlen = rx_nWaiting;
+ rxtinfo.qlen = rx_atomic_read(&rx_nWaiting);
rxtinfo.servicetime = 0;
rxtinfo.waittime = 0;
case RX_CALL_ARRIVAL:
call->traceWait = now;
+ break;
+
default:
break;
}
}
#ifdef DUMPTRACE
-#include <errno.h>
#ifdef AFS_NT40_ENV
#include <afs/afsutil.h>
#endif
int
-main(argc, argv)
- char **argv;
+main(int argc, char **argv)
{
struct rx_trace ip;
int err = 0;
printf(" %3u %7u %7u %x.%x\n", ip.qlen, ip.servicetime,
ip.waittime, ip.cid, ip.call);
}
+ return 0;
}
#endif /* DUMPTRACE */
-
-#endif
+#endif /* RXDEBUG */