diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-11-26 15:59:44 -0500 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-11-26 15:59:44 -0500 |
commit | 996b621bec1bbc4fb21970c75eaec62053bc6ccb (patch) | |
tree | 47a6429b7fe56f40aa42770e745710c2ac69cdeb | |
parent | 54cb729ecc2d366c1af836cb3d2ffc8e864e9b79 (diff) |
registry: swap out the DTRACE XErrorDB stuff for the new registry call.
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | dix/dispatch.c | 75 | ||||
-rw-r--r-- | dix/extension.c | 14 | ||||
-rw-r--r-- | include/dix-config.h.in | 3 |
4 files changed, 2 insertions, 97 deletions
diff --git a/configure.ac b/configure.ac index d78bc1c33..042cfdd4e 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/dix/dispatch.c b/dix/dispatch.c index dcd4b530f..919bcda50 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -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 diff --git a/dix/extension.c b/dix/extension.c index 42fdc125f..9740c1b50 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -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 diff --git a/include/dix-config.h.in b/include/dix-config.h.in index c4429628e..2af994f4f 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -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 |