registry: swap out the DTRACE XErrorDB stuff for the new registry call.
This commit is contained in:
parent
54cb729ecc
commit
996b621bec
|
@ -90,13 +90,6 @@ if test "x$WDTRACE" != "xno" ; then
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
|
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_DIRENT
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
|
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
|
||||||
|
|
|
@ -148,14 +148,7 @@ int ProcInitialConnection();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XSERVER_DTRACE
|
#ifdef XSERVER_DTRACE
|
||||||
#include <sys/types.h>
|
|
||||||
typedef const char *string;
|
|
||||||
#include "Xserver-dtrace.h"
|
#include "Xserver-dtrace.h"
|
||||||
|
|
||||||
char *RequestNames[256];
|
|
||||||
static void LoadRequestNames(void);
|
|
||||||
static void FreeRequestNames(void);
|
|
||||||
#define GetRequestName(i) (RequestNames[i])
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define mskcnt ((MAXCLIENTS + 31) / 32)
|
#define mskcnt ((MAXCLIENTS + 31) / 32)
|
||||||
|
@ -383,10 +376,6 @@ Dispatch(void)
|
||||||
if (!clientReady)
|
if (!clientReady)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef XSERVER_DTRACE
|
|
||||||
LoadRequestNames();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (!dispatchException)
|
while (!dispatchException)
|
||||||
{
|
{
|
||||||
if (*icheck[0] != *icheck[1])
|
if (*icheck[0] != *icheck[1])
|
||||||
|
@ -464,7 +453,7 @@ Dispatch(void)
|
||||||
client->requestLogIndex++;
|
client->requestLogIndex++;
|
||||||
#endif
|
#endif
|
||||||
#ifdef XSERVER_DTRACE
|
#ifdef XSERVER_DTRACE
|
||||||
XSERVER_REQUEST_START(GetRequestName(MAJOROP), MAJOROP,
|
XSERVER_REQUEST_START(LookupMajorName(MAJOROP), MAJOROP,
|
||||||
((xReq *)client->requestBuffer)->length,
|
((xReq *)client->requestBuffer)->length,
|
||||||
client->index, client->requestBuffer);
|
client->index, client->requestBuffer);
|
||||||
#endif
|
#endif
|
||||||
|
@ -476,7 +465,7 @@ Dispatch(void)
|
||||||
XaceHookAuditEnd(client, result);
|
XaceHookAuditEnd(client, result);
|
||||||
}
|
}
|
||||||
#ifdef XSERVER_DTRACE
|
#ifdef XSERVER_DTRACE
|
||||||
XSERVER_REQUEST_DONE(GetRequestName(MAJOROP), MAJOROP,
|
XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
|
||||||
client->sequence, client->index, result);
|
client->sequence, client->index, result);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -510,9 +499,6 @@ Dispatch(void)
|
||||||
KillAllClients();
|
KillAllClients();
|
||||||
xfree(clientReady);
|
xfree(clientReady);
|
||||||
dispatchException &= ~DE_RESET;
|
dispatchException &= ~DE_RESET;
|
||||||
#ifdef XSERVER_DTRACE
|
|
||||||
FreeRequestNames();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef MAJOROP
|
#undef MAJOROP
|
||||||
|
@ -4045,60 +4031,3 @@ MarkClientException(ClientPtr client)
|
||||||
{
|
{
|
||||||
client->noClientException = -1;
|
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
|
|
||||||
|
|
|
@ -354,17 +354,3 @@ ProcListExtensions(ClientPtr client)
|
||||||
}
|
}
|
||||||
return(client->noClientException);
|
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
|
|
||||||
|
|
|
@ -500,9 +500,6 @@
|
||||||
/* Define to 1 if the DTrace Xserver provider probes should be built in */
|
/* Define to 1 if the DTrace Xserver provider probes should be built in */
|
||||||
#undef XSERVER_DTRACE
|
#undef XSERVER_DTRACE
|
||||||
|
|
||||||
/* Path to XErrorDB file */
|
|
||||||
#undef XERRORDB_PATH
|
|
||||||
|
|
||||||
/* Define to 16-bit byteswap macro */
|
/* Define to 16-bit byteswap macro */
|
||||||
#undef bswap_16
|
#undef bswap_16
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue