registry: swap out the DTRACE XErrorDB stuff for the new registry call.

This commit is contained in:
Eamon Walsh 2007-11-26 15:59:44 -05:00 committed by Eamon Walsh
parent 54cb729ecc
commit 996b621bec
4 changed files with 2 additions and 97 deletions

View File

@ -90,13 +90,6 @@ if test "x$WDTRACE" != "xno" ; then
fi
AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
# DTrace support uses XErrorDB to get request names
AC_ARG_WITH(xerrordb,
AS_HELP_STRING([--with-xerrordb=PATH], [Path to XErrorDB file (default: ${datadir}/X11/XErrorDB)]),
[ XERRORDB_PATH="$withval" ],
[ XERRORDB_PATH="${datadir}/X11/XErrorDB" ])
AC_DEFINE_DIR(XERRORDB_PATH, XERRORDB_PATH, [Path to XErrorDB file])
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])

View File

@ -148,14 +148,7 @@ int ProcInitialConnection();
#endif
#ifdef XSERVER_DTRACE
#include <sys/types.h>
typedef const char *string;
#include "Xserver-dtrace.h"
char *RequestNames[256];
static void LoadRequestNames(void);
static void FreeRequestNames(void);
#define GetRequestName(i) (RequestNames[i])
#endif
#define mskcnt ((MAXCLIENTS + 31) / 32)
@ -383,10 +376,6 @@ Dispatch(void)
if (!clientReady)
return;
#ifdef XSERVER_DTRACE
LoadRequestNames();
#endif
while (!dispatchException)
{
if (*icheck[0] != *icheck[1])
@ -464,7 +453,7 @@ Dispatch(void)
client->requestLogIndex++;
#endif
#ifdef XSERVER_DTRACE
XSERVER_REQUEST_START(GetRequestName(MAJOROP), MAJOROP,
XSERVER_REQUEST_START(LookupMajorName(MAJOROP), MAJOROP,
((xReq *)client->requestBuffer)->length,
client->index, client->requestBuffer);
#endif
@ -476,7 +465,7 @@ Dispatch(void)
XaceHookAuditEnd(client, result);
}
#ifdef XSERVER_DTRACE
XSERVER_REQUEST_DONE(GetRequestName(MAJOROP), MAJOROP,
XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
client->sequence, client->index, result);
#endif
@ -510,9 +499,6 @@ Dispatch(void)
KillAllClients();
xfree(clientReady);
dispatchException &= ~DE_RESET;
#ifdef XSERVER_DTRACE
FreeRequestNames();
#endif
}
#undef MAJOROP
@ -4045,60 +4031,3 @@ MarkClientException(ClientPtr client)
{
client->noClientException = -1;
}
#ifdef XSERVER_DTRACE
#include <ctype.h>
/* Load table of request names for dtrace probes */
static void LoadRequestNames(void)
{
int i;
FILE *xedb;
extern void LoadExtensionNames(char **RequestNames);
bzero(RequestNames, 256 * sizeof(char *));
xedb = fopen(XERRORDB_PATH, "r");
if (xedb != NULL) {
char buf[256];
while (fgets(buf, sizeof(buf), xedb)) {
if ((strncmp("XRequest.", buf, 9) == 0) && (isdigit(buf[9]))) {
char *name;
i = strtol(buf + 9, &name, 10);
if (RequestNames[i] == 0) {
char *end = strchr(name, '\n');
if (end) { *end = '\0'; }
RequestNames[i] = strdup(name + 1);
}
}
}
fclose(xedb);
}
LoadExtensionNames(RequestNames);
for (i = 0; i < 256; i++) {
if (RequestNames[i] == 0) {
#define RN_SIZE 12 /* "Request#' + up to 3 digits + \0 */
RequestNames[i] = xalloc(RN_SIZE);
if (RequestNames[i]) {
snprintf(RequestNames[i], RN_SIZE, "Request#%d", i);
}
}
/* fprintf(stderr, "%d: %s\n", i, RequestNames[i]); */
}
}
static void FreeRequestNames(void)
{
int i;
for (i = 0; i < 256; i++) {
if (RequestNames[i] != 0) {
free(RequestNames[i]);
RequestNames[i] = 0;
}
}
}
#endif

View File

@ -354,17 +354,3 @@ ProcListExtensions(ClientPtr client)
}
return(client->noClientException);
}
#ifdef XSERVER_DTRACE
void LoadExtensionNames(char **RequestNames) {
int i;
for (i=0; i<NumExtensions; i++) {
int r = extensions[i]->base;
if (RequestNames[r] == NULL) {
RequestNames[r] = strdup(extensions[i]->name);
}
}
}
#endif

View File

@ -500,9 +500,6 @@
/* Define to 1 if the DTrace Xserver provider probes should be built in */
#undef XSERVER_DTRACE
/* Path to XErrorDB file */
#undef XERRORDB_PATH
/* Define to 16-bit byteswap macro */
#undef bswap_16