char command_name[PATH_MAX+1];
char path_name[PATH_MAX+1];
Bool isRule;
- Bool detail;
+ int detail_level;
} EvlogOption;
printf(" ------------------------\n");
printf(" * It is possible to write multiple policies.\n");
printf("\n");
- printf(" -a [Add Rule] Setting Rule of 'Add' policy to find information you want\n");
+ printf(" -a [ALLOW Rule] Setting Rule of 'ALLOW' policy to find information you want\n");
printf("\n");
printf(" -n [Deny Rule] Setting Rule of 'Deny' policy to find information you want\n");
printf("\n");
printf("\n");
printf(" * WARNING : If you set both -a and -n option, must set -a option first. Otherwise Logs you DO NOT want can be printed.\n");
printf("\n");
- printf(" -d [OFF:0/ON:1] To Print detail log of extensions\n");
+ printf(" -d [0-2] To Set printing detail log level\n");
+ printf("\n");
+ printf(" 0: To Print Primary Logs (XID, Root, Atom, Region ...)\n");
+ printf(" 1: To Print More Detail Logs (Time, State, Mask ...\n");
+ printf(" 2: To Print Supplementary Reply Logs (Information Including Each Item)\n");
printf("\n");
printf(" -h Usage of xevlog_anlayze\n");
printf("\n");
if (xDbgEvlogRuleValidate (&evinfo))
{
- xDbgEvlogFillLog(&evinfo, eo->detail, log, &size);
- printf ("%s", log);
+ if (xDbgEvlogFillLog(&evinfo, eo->detail_level, log, &size))
+ printf ("%s", log);
}
if (evinfo.req.ptr)
eo.pid = atoi (argv[0]);
eo.isRule = FALSE;
- eo.detail = TRUE;
+ eo.detail_level = 0;
strncpy(eo.command_name, argv[1], PATH_MAX);
if (argc < 3)
if(opt_str_len > 0)
{
- eo.detail = (atoi(optarg))?TRUE:FALSE;
- printf ("detail %s\n", (eo.detail)?"ON":"OFF");
+ eo.detail_level = (atoi(optarg));
+ printf ("Detail Level: %d\n", eo.detail_level);
}
break;
}
POLICY_TYPE policy_type;
RC_RESULT_TYPE result;
const char * policy = argv[1];
- char rule[8192];
- int i;
+ char merge[8192], rule[8192]={0,};
+ int i, index = 0;
+ int apply = 0;
if (argc < 3)
{
return FALSE;
}
- _mergeArgs (rule, argc - 2, &(argv[2]));
+ _mergeArgs (merge, argc - 2, &(argv[2]));
- for (i = 0 ; i < strlen(rule) ; i++)
+ for (i = 0 ; i < strlen(merge) ; i++)
{
- static int apply = 0;
- if(rule[i] == '\"' || rule[i] == '\'')
- rule[i] = ' ';
- if(rule[i] == '+')
+ if(merge[i] == '\"' || merge[i] == '\'')
+ {
+ rule[index++] = ' ';
+ continue;
+ }
+
+ if(merge[i] == '+')
{
- rule[i] = ' ';
+ rule[index++] = ' ';
+
if (apply == 0)
- strcat(rule, "|| type=reply || type=error");
- apply = 1;
+ {
+ const char* plus = "|| type=reply || type=error";
+
+ strcat(rule, plus);
+ index += strlen(plus);
+
+ apply = 1;
+ }
+ continue;
}
+ rule[index++] = merge[i];
}
result = rulechecker_add_rule (rc, policy_type, rule);
}
-void
-xDbgEvlogFillLog (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+Bool
+xDbgEvlogFillLog (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
static CARD32 prev;
- RETURN_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_dir) / sizeof (char*)));
- RETURN_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_type) / sizeof (char*)));
+ RETURN_VAL_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_dir) / sizeof (char*)), FALSE);
+ RETURN_VAL_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_type) / sizeof (char*)), FALSE);
if (evinfo->type == REPLY && !evinfo->rep.isStart)
{
- if (on) // detail option is on
+ if (detail_level >= EVLOG_PRINT_REPLY_DETAIL)
REPLY ("%67s"," ");
else
- return;
+ return FALSE;
}
else
REPLY ("[%10.3f][%5ld] %22s(%2d:%5d) %s %7s ",
if (evinfo->type == REQUEST)
{
REPLY ("(");
- reply = xDbgEvlogReqeust (evinfo, on, reply, len);
+ reply = xDbgEvlogReqeust (evinfo, detail_level, reply, len);
REPLY (")");
}
else if (evinfo->type == EVENT)
{
evinfo->evt.size = sizeof (xEvent);
REPLY ("(");
- reply = xDbgEvlogEvent (evinfo, on, reply, len);
+ reply = xDbgEvlogEvent (evinfo, detail_level, reply, len);
REPLY (")");
}
else if (evinfo->type == REPLY)
{
REPLY ("(");
- reply = xDbgEvlogReply (evinfo, on, reply, len);
+ reply = xDbgEvlogReply (evinfo, detail_level, reply, len);
REPLY (")");
}
else if (evinfo->type == ERROR)
REPLY ("\n");
prev = evinfo->time;
+
+ return TRUE;
}
Bool xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len);
Bool xDbgEvlogRuleValidate (EvlogInfo *evinfo);
Bool xDbgEvlogGetExtensionEntry ();
-void xDbgEvlogFillLog (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+Bool xDbgEvlogFillLog (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
void xDbgDistroyAtomList (EvlogInfo *evinfo);
void xDbgDistroyRegionList (EvlogInfo *evinfo);
#include "xdbg_evlog.h"
static char *
-_EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestComposite(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
case X_CompositeRedirectWindow:
{
xCompositeRedirectWindowReq *stuff = (xCompositeRedirectWindowReq *)req;
- REPLY (": XID(0x%lx) Update(%d)",
- stuff->window,
- stuff->update);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" update(%d)",
+ stuff->update);
+ }
return reply;
}
case X_CompositeRedirectSubwindows:
{
xCompositeRedirectSubwindowsReq *stuff = (xCompositeRedirectSubwindowsReq *)req;
- REPLY (": XID(0x%lx) Update(%d)",
- stuff->window,
- stuff->update);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" update(%d)",
+ stuff->update);
+ }
return reply;
}
case X_CompositeUnredirectWindow:
{
xCompositeUnredirectWindowReq *stuff = (xCompositeUnredirectWindowReq *)req;
- REPLY (": XID(0x%lx) Update(%d)",
- stuff->window,
- stuff->update);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" update(%d)",
+ stuff->update);
+ }
return reply;
}
case X_CompositeUnredirectSubwindows:
{
xCompositeUnredirectSubwindowsReq *stuff = (xCompositeUnredirectSubwindowsReq *)req;
- REPLY (": XID(0x%lx) Update(%d)",
- stuff->window,
- stuff->update);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" update(%d)",
+ stuff->update);
+ }
return reply;
}
}
static char *
-_EvlogEventComposite (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventComposite (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
}
static char *
-_EvlogReplyComposite (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyComposite (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
#if 0
xGenericReply *rep = evinfo->rep.ptr;
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <windowstr.h>
+#include <X11/Xproto.h>
#include <X11/extensions/XI2proto.h>
#include "xdbg_types.h"
#include "xdbg_evlog_core.h"
#include "xdbg_evlog.h"
-char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
+
+static char*
+_getWindowAttributeMask (CARD32 mask, char *reply, int *len)
+{
+ int i;
+ int init = 0;
+
+ for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+ {
+ if(mask & (1 << i))
+ {
+ if (init)
+ REPLY(" ");
+ else
+ init = 1;
+
+ switch (1 << i)
+ {
+ case CWBackPixmap: REPLY("CWBackPixmap"); break;
+ case CWBackPixel: REPLY("CWBackPixel"); break;
+ case CWBorderPixmap: REPLY("CWBorderPixmap"); break;
+ case CWBorderPixel: REPLY("CWBorderPixel"); break;
+ case CWBitGravity: REPLY("CWBitGravity"); break;
+ case CWWinGravity: REPLY("CWWinGravity"); break;
+ case CWBackingStore: REPLY("CWBackingStore"); break;
+ case CWBackingPlanes: REPLY("CWBackingPlanes"); break;
+ case CWBackingPixel: REPLY("CWBackingPixel"); break;
+ case CWOverrideRedirect: REPLY("CWOverrideRedirect"); break;
+ case CWSaveUnder: REPLY("CWSaveUnder"); break;
+ case CWEventMask: REPLY("CWEventMask"); break;
+ case CWDontPropagate: REPLY("CWDontPropagate"); break;
+ case CWColormap: REPLY("CWColormap"); break;
+ case CWCursor: REPLY("CWCursor"); break;
+ }
+ }
+ }
+
+ return reply;
+}
+
+static char*
+_getConfigureWindowMask (CARD16 mask, char *reply, int *len)
+{
+ int i;
+ int init = 0;
+
+ for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+ {
+ if(mask & (1 << i))
+ {
+ if (init)
+ REPLY(" ");
+ else
+ init = 1;
+
+ switch (1 << i)
+ {
+ case CWX: REPLY("CWX"); break;
+ case CWY: REPLY("CWY"); break;
+ case CWWidth: REPLY("CWWidth"); break;
+ case CWHeight: REPLY("CWHeight"); break;
+ case CWBorderWidth: REPLY("CWBorderWidth"); break;
+ case CWSibling: REPLY("CWSibling"); break;
+ case CWStackMode: REPLY("CWStackMode"); break;
+ }
+ }
+ }
+
+ return reply;
+}
+
+static char*
+_getKeyMask (CARD16 mask, char *reply, int *len)
+{
+ int i;
+ int init = 0;
+
+ for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+ {
+ if(mask & (1 << i))
+ {
+ if (init)
+ REPLY(" ");
+ else
+ init = 1;
+
+ switch (1 << i)
+ {
+ case ShiftMask: REPLY("ShiftMask"); break;
+ case LockMask: REPLY("LockMask"); break;
+ case ControlMask: REPLY("ControlMask"); break;
+ case Mod1Mask: REPLY("Mod1Mask"); break;
+ case Mod2Mask: REPLY("Mod2Mask"); break;
+ case Mod3Mask: REPLY("Mod3Mask"); break;
+ case Mod4Mask: REPLY("Mod4Mask"); break;
+ case Mod5Mask: REPLY("Mod5Mask"); break;
+ case Button1Mask: REPLY("Button1Mask"); break;
+ case Button2Mask: REPLY("Button2Mask"); break;
+ case Button3Mask: REPLY("Button3Mask"); break;
+ case Button4Mask: REPLY("Button4Mask"); break;
+ case Button5Mask: REPLY("Button5Mask"); break;
+ case AnyModifier: REPLY("AnyModifier"); break;
+ }
+ }
+ }
+
+ return reply;
+}
+
+static char*
+_getEventMask (CARD32 mask, char *reply, int *len)
+{
+ int i;
+ int init = 0;
+
+ for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+ {
+ if(mask & (1 << i))
+ {
+ if (init)
+ REPLY(" ");
+ else
+ init = 1;
+
+ switch (1 << i)
+ {
+ case NoEventMask: REPLY("NoEventMask"); break;
+ case KeyPressMask: REPLY("KeyPressMask"); break;
+ case KeyReleaseMask: REPLY("KeyReleaseMask"); break;
+ case ButtonPressMask: REPLY("ButtonPressMask"); break;
+ case ButtonReleaseMask: REPLY("ButtonReleaseMask"); break;
+ case EnterWindowMask: REPLY("EnterWindowMask"); break;
+ case LeaveWindowMask: REPLY("LeaveWindowMask"); break;
+ case PointerMotionMask: REPLY("PointerMotionMask"); break;
+ case PointerMotionHintMask: REPLY("PointerMotionHintMask"); break;
+ case Button1MotionMask: REPLY("Button1MotionMask"); break;
+ case Button2MotionMask: REPLY("Button2MotionMask"); break;
+ case Button3MotionMask: REPLY("Button3MotionMask"); break;
+ case Button4MotionMask: REPLY("Button4MotionMask"); break;
+ case Button5MotionMask: REPLY("Button5MotionMask"); break;
+ case ButtonMotionMask: REPLY("ButtonMotionMask"); break;
+ case KeymapStateMask: REPLY("KeymapStateMask"); break;
+ case ExposureMask: REPLY("ExposureMask"); break;
+ case VisibilityChangeMask: REPLY("VisibilityChangeMask"); break;
+ case StructureNotifyMask: REPLY("StructureNotifyMask"); break;
+ case ResizeRedirectMask: REPLY("ResizeRedirectMask"); break;
+ case SubstructureNotifyMask: REPLY("SubstructureNotifyMask"); break;
+ case SubstructureRedirectMask: REPLY("SubstructureRedirectMask"); break;
+ case FocusChangeMask: REPLY("FocusChangeMask"); break;
+ case PropertyChangeMask: REPLY("PropertyChangeMask"); break;
+ case ColormapChangeMask: REPLY("ColormapChangeMask"); break;
+ case OwnerGrabButtonMask: REPLY("OwnerGrabButtonMask"); break;
+ }
+ }
+ }
+
+ return reply;
+}
+
+char * xDbgEvlogRequestCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
stuff->x,
stuff->y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *visual, *class;
+ char dvisual[10], dclass[10];
+
+ switch (stuff->visual)
+ {
+ case CopyFromParent: visual = "CopyFromParent"; break;
+ default: visual = dvisual; sprintf (dvisual, "0x%lx", stuff->visual); break;
+ }
+
+ switch (stuff->class)
+ {
+ case CopyFromParent: class = "CopyFromParent"; break;
+ case InputOutput: class = "InputOutput"; break;
+ case InputOnly: class = "InputOnly"; break;
+ default: class = dclass; sprintf (dclass, "0x%x", stuff->class); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s depth(%d) visual_ID(%s) class(%s)\n",
+ " ",
+ stuff->depth,
+ visual,
+ class);
+
+ \r REPLY ("%67s mask", " ");
+ \r REPLY ("(");
+ reply = _getWindowAttributeMask(stuff->mask, reply, len);
+ \r REPLY (")");
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ \r REPLY (" value_mask");
+ \r REPLY ("(");
+ reply = _getWindowAttributeMask(stuff->valueMask, reply, len);
+ \r REPLY (")");
+ }
+
return reply;
}
case X_ChangeSaveSet:
{
xChangeSaveSetReq *stuff = (xChangeSaveSetReq *)req;
+
REPLY (": XID(0x%lx)",
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *mode;
+ char dmode[10];
+
+ switch (stuff->mode)
+ {
+ case SetModeInsert: mode = "SetModeInsert"; break;
+ case SetModeDelete: mode = "SetModeDelete"; break;
+ default: mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+ }
+
+ REPLY (" mode(%s)",
+ mode);
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" mask");
+ REPLY ("(");
+ reply = _getConfigureWindowMask(stuff->mask, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
case X_CirculateWindow:
{
xCirculateWindowReq *stuff = (xCirculateWindowReq *)req;
+
REPLY (": XID(0x%lx)",
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *direction;
+ char ddirection[10];
+
+ switch (stuff->direction)
+ {
+ case RaiseLowest: direction = "RaiseLowest"; break;
+ case LowerHighest: direction = "LowerHighest"; break;
+ default: direction = ddirection; sprintf (ddirection, "%d", stuff->direction); break;
+ }
+
+ REPLY (" direction(%s)",
+ direction);
+ }
+
return reply;
}
case X_ChangeProperty:
{
xChangePropertyReq *stuff = (xChangePropertyReq *)req;
+
REPLY (": XID(0x%lx)",
stuff->window);
REPLY (" Type");
reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *mode;
+ char dmode[10];
+
+ switch (stuff->mode)
+ {
+ case PropModeReplace: mode = "PropModeReplace"; break;
+ case PropModePrepend: mode = "PropModePrepend"; break;
+ case PropModeAppend: mode = "PropModeAppend"; break;
+ default: mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s mode(%s) format(%d) nUnits(%ld)",
+ " ",
+ mode,
+ stuff->format,
+ stuff->nUnits);
+ }
+
return reply;
}
REPLY (" Type");
reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s delete(%s) longOffset(%ld) longLength(%ld)",
+ " ",
+ stuff->delete ? "YES" : "NO",
+ stuff->longOffset,
+ stuff->longLength);
+ }
+
return reply;
}
REPLY (" Selection");
reply = xDbgGetAtom(stuff->selection, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ stuff->time);
+ }
+
return reply;
}
REPLY (" Property");
reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ stuff->time);
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->destination);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" propagate(%s)",
+ stuff->propagate ? "YES" : "NO");
+
+ REPLY (" event_mask");
+ REPLY ("(");
+ reply = _getEventMask(stuff->eventMask, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
case X_GrabPointer:
{
xGrabPointerReq *stuff = (xGrabPointerReq *)req;
+
REPLY (": XID(0x%lx) ConfineTo(0x%lx) Cursor(0x%lx)",
stuff->grabWindow,
stuff->confineTo,
stuff->cursor);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *pointer_mode, *keyboard_mode;
+ char dpointer_mode[10], dkeyboard_mode[10];
+
+ switch (stuff->pointerMode)
+ {
+ case GrabModeSync: pointer_mode = "GrabModeSync"; break;
+ case GrabModeAsync: pointer_mode = "GrabModeAsync"; break;
+ default: pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+ }
+
+ switch (stuff->keyboardMode)
+ {
+ case GrabModeSync: keyboard_mode = "GrabModeSync"; break;
+ case GrabModeAsync: keyboard_mode = "GrabModeAsync"; break;
+ default: keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+ }
+
+ REPLY (" pointer_mode(%s) keyboard_mode(%s) time(%lums)\n",
+ pointer_mode,
+ keyboard_mode,
+ stuff->time);
+
+ REPLY (" event_mask");
+ REPLY ("(");
+ reply = _getEventMask(stuff->eventMask, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
case X_GrabButton:
{
xGrabButtonReq *stuff = (xGrabButtonReq *)req;
+
REPLY (": XID(0x%lx) ConfineTo(0x%lx) Cursor(0x%lx)",
stuff->grabWindow,
stuff->confineTo,
stuff->cursor);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *pointer_mode, *keyboard_mode, *button;
+ char dpointer_mode[10], dkeyboard_mode[10], dbutton[10];
+
+ switch (stuff->pointerMode)
+ {
+ case GrabModeSync: pointer_mode = "GrabModeSync"; break;
+ case GrabModeAsync: pointer_mode = "GrabModeAsync"; break;
+ default: pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+ }
+
+ switch (stuff->keyboardMode)
+ {
+ case GrabModeSync: keyboard_mode = "GrabModeSync"; break;
+ case GrabModeAsync: keyboard_mode = "GrabModeAsync"; break;
+ default: keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+ }
+
+ switch (stuff->button)
+ {
+ case Button1: button = "Button1"; break;
+ case Button2: button = "Button2"; break;
+ case Button3: button = "Button3"; break;
+ case Button4: button = "Button4"; break;
+ case Button5: button = "Button5"; break;
+ default: button = dbutton; sprintf (dbutton, "%d", stuff->button); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s event_mask(0x%x) pointer_mode(%s) keyboard_mode(%s) button(%s)",
+ " ",
+ stuff->eventMask,
+ pointer_mode,
+ keyboard_mode,
+ button);
+
+ REPLY (" modifiers");
+ REPLY ("(");
+ reply = _getKeyMask(stuff->modifiers, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->grabWindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" modifiers");
+ REPLY ("(");
+ reply = _getKeyMask(stuff->modifiers, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
REPLY (": Cursor(0x%lx)",
stuff->cursor);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ stuff->time);
+
+ REPLY (" event_mask");
+ REPLY ("(");
+ reply = _getEventMask(stuff->eventMask, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
case X_GrabKeyboard:
{
xGrabKeyboardReq *stuff = (xGrabKeyboardReq *)req;
+
REPLY (": XID(0x%lx)",
stuff->grabWindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *pointer_mode, *keyboard_mode;
+ char dpointer_mode[10], dkeyboard_mode[10];
+
+ switch (stuff->pointerMode)
+ {
+ case GrabModeSync: pointer_mode = "GrabModeSync"; break;
+ case GrabModeAsync: pointer_mode = "GrabModeAsync"; break;
+ default: pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+ }
+
+ switch (stuff->keyboardMode)
+ {
+ case GrabModeSync: keyboard_mode = "GrabModeSync"; break;
+ case GrabModeAsync: keyboard_mode = "GrabModeAsync"; break;
+ default: keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+ }
+
+ REPLY (" owner_events(%s) pointer_mode(%s) keyboard_mode(%s)",
+ stuff->ownerEvents ? "YES" : "NO",
+ pointer_mode,
+ keyboard_mode);
+ }
+
return reply;
}
case X_GrabKey:
{
xGrabKeyReq *stuff = (xGrabKeyReq *)req;
+
REPLY (": XID(0x%lx)",
stuff->grabWindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *pointer_mode, *keyboard_mode;
+ char dpointer_mode[10], dkeyboard_mode[10];
+
+ switch (stuff->pointerMode)
+ {
+ case GrabModeSync: pointer_mode = "GrabModeSync"; break;
+ case GrabModeAsync: pointer_mode = "GrabModeAsync"; break;
+ default: pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+ }
+
+ switch (stuff->keyboardMode)
+ {
+ case GrabModeSync: keyboard_mode = "GrabModeSync"; break;
+ case GrabModeAsync: keyboard_mode = "GrabModeAsync"; break;
+ default: keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+ }
+
+ REPLY (" key(%d) pointer_mode(%s) keyboard_mode(%s)\n",
+ stuff->key,
+ pointer_mode,
+ keyboard_mode);
+
+ REPLY (" modifiers");
+ REPLY ("(");
+ reply = _getKeyMask(stuff->modifiers, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->grabWindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" key(%d)",
+ stuff->key);
+
+ REPLY (" modifiers");
+ REPLY ("(");
+ reply = _getKeyMask(stuff->modifiers, reply, len);
+ REPLY (")");
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->focus);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" reverTo(%d) time(%lums)",
+ stuff->revertTo,
+ stuff->time);
+ }
+
return reply;
}
stuff->width,
stuff->height);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" depth(%d)",
+ stuff->depth);
+ }
+
return reply;
}
stuff->width,
stuff->height);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" exposures(%s)",
+ stuff->exposures ? "YES" : "NO");
+ }
+
\r return reply;
}
stuff->dstX,
stuff->dstY);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" bit_plane(0x%lx)",
+ stuff->bitPlane);
+ }
+
return reply;
}
stuff->drawable,
stuff->gc);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *coord_mode;
+ char dcoord_mode[10];
+
+ switch (stuff->coordMode)
+ {
+ case CoordModeOrigin: coord_mode = "CoordModeOrigin"; break;
+ case CoordModePrevious: coord_mode = "CoordModePrevious"; break;
+ default: coord_mode = dcoord_mode; sprintf (dcoord_mode, "%d", stuff->coordMode); break;
+ }
+
+ REPLY (" coord_mode(%s)",
+ coord_mode);
+ }
+
return reply;
}
stuff->drawable,
stuff->gc);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *coord_mode;
+ char dcoord_mode[10];
+
+ switch (stuff->coordMode)
+ {
+ case CoordModeOrigin: coord_mode = "CoordModeOrigin"; break;
+ case CoordModePrevious: coord_mode = "CoordModePrevious"; break;
+ default: coord_mode = dcoord_mode; sprintf (dcoord_mode, "%d", stuff->coordMode); break;
+ }
+
+ REPLY (" coord_mode(%s)",
+ coord_mode);
+ }
+
return reply;
}
stuff->drawable,
stuff->gc);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *shape, *coord_mode;
+ char dshape[10], dcoord_mode[10];
+
+ switch (stuff->shape)
+ {
+ case Complex: shape = "Complex"; break;
+ case Nonconvex: shape = "Nonconvex"; break;
+ case Convex: shape = "Convex"; break;
+ default: shape = dshape; sprintf (dshape, "%d", stuff->shape); break;
+ }
+
+ switch (stuff->coordMode)
+ {
+ case CoordModeOrigin: coord_mode = "CoordModeOrigin"; break;
+ case CoordModePrevious: coord_mode = "CoordModePrevious"; break;
+ default: coord_mode = dcoord_mode; sprintf (dcoord_mode, "%d", stuff->coordMode); break;
+ }
+
+ REPLY (" shape(%s) coord_mode(%s)",
+ shape,
+ coord_mode);
+ }
+
return reply;
}
stuff->height,
stuff->dstX,
stuff->dstY);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *format;
+ char dformat[10];
+
+ switch (stuff->format)
+ {
+ case XYBitmap: format = "XYBitmap"; break;
+ case XYPixmap: format = "XYPixmap"; break;
+ case ZPixmap: format = "ZPixmap"; break;
+ default: format = dformat; sprintf (dformat, "%d", stuff->format); break;
+ }
+
+ REPLY (" format(%s) depth(%d)",
+ format,
+ stuff->depth);
+ }
+
return reply;
}
stuff->x,
stuff->y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *format;
+ char dformat[10];
+
+ switch (stuff->format)
+ {
+ case XYBitmap: format = "XYBitmap"; break;
+ case XYPixmap: format = "XYPixmap"; break;
+ case ZPixmap: format = "ZPixmap"; break;
+ default: format = dformat; sprintf (dformat, "%d", stuff->format); break;
+ }
+
+ REPLY (" format(%s) plane_mask(0x%lx)",
+ format,
+ stuff->planeMask);
+ }
+
return reply;
}
stuff->x,
stuff->y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" nchars(%d)",
+ stuff->nChars);
+ }
+
return reply;
}
stuff->x,
stuff->y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" nchars(%d)",
+ stuff->nChars);
+ }
+
return reply;
}
case X_ChangeKeyboardMapping:
{
xChangeKeyboardMappingReq *stuff = (xChangeKeyboardMappingReq *)req;
- REPLY (": Key(%d) FstKey(%d) KeySyms(%d)",
+ REPLY (": first_key_code(%d) key_syms_per_key_code(%d)",
stuff->firstKeyCode,
- stuff->keyCodes,
stuff->keySymsPerKeyCode);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" key_codes(%d)",
+ stuff->keyCodes);
+ }
+
return reply;
}
case X_GetKeyboardMapping:
{
xGetKeyboardMappingReq *stuff = (xGetKeyboardMappingReq *)req;
- REPLY (": FstKey(%d) Count(%d)",
- stuff->firstKeyCode,
- stuff->count);
+ REPLY (": first_key_code(%d)",
+ stuff->firstKeyCode);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" count(%d)",
+ stuff->count);
+ }
return reply;
}
stuff->accelDenum,
stuff->threshold);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" do_accel(%s) do_thresh(%s)",
+ stuff->doAccel ? "YES" : "NO",
+ stuff->doThresh ? "YES" : "NO");
+ }
+
return reply;
}
case X_SetPointerMapping:
{
xSetPointerMappingReq *stuff = (xSetPointerMappingReq *)req;
- REPLY (": Elts(%d)",
- stuff->nElts);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (": Elts(%d)",
+ stuff->nElts);
+ }
return reply;
}
case X_SetModifierMapping:
{
xSetModifierMappingReq *stuff =(xSetModifierMappingReq *)req;
- REPLY (": NumkeyPerModifier(%d)",
+ REPLY (": num_key_per_modifier(%d)",
stuff->numKeyPerModifier);
return reply;
return reply;
}
-char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
+char * xDbgEvlogEventCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
evt->u.keyButtonPointer.eventY,
evt->u.keyButtonPointer.child);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s state(0x%x) same_screen(%s)",
+ " ",
+ evt->u.keyButtonPointer.state,
+ evt->u.keyButtonPointer.sameScreen ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case EnterNotify:
case LeaveNotify:
evt->u.enterLeave.eventY,
evt->u.enterLeave.child);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(0x%x) same_screen(%s) focus(%s)",
+ " ",
+ evt->u.enterLeave.time,
+ evt->u.enterLeave.state,
+ evt->u.enterLeave.flags & ELFlagSameScreen ? "YES" : "NO",
+ evt->u.enterLeave.flags & ELFlagFocus ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case FocusIn:
case FocusOut:
REPLY (": XID(0x%lx)",
evt->u.focus.window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char* mode;
+ char dmode[10];
+
+ switch (evt->u.focus.mode)
+ {
+ case NotifyNormal: mode = "NotifyNormal"; break;
+ case NotifyGrab: mode = "NotifyGrab"; break;
+ case NotifyUngrab: mode = "NotifyUngrab"; break;
+ case NotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break;
+ default: mode = dmode, sprintf (dmode, "%u", evt->u.focus.mode); break;
+ }
+
+ REPLY (" mode(%s)",
+ mode);
+ }
+
return reply;
- }
+ }
case Expose:
{
evt->u.expose.x,
evt->u.expose.y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" count(%d)",
+ evt->u.expose.count);
+ }
+
return reply;
- }
+ }
case GraphicsExpose:
{
evt->u.graphicsExposure.x,
evt->u.graphicsExposure.y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *major;
+ char dmajor[10];
+
+ switch (evt->u.graphicsExposure.majorEvent)
+ {
+ case X_CopyArea: major = "CopyArea"; break;
+ case X_CopyPlane: major = "CopyPlane"; break;
+ default: major = dmajor; sprintf(dmajor, "%d", evt->u.graphicsExposure.majorEvent); break;
+ }
+
+ REPLY (" major_event(%s) minor_event(%d) count(%d)",
+ major,
+ evt->u.graphicsExposure.minorEvent,
+ evt->u.graphicsExposure.count);
+ }
+
return reply;
- }
+ }
case NoExpose:
{
REPLY (": XID(0x%lx)",
evt->u.noExposure.drawable);
- return reply;
- }
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *major;
+ char dmajor[10];
+
+ switch (evt->u.noExposure.majorEvent)
+ {
+ case X_CopyArea: major = "CopyArea"; break;
+ case X_CopyPlane: major = "CopyPlane"; break;
+ default: major = dmajor; sprintf (dmajor, "%d", evt->u.noExposure.majorEvent); break;
+ }
+ REPLY (" major_event(%s) minor_event(%d)",
+ major,
+ evt->u.noExposure.minorEvent);
+ }
+
+ return reply;
+ }
case VisibilityNotify:
{
REPLY (": XID(0x%lx)",
evt->u.visibility.window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *state;
+ char dstate[10];
+
+ switch (evt->u.visibility.state)
+ {
+ case VisibilityUnobscured: state = "VisibilityUnobscured"; break;
+ case VisibilityPartiallyObscured: state = "VisibilityPartiallyObscured"; break;
+ case VisibilityFullyObscured: state = "VisibilityFullyObscured"; break;
+ default: state = dstate; sprintf (dstate, "%d", evt->u.visibility.state); break;
+ }
+
+ REPLY (" state(%s)",
+ state);
+ }
+
return reply;
- }
+ }
case CreateNotify:
{
evt->u.createNotify.y,
evt->u.createNotify.borderWidth);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" override(%s)",
+ evt->u.createNotify.override ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case DestroyNotify:
{
evt->u.unmapNotify.window,
evt->u.unmapNotify.event);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" from_Configure(%s)",
+ evt->u.unmapNotify.fromConfigure ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case MapNotify:
{
evt->u.mapNotify.window,
evt->u.mapNotify.event);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" override(%s)",
+ evt->u.mapNotify.override ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case MapRequest:
{
evt->u.mapRequest.parent);
return reply;
- }
+ }
case ReparentNotify:
{
- REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx) coord(%d,%d)",
+ REPLY (": Window(0x%lx) Event(0x%lx) Parent(0x%lx) coord(%d,%d)",
evt->u.reparent.window,
evt->u.reparent.event,
evt->u.reparent.parent,
evt->u.reparent.x,
evt->u.reparent.y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" override(%s)",
+ evt->u.reparent.override ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case ConfigureNotify:
{
- REPLY (": Window(0x%lx) Event(0x%lx) aboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
+ REPLY (": Window(0x%lx) Event(0x%lx) AboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
evt->u.configureNotify.window,
evt->u.configureNotify.event,
evt->u.configureNotify.aboveSibling,
evt->u.configureNotify.y,
evt->u.configureNotify.borderWidth);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" override(%s)",
+ evt->u.configureNotify.override ? "YES" : "NO");
+ }
+
return reply;
- }
+ }
case ConfigureRequest:
{
evt->u.configureRequest.y,
evt->u.configureRequest.borderWidth);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s value_mask",
+ " ");
+ REPLY ("(");
+ reply = _getConfigureWindowMask(evt->u.configureRequest.valueMask, reply, len);
+ REPLY (")");
+ }
+
return reply;
- }
+ }
case GravityNotify:
{
evt->u.gravity.y);
return reply;
- }
+ }
case ResizeRequest:
{
evt->u.resizeRequest.height);
return reply;
- }
+ }
case CirculateNotify:
case CirculateRequest:
evt->u.circulate.event,
evt->u.circulate.parent);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *place;
+ char dplace[10];
+
+ switch (evt->u.circulate.place)
+ {
+ case PlaceOnTop: place = "PlaceOnTop"; break;
+ case PlaceOnBottom: place = "PlaceOnBottom"; break;
+ default: place = dplace; sprintf (dplace, "%d", evt->u.circulate.place); break;
+ }
+
+ REPLY (" place(%s)",
+ place);
+ }
+
return reply;
- }
+ }
case PropertyNotify:
{
REPLY (": Window(0x%lx)",
evt->u.property.window);
- REPLY (" Atom");
+ REPLY (" Property");
reply = xDbgGetAtom(evt->u.property.atom, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *state;
+ char dstate[10];
+
+ switch (evt->u.property.state)
+ {
+ case PropertyNewValue: state = "PropertyNewValue"; break;
+ case PropertyDelete: state = "PropertyDelete"; break;
+ default: state = dstate; sprintf (dstate, "%d", evt->u.property.state); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%s)",
+ " ",
+ evt->u.property.time,
+ state);
+ }
+
return reply;
- }
+ }
case SelectionClear:
{
REPLY (" Atom");
reply = xDbgGetAtom(evt->u.selectionClear.atom, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ evt->u.selectionClear.time);
+ }
+
return reply;
}
REPLY (" Property");
reply = xDbgGetAtom(evt->u.selectionRequest.property, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ evt->u.selectionRequest.time);
+ }
+
return reply;
- }
+ }
case SelectionNotify:
{
REPLY (" Property");
reply = xDbgGetAtom(evt->u.selectionNotify.property, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ evt->u.selectionNotify.time);
+ }
+
return reply;
- }
+ }
case ColormapNotify:
{
evt->u.colormap.window,
evt->u.colormap.colormap);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *state;
+ char dstate[10];
+
+ switch (evt->u.colormap.state)
+ {
+ case ColormapInstalled: state = "ColormapInstalled"; break;
+ case ColormapUninstalled: state = "ColormapUninstalled"; break;
+ default: state = dstate; sprintf (dstate, "%d", evt->u.colormap.state); break;
+ }
+
+ REPLY (" new(%s) state(%s)",
+ evt->u.colormap.new ? "YES" : "NO",
+ state);
+ }
+
return reply;
- }
+ }
case ClientMessage:
{
return reply;
}
-char * xDbgEvlogReplyCore (EvlogInfo *evinfo, char *reply, int *len)
+char * xDbgEvlogReplyCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
REPLY (": PropertyType");
reply = xDbgGetAtom(stuff->propertyType, evinfo, reply, len);
- REPLY (" bytesAfter(0x%lx) ItemNum(%ld)",
+ REPLY (" bytesAfter(0x%lx) format(%d) ItemNum(%ld)",
stuff->bytesAfter,
+ stuff->format,
stuff->nItems);
}
else
return reply;
}
-
return reply;
}
REPLY (")");
}
-
-
return reply;
}
#include "xdbg_types.h"
-char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len);
-char * xDbgEvlogReplyCore (EvlogInfo *evinfo, char *reply, int *len);
-char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len);
+char * xDbgEvlogRequestCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
+char * xDbgEvlogReplyCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
+char * xDbgEvlogEventCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
#endif
#include "xdbg_evlog.h"
static char *
-_EvlogRequestDamage(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestDamage(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
case X_DamageCreate:
{
xDamageCreateReq *stuff = (xDamageCreateReq *)req;
- REPLY (": XID(0x%lx) Drawable(0x%lx) level(%d)",
+ REPLY (": XID(0x%lx) Drawable(0x%lx)",
stuff->damage,
- stuff->drawable,
- stuff->level);
+ stuff->drawable);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *level;
+ char dlevel[10];
+
+ switch (stuff->level)
+ {
+ case XDamageReportRawRectangles: level = "DamageReportRawRegion"; break;
+ case XDamageReportDeltaRectangles: level = "DamageReportDeltaRegion"; break;
+ case XDamageReportBoundingBox: level = "DamageReportBoundingBox"; break;
+ case XDamageReportNonEmpty: level = "DamageReportNonEmpty"; break;
+ default: level = dlevel; sprintf (dlevel, "%d", stuff->level); break;
+ }
+
+ REPLY (" level(%s)",
+ level);
+ }
return reply;
}
}
static char*
-_EvlogEventDamage (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventDamage (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
stuff->geometry.width,
stuff->geometry.height);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) level(%d) sequence_num(%d)",
+ " ",
+ stuff->timestamp,
+ stuff->level,
+ stuff->sequenceNumber);
+ }
+
return reply;
}
}
static char *
-_EvlogReplyDamage (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyDamage (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
#if 0
xGenericReply *rep = evinfo->rep.ptr;
#include "xdbg_evlog.h"
static char *
-_EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestDri2 (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
case X_DRI2GetBuffers:
{
xDRI2GetBuffersReq *stuff = (xDRI2GetBuffersReq *)req;
- REPLY (": XID(0x%lx) Count(%ld)",
- stuff->drawable,
- stuff->count);
+ REPLY (": XID(0x%lx)",
+ stuff->drawable);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" count(%ld)",
+ stuff->count);
+ }
return reply;
}
stuff->src,
stuff->dest);
- REPLY (" Region");
- reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" Region");
+ reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+ }
return reply;
}
case X_DRI2GetBuffersWithFormat:
{
xDRI2GetBuffersReq *stuff = (xDRI2GetBuffersReq *)req;
- REPLY (": XID(0x%lx) count(%ld)",
- stuff->drawable,
- stuff->count);
+ REPLY (": XID(0x%lx)",
+ stuff->drawable);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" count(%ld)",
+ stuff->count);
+ }
return reply;
}
case X_DRI2SwapInterval:
{
xDRI2SwapIntervalReq *stuff = (xDRI2SwapIntervalReq *)req;
- REPLY (": XID(0x%lx) Interval(%ld)",
- stuff->drawable,
- stuff->interval);
+ REPLY (": XID(0x%lx)",
+ stuff->drawable);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" interval(%ld)",
+ stuff->interval);
+ }
return reply;
}
REPLY (": XID(0x%lx)",
stuff->drawable);
- REPLY (" Region");
- reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" Region");
+ reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+ }
return reply;
}
static char *
-_EvlogEventDri2 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventDri2 (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
evinfo->evt.size = sizeof (xDRI2BufferSwapComplete);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s sequence_num(%d) event_type(%d)",
+ " ",
+ stuff->sequenceNumber,
+ stuff->event_type);
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->drawable);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d)",
+ stuff->sequenceNumber);
+ }
+
return reply;
}
}
static char *
-_EvlogReplyDri2 (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyDri2 (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
if (evinfo->rep.isStart)
{
xDRI2GetBuffersReply *stuff = (xDRI2GetBuffersReply *)rep;
- REPLY (": size(%ldx%ld) Count(%ld)",
+ REPLY (": size(%ldx%ld) count(%ld)",
stuff->width,
stuff->height,
stuff->count);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d)",
+ stuff->sequenceNumber);
+ }
}
else
{
xDRI2Buffer *stuff = (xDRI2Buffer *)rep;
- REPLY ("attachment(0x%lx) Name(0x%lx) pitch(0x%lx) cpp(0x%lx)",
+ REPLY ("attachment(0x%lx) Name(0x%lx) pitch(0x%lx) cpp(0x%lx) flags(0x%lx)",
stuff->attachment,
stuff->name,
stuff->pitch,
- stuff->cpp);
+ stuff->cpp,
+ stuff->flags);
}
return reply;
REPLY (": swap(%ld/%ld)",
stuff->swap_hi,
stuff->swap_lo);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d)",
+ stuff->sequenceNumber);
+ }
}
else
{
char *
-xDbgEvlogEvent (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+xDbgEvlogEvent (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
extern ExtensionInfo* Sorted_Evlog_extensions;
extern int Extensions_size;
type &= 0x7F;
- if(!on)
- return reply;
-
if (type < EXTENSION_EVENT_BASE)
{
- return xDbgEvlogEventCore (evinfo, reply, len);
+ return xDbgEvlogEventCore (evinfo, detail_level, reply, len);
}
else
{
if (type >= Sorted_Evlog_extensions[i].evt_base &&
type < Sorted_Evlog_extensions[i+1].evt_base)
{
- return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, reply, len);
+ return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, detail_level, reply, len);
}
continue;
}
- return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, reply, len);
+ return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, detail_level, reply, len);
}
}
#include "xdbg_types.h"
-char * xDbgEvlogEvent (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+char * xDbgEvlogEvent (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
#endif
#include "xdbg_evlog.h"
static char *
-_EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestGesture(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
REPLY (": XID(0x%lx)",
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" mask(0x%lx)",
+ stuff->mask);
+ }
+
return reply;
}
case X_GestureGrabEvent:
{
xGestureGrabEventReq *stuff = (xGestureGrabEventReq *)req;
- REPLY (": XID(0x%lx) EventType(0x%lx), Num_finger(%d)",
- stuff->window,
- stuff->eventType,
- stuff->num_finger);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *event_type;
+ char devent_type[10];
+
+ switch (stuff->eventType)
+ {
+ case GestureNotifyFlick: event_type = "GestureNotifyFlick"; break;
+ case GestureNotifyPan: event_type = "GestureNotifyPan"; break;
+ case GestureNotifyPinchRotation: event_type = "GestureNotifyPinchRotation"; break;
+ case GestureNotifyTap: event_type = "GestureNotifyTap"; break;
+ case GestureNotifyTapNHold: event_type = "GestureNotifyTapNHold"; break;
+ case GestureNotifyHold: event_type = "GestureNotifyHold"; break;
+ case GestureNotifyGroup: event_type = "GestureNotifyGroup"; break;
+ default: event_type = devent_type; sprintf (devent_type, "%ld", stuff->eventType); break;
+ }
+
+ REPLY (" event_type(%s) num_finger(%d) time(%lums)",
+ event_type,
+ stuff->num_finger,
+ stuff->time);
+ }
return reply;
}
case X_GestureUngrabEvent:
{
xGestureUngrabEventReq *stuff = (xGestureUngrabEventReq *)req;
- REPLY (": XID(0x%lx) EventType(0x%lx), Num_finger(%d)",
- stuff->window,
- stuff->eventType,
- stuff->num_finger);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *event_type;
+ char devent_type[10];
+
+ switch (stuff->eventType)
+ {
+ case GestureNotifyFlick: event_type = "GestureNotifyFlick"; break;
+ case GestureNotifyPan: event_type = "GestureNotifyPan"; break;
+ case GestureNotifyPinchRotation: event_type = "GestureNotifyPinchRotation"; break;
+ case GestureNotifyTap: event_type = "GestureNotifyTap"; break;
+ case GestureNotifyTapNHold: event_type = "GestureNotifyTapNHold"; break;
+ case GestureNotifyHold: event_type = "GestureNotifyHold"; break;
+ case GestureNotifyGroup: event_type = "GestureNotifyGroup"; break;
+ default: event_type = devent_type; sprintf (devent_type, "%ld", stuff->eventType); break;
+ }
+
+ REPLY (" event_type(%s) num_finger(%d) time(%lums)",
+ event_type,
+ stuff->num_finger,
+ stuff->time);
+ }
return reply;
}
}
static char *
-_EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventGesture (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
case GestureNotifyFlick:
{
xGestureNotifyFlickEvent *stuff = (xGestureNotifyFlickEvent *) evt;
- REPLY (": XID(0x%lx) Direction(%d) Distance(%d) Duration(%ldms) Angle(0x%lx)",
- stuff->window,
- stuff->direction,
- stuff->distance,
- stuff->duration,
- stuff->angle);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureEnd: kind = "GestureEnd"; break;
+ case GestureBegin: kind = "GestureBegin"; break;
+ case GestureUpdate: kind = "GestureUpdate"; break;
+ case GestureDone: kind = "GestureDone"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY (" kind(%s) time(%lums) num_finger(%d) direction(%d) distance(%d)",
+ kind,
+ stuff->time,
+ stuff->num_finger,
+ stuff->direction,
+ stuff->distance);
+
+ REPLY ("\n");
+ REPLY ("%67s duration(%lums) angle(%ld)",
+ " ",
+ stuff->duration,
+ stuff->angle);
+ }
return reply;
}
case GestureNotifyPan:
{
xGestureNotifyPanEvent *stuff = (xGestureNotifyPanEvent *) evt;
- REPLY (": XID(0x%lx) Direction(%d) Distance(%d) Duration(%ldms) coord(%d,%d)",
- stuff->window,
- stuff->direction,
- stuff->distance,
- stuff->duration,
- stuff->dx,
- stuff->dy);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureEnd: kind = "GestureEnd"; break;
+ case GestureBegin: kind = "GestureBegin"; break;
+ case GestureUpdate: kind = "GestureUpdate"; break;
+ case GestureDone: kind = "GestureDone"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) direction(%d) ",
+ kind,
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->num_finger,
+ stuff->direction);
+
+ REPLY ("\n");
+ REPLY ("%67s distance(%d) duration(%ldms) coord(%d,%d)",
+ " ",
+ stuff->distance,
+ stuff->duration,
+ stuff->dx,
+ stuff->dy);
+ }
return reply;
}
case GestureNotifyPinchRotation:
{
xGestureNotifyPinchRotationEvent *stuff = (xGestureNotifyPinchRotationEvent *) evt;
- REPLY (": XID(0x%lx) Distance(%d) Coord(%d,%d) Zoom(0x%lx) Angle(0x%lx)",
- stuff->window,
- stuff->distance,
- stuff->cx,
- stuff->cy,
- stuff->zoom,
- stuff->angle);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureEnd: kind = "GestureEnd"; break;
+ case GestureBegin: kind = "GestureBegin"; break;
+ case GestureUpdate: kind = "GestureUpdate"; break;
+ case GestureDone: kind = "GestureDone"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) distance(%d)",
+ kind,
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->num_finger,
+ stuff->distance);
+
+ REPLY ("\n");
+ REPLY ("%67s coord(%d,%d) zoom(%ld) angle(%ld)",
+ " ",
+ stuff->cx,
+ stuff->cy,
+ stuff->zoom,
+ stuff->angle);
+ }
return reply;
}
case GestureNotifyTap:
{
xGestureNotifyTapEvent *stuff = (xGestureNotifyTapEvent *) evt;
- REPLY (": XID(0x%lx) Coord(%d,%d) tapRepeat(%d) Interval(%ldms)",
- stuff->window,
- stuff->cx,
- stuff->cy,
- stuff->tap_repeat,
- stuff->interval);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureEnd: kind = "GestureEnd"; break;
+ case GestureBegin: kind = "GestureBegin"; break;
+ case GestureUpdate: kind = "GestureUpdate"; break;
+ case GestureDone: kind = "GestureDone"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) coord(%d,%d)",
+ kind,
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->num_finger,
+ stuff->cx,
+ stuff->cy);
+
+ REPLY ("\n");
+ REPLY ("%67s tap_repeat(%d) interval(%lums)",
+ " ",
+ stuff->tap_repeat,
+ stuff->interval);
+ }
return reply;
}
case GestureNotifyTapNHold:
{
xGestureNotifyTapNHoldEvent *stuff = (xGestureNotifyTapNHoldEvent *) evt;
- REPLY (": XID(0x%lx) Coord(%d,%d) Interval(%ldms) Holdtime(%ldms)",
- stuff->window,
- stuff->cx,
- stuff->cy,
- stuff->interval,
- stuff->holdtime);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureEnd: kind = "GestureEnd"; break;
+ case GestureBegin: kind = "GestureBegin"; break;
+ case GestureUpdate: kind = "GestureUpdate"; break;
+ case GestureDone: kind = "GestureDone"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) coord(%d,%d)",
+ kind,
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->num_finger,
+ stuff->cx,
+ stuff->cy);
+
+ REPLY ("\n");
+ REPLY ("%67s interval(%lums) hold_time(%lums)",
+ " ",
+ stuff->interval,
+ stuff->holdtime);
+ }
return reply;
}
case GestureNotifyHold:
{
xGestureNotifyHoldEvent *stuff = (xGestureNotifyHoldEvent *) evt;
- REPLY (": XID(0x%lx) Coord(%d,%d) Holdtime(%ldms)",
- stuff->window,
- stuff->cx,
- stuff->cy,
- stuff->holdtime);
+ REPLY (": XID(0x%lx)",
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureEnd: kind = "GestureEnd"; break;
+ case GestureBegin: kind = "GestureBegin"; break;
+ case GestureUpdate: kind = "GestureUpdate"; break;
+ case GestureDone: kind = "GestureDone"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) coord(%d,%d) ",
+ kind,
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->num_finger,
+ stuff->cx,
+ stuff->cy);
+
+ REPLY ("\n");
+ REPLY ("%67s hold_time(%lums)",
+ " ",
+ stuff->holdtime);
+ }
return reply;
}
stuff->groupid,
stuff->num_group);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *kind;
+ char dkind[10];
+
+ switch (stuff->kind)
+ {
+ case GestureGroupRemoved: kind = "GestureGroupRemoved"; break;
+ case GestureGroupAdded: kind = "GestureGroupAdded"; break;
+ case GestureGroupCurrent: kind = "GestureGroupCurrent"; break;
+ default: kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s kind(%s) sequence_num(%d) time(%lums) group_id(%d) num_group(%d)",
+ " ",
+ kind,
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->groupid,
+ stuff->num_group);
+ }
+
return reply;
}
}
static char *
-_EvlogReplyGesture (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyGesture (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
#if 0
xGenericReply *rep = evinfo->rep.ptr;
#include "xdbg_evlog.h"
static char *
-_EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestRandr (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
case X_RRSetScreenSize:
{
xRRSetScreenSizeReq *stuff = (xRRSetScreenSizeReq *)req;
- REPLY (": XID(0x%lx) size(%dx%d) milliSize(%ldx%ld)",
+ REPLY (": XID(0x%lx) size(%dx%d)",
stuff->window,
stuff->width,
- stuff->height,
- stuff->widthInMillimeters,
- stuff->heightInMillimeters);
+ stuff->height);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" milliSize(%ldx%ld)",
+ stuff->widthInMillimeters,
+ stuff->heightInMillimeters);
+ }
return reply;
}
REPLY (": XID(0x%lx)",
stuff->output);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" config_timestamp(%lums)",
+ stuff->configTimestamp);
+ }
+
return reply;
}
REPLY (" Property");
reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" pending(%s) range(%s)",
+ stuff->pending ? "YES" : "NO",
+ stuff->range ? "YES" : "NO");
+ }
+
return reply;
}
case X_RRChangeOutputProperty:
{
xRRChangeOutputPropertyReq *stuff = (xRRChangeOutputPropertyReq *)req;
- REPLY (": XID(0x%lx) Format(%d) nUnits(%ld)",
- stuff->output,
- stuff->format,
- stuff->nUnits);
+ REPLY (": XID(0x%lx)",
+ stuff->output);
REPLY (" Property");
reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
REPLY (" Type");
reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *mode;
+ char dmode[10];
+
+ switch (stuff->mode)
+ {
+ case PropModeReplace: mode = "PropModeReplace"; break;
+ case PropModePrepend: mode = "PropModePrepend"; break;
+ case PropModeAppend: mode = "PropModeAppend"; break;
+ default: mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s mode(%s) format(%d) nUnits(%ld)",
+ " ",
+ mode,
+ stuff->format,
+ stuff->nUnits);
+ }
+
return reply;
}
case X_RRGetOutputProperty:
{
xRRGetOutputPropertyReq *stuff = (xRRGetOutputPropertyReq *)req;
- REPLY (": XID(0x%lx) longOffset(%ld) longLength(%ld)",
- stuff->output,
- stuff->longOffset,
- stuff->longLength);
+ REPLY (": XID(0x%lx)",
+ stuff->output);
REPLY (" Property");
reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
REPLY (" Type");
reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" longOffset(%ld) longLength(%ld)",
+ stuff->longOffset,
+ stuff->longLength);
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->crtc);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" config_timestamp(%lums)",
+ stuff->configTimestamp);
+ }
+
return reply;
}
case X_RRSetCrtcConfig:
{
xRRSetCrtcConfigReq *stuff = (xRRSetCrtcConfigReq *)req;
- REPLY (": XID(0x%lx) Coordinate(%d,%d) Rotation(%d)",
+ REPLY (": XID(0x%lx) coord(%d,%d) ",
stuff->crtc,
stuff->x,
- stuff->y,
- stuff->rotation);
+ stuff->y);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *rotation;
+
+ switch (stuff->rotation & 0xf)
+ {
+ case RR_Rotate_0: rotation = "RR_Rotate_0"; break;
+ case RR_Rotate_90: rotation = "RR_Rotate_90"; break;
+ case RR_Rotate_180: rotation = "RR_Rotate_180"; break;
+ case RR_Rotate_270: rotation = "RR_Rotate_270"; break;
+ default: rotation = "Invaild Rotation"; break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s timestamp(%lums) config_timestamp(%lums) RRmode(0x%lx) rotation(%s)",
+ " ",
+ stuff->timestamp,
+ stuff->configTimestamp,
+ stuff->mode,
+ rotation);
+ }
return reply;
}
static char *
-_EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventRandr (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
case RRScreenChangeNotify:
{
xRRScreenChangeNotifyEvent *stuff = (xRRScreenChangeNotifyEvent *) evt;
- REPLY (": Root(0x%lx) Window(0x%lx) sizeID(%d) subPixel(%d) Pixel(%d,%d) Milli(%d,%d)",
+ REPLY (": Root(0x%lx) Window(0x%lx)",
stuff->root,
- stuff->window,
- stuff->sizeID,
- stuff->subpixelOrder,
- stuff->widthInPixels,
- stuff->heightInPixels,
- stuff->widthInMillimeters,
- stuff->heightInMillimeters);
+ stuff->window);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *rotation;
+
+ switch (stuff->rotation & 0xf)
+ {
+ case RR_Rotate_0: rotation = "RR_Rotate_0"; break;
+ case RR_Rotate_90: rotation = "RR_Rotate_90"; break;
+ case RR_Rotate_180: rotation = "RR_Rotate_180"; break;
+ case RR_Rotate_270: rotation = "RR_Rotate_270"; break;
+ default: rotation = "Invaild Rotation"; break;
+ }
+
+ REPLY (" sizeID(%d) subPixel(%d) Pixel(%d,%d) Milli(%d,%d)",
+ stuff->sizeID,
+ stuff->subpixelOrder,
+ stuff->widthInPixels,
+ stuff->heightInPixels,
+ stuff->widthInMillimeters,
+ stuff->heightInMillimeters);
+
+ REPLY ("\n");
+ REPLY ("%67s rotation(%s) sequence_num(%d) timestamp(%lums) config_timestamp(%lums)",
+ " ",
+ rotation,
+ stuff->sequenceNumber,
+ stuff->timestamp,
+ stuff->configTimestamp);
+ }
return reply;
}
case RRNotify_CrtcChange:
{
xRRCrtcChangeNotifyEvent *stuff = (xRRCrtcChangeNotifyEvent *) evt;
- REPLY (": XID(0x%lx) Crtc(0x%lx) Mode(0x%lx) size(%udx%ud) coord(%d,%d)",
+ REPLY (": XID(0x%lx) Crtc(0x%lx) RRmode(0x%lx) new_size(%udx%ud) new_coord(%d,%d)",
stuff->window,
stuff->crtc,
stuff->mode,
stuff->x,
stuff->y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *rotation;
+
+ switch (stuff->rotation & 0xf)
+ {
+ case RR_Rotate_0: rotation = "RR_Rotate_0"; break;
+ case RR_Rotate_90: rotation = "RR_Rotate_90"; break;
+ case RR_Rotate_180: rotation = "RR_Rotate_180"; break;
+ case RR_Rotate_270: rotation = "RR_Rotate_270"; break;
+ default: rotation = "Invaild Rotation"; break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s rotation(%s) sequence_num(%d) timestamp(%lums)",
+ " ",
+ rotation,
+ stuff->sequenceNumber,
+ stuff->timestamp);
+ }
+
return reply;
}
case RRNotify_OutputChange:
{
xRROutputChangeNotifyEvent *stuff = (xRROutputChangeNotifyEvent *) evt;
- REPLY (": XID(0x%lx) Output(0x%lx) Crtc(0x%lx) Mode(0x%lx)",
+ REPLY (": XID(0x%lx) Output(0x%lx) Crtc(0x%lx) RRmode(0x%lx)",
stuff->window,
stuff->output,
stuff->crtc,
stuff->mode);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *rotation, *connection, *subpixelOrder;
+ char dconnection[10], dsubpixelOrder[10];
+
+ switch (stuff->rotation & 0xf)
+ {
+ case RR_Rotate_0: rotation = "RR_Rotate_0"; break;
+ case RR_Rotate_90: rotation = "RR_Rotate_90"; break;
+ case RR_Rotate_180: rotation = "RR_Rotate_180"; break;
+ case RR_Rotate_270: rotation = "RR_Rotate_270"; break;
+ default: rotation = "Invaild Rotation"; break;
+ }
+
+ switch (stuff->connection)
+ {
+ case RR_Connected: connection = "RR_Connected"; break;
+ case RR_Disconnected: connection = "RR_Disconnected"; break;
+ case RR_UnknownConnection: connection = "RR_UnknownConnection"; break;
+ default: connection = dconnection; sprintf (dconnection, "%d", stuff->connection); break;
+ }
+
+ switch (stuff->subpixelOrder)
+ {
+ case SubPixelUnknown: subpixelOrder = "SubPixelUnknown"; break;
+ case SubPixelHorizontalRGB: subpixelOrder = "SubPixelHorizontalRGB"; break;
+ case SubPixelHorizontalBGR: subpixelOrder = "SubPixelHorizontalBGR"; break;
+ case SubPixelVerticalRGB: subpixelOrder = "SubPixelVerticalRGB"; break;
+ case SubPixelVerticalBGR: subpixelOrder = "SubPixelVerticalBGR"; break;
+ case SubPixelNone: subpixelOrder = "SubPixelNone"; break;
+ default: subpixelOrder = dsubpixelOrder; sprintf (dsubpixelOrder, "%d", stuff->connection); break;
+ }
+
+ REPLY (" sequence_num(%d)",
+ stuff->sequenceNumber);
+
+ REPLY ("\n");
+ REPLY ("%67s timestamp(%lums) config_timestamp(%lums) rotation(%s) connection(%s) subpixel_order(%s)",
+ " ",
+ stuff->timestamp,
+ stuff->configTimestamp,
+ rotation,
+ connection,
+ subpixelOrder);
+ }
+
return reply;
}
stuff->window,
stuff->output);
- REPLY (" Atom");
+ REPLY (" Property");
reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *state;
+ char dstate[10];
+
+ switch (stuff->state)
+ {
+ case PropertyNewValue: state = "PropertyNewValue"; break;
+ case PropertyDelete: state = "PropertyDelete"; break;
+ default: state = dstate; sprintf (dstate, "%d", stuff->state); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s sequence_num(%d) timestamp(%lums) state(%s)",
+ " ",
+ stuff->sequenceNumber,
+ stuff->timestamp,
+ state);
+ }
+
return reply;
}
stuff->window,
stuff->provider);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d) timestamp(%lums)",
+ stuff->sequenceNumber,
+ stuff->timestamp);
+ }
+
return reply;
}
REPLY (" Atom");
reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *state;
+ char dstate[10];
+
+ switch (stuff->state)
+ {
+ case PropertyNewValue: state = "PropertyNewValue"; break;
+ case PropertyDelete: state = "PropertyDelete"; break;
+ default: state = dstate; sprintf (dstate, "%d", stuff->state); break;
+ }
+
+ REPLY (" sequence_num(%d) timestamp(%lums) state(%s)",
+ stuff->sequenceNumber,
+ stuff->timestamp,
+ state);
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d) timestamp(%lums)",
+ stuff->sequenceNumber,
+ stuff->timestamp);
+ }
+
return reply;
}
}
static char *
-_EvlogReplyRandr (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyRandr (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
char temp[64] = {0, };
int i;
+ names[nbytesNames] = '\0';
+
REPLY ("Crtcs");
REPLY ("(");
for (i = 0 ; i < nCrtcs ; i++)
case X_RRGetOutputInfo:
{
- static int nCrtcs, nModes, nPreferred, nClones;
+ static int nCrtcs, nModes, nPreferred, nClones, namelength;
if (evinfo->rep.isStart)
{
xRRGetOutputInfoReply *stuff = (xRRGetOutputInfoReply *)rep;
nModes = stuff->nModes;
nPreferred = stuff->nPreferred;
nClones = stuff->nClones;
+ namelength = stuff->nameLength;
}
else
{
char *name = (char *) (clones + nClones);
int i;
+ name[namelength] = '\0';
+
REPLY ("Crtcs");
REPLY ("(");
for (i = 0 ; i < nCrtcs ; i++)
#define UNKNOWN_EVENT "<unknown>"
char *
-xDbgEvlogReply (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+xDbgEvlogReply (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
extern ExtensionInfo Evlog_extensions[];
extern int Extensions_size;
if (rep.isStart)
REPLY ("%s", evinfo->rep.name);
- if(!on)
- return reply;
-
if (rep.reqType < EXTENSION_BASE)
{
- return xDbgEvlogReplyCore (evinfo, reply, len);
+ return xDbgEvlogReplyCore (evinfo, detail_level, reply, len);
}
else
{
{
if (rep.reqType == Evlog_extensions[i].opcode)
{
- return Evlog_extensions[i].rep_func (evinfo, reply, len);
+ return Evlog_extensions[i].rep_func (evinfo, detail_level, reply, len);
}
}
}
#include "xdbg_types.h"
-char * xDbgEvlogReply (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+char * xDbgEvlogReply (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
#endif
char *conn[] = {"Initial Connect", "Establich Connect"};
char *
-xDbgEvlogReqeust (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+xDbgEvlogReqeust (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
extern ExtensionInfo Evlog_extensions[];
extern int Extensions_size;
REPLY ("%s", evinfo->req.name);
- if(!on)
- return reply;
-
for (i = 0 ; i < sizeof(conn) / sizeof(char *) ; i++)
if (!strcmp(evinfo->req.name, conn[i]))
return reply;
if (xReq->reqType < EXTENSION_BASE)
{
- return xDbgEvlogRequestCore (evinfo, reply, len);
+ return xDbgEvlogRequestCore (evinfo, detail_level, reply, len);
}
else
{
{
if (xReq->reqType == Evlog_extensions[i].opcode)
{
- return Evlog_extensions[i].req_func (evinfo, reply, len);
+ return Evlog_extensions[i].req_func (evinfo, detail_level, reply, len);
}
}
}
#include "xdbg_types.h"
-char * xDbgEvlogReqeust (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+char * xDbgEvlogReqeust (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
#endif
#include "xdbg_evlog.h"
static char *
-_EvlogRequestXextDpms(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextDpms(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
static char *
-_EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextShm (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
case X_ShmPutImage:
{
xShmPutImageReq *stuff = (xShmPutImageReq *)req;
- REPLY (": XID(0x%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
+ REPLY (": XID(0x%lx) gc(0x%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
stuff->drawable,
+ stuff->gc,
stuff->totalWidth,
stuff->totalHeight,
stuff->srcX,
stuff->dstX,
stuff->dstY);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *format;
+ char dformat[10];
+
+ switch (stuff->format)
+ {
+ case XYBitmap: format = "XYBitmap"; break;
+ case XYPixmap: format = "XYPixmap"; break;
+ case ZPixmap: format = "ZPixmap"; break;
+ default: format = dformat; sprintf (dformat, "%d", stuff->format); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s depth(%d) format(%s) send_event(%s) shmseg(0x%lx) offset(%ld)",
+ " ",
+ stuff->depth,
+ format,
+ stuff->sendEvent ? "YES" : "NO",
+ stuff->shmseg,
+ stuff->offset);
+ }
+
return reply;
}
stuff->x,
stuff->y);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *format;
+ char dformat[10];
+
+ switch (stuff->format)
+ {
+ case XYBitmap: format = "XYBitmap"; break;
+ case XYPixmap: format = "XYPixmap"; break;
+ case ZPixmap: format = "ZPixmap"; break;
+ default: format = dformat; sprintf (dformat, "%d", stuff->format); break;
+ }
+
+ REPLY ("\n");
+ REPLY ("%67s format(%s) plain_mask(0x%lx) shmseg(0x%lx) offset(%ld)",
+ " ",
+ format,
+ stuff->planeMask,
+ stuff->shmseg,
+ stuff->offset);
+ }
+
return reply;
}
stuff->width,
stuff->height);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s depth(%d) shmseg(0x%lx) offset(%ld)",
+ " ",
+ stuff->depth,
+ stuff->shmseg,
+ stuff->offset);
+ }
+
return reply;
}
}
static char *
-_EvlogRequestXextSync(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextSync(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
}
static char *
-_EvlogRequestXextXtestExt1(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextXtestExt1(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
static char *
-_EvlogRequestXextXtest(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextXtest(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
stuff->rootX,
stuff->rootY);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" type(%d) detail(%d) time(%lums) device_id(%d)",
+ stuff->type,
+ stuff->detail,
+ stuff->time,
+ stuff->deviceid);
+ }
+
return reply;
}
{
xXTestGrabControlReq *stuff = (xXTestGrabControlReq *)req;
REPLY (": Impervious(%s)" ,
- (stuff->impervious)? "TRUE" : "FALSE");
+ (stuff->impervious)? "YES" : "NO");
return reply;
}
static char *
-_EvlogEventXextDpms (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextDpms (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
+#if 0
xEvent *evt = evinfo->evt.ptr;
switch ((evt->u.u.type & 0x7F) - first_base)
default:
break;
}
-
+#endif
return reply;
}
static char *
-_EvlogEventXextShm (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextShm (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
REPLY (": XID(0x%lx)",
stuff->drawable);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d) major_event(%d) minor_event(%d) shmseg(0x%lx) offset(%ld)",
+ stuff->sequenceNumber,
+ stuff->majorEvent,
+ stuff->minorEvent,
+ stuff->shmseg,
+ stuff->offset);
+ }
return reply;
}
static char *
-_EvlogEventXextSync (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextSync (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
stuff->counter_value_hi,
stuff->counter_value_lo);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s sequence_num(%d) time(%lums) count(%d) destroyed(%s)",
+ " ",
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->count,
+ stuff->destroyed ? "YES" : "NO");
+ }
+
return reply;
}
stuff->alarm_value_hi,
stuff->alarm_value_lo);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s sequence_num(%d) time(%lums) state(%d)",
+ " ",
+ stuff->sequenceNumber,
+ stuff->time,
+ stuff->state);
+ }
+
return reply;
}
static char *
-_EvlogEventXextXtestExt1 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextXtestExt1 (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
}
static char *
-_EvlogEventXextXtest (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextXtest (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
static char *
-_EvlogReplyXextDpms (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextDpms (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
if (evinfo->rep.isStart)
{
xDPMSGetTimeoutsReply *stuff = (xDPMSGetTimeoutsReply *)rep;
- REPLY (": Standby(%d) Suspend(%d) off(%d)",
+ REPLY (": Standby(%usec) Suspend(%usec) off(%usec) sequence_num(%d)",
stuff->standby,
stuff->suspend,
- stuff->off);
+ stuff->off,
+ stuff->sequenceNumber);
}
else
{
}
static char *
-_EvlogReplyXextShm (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextShm (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
if (evinfo->rep.isStart)
{
xShmGetImageReply *stuff = (xShmGetImageReply *)rep;
- REPLY (": Visual(0x%lx) size(%ld)",
+ REPLY (": Visual(0x%lx) size(%ld) sequence_num(%d)",
stuff->visual,
- stuff->size);
+ stuff->size,
+ stuff->sequenceNumber);
}
else
{
}
static char *
-_EvlogReplyXextSync (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextSync (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
if (evinfo->rep.isStart)
{
xSyncQueryCounterReply *stuff = (xSyncQueryCounterReply *)rep;
- REPLY (": Value(0x%lx/0x%lx)",
+ REPLY (": Value(0x%lx/0x%lx) sequence_num(%d)",
stuff->value_hi,
- stuff->value_lo);
+ stuff->value_lo,
+ stuff->sequenceNumber);
}
else
{
}
static char *
-_EvlogReplyXextXtestExt1 (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextXtestExt1 (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
if (evinfo->rep.isStart)
{
xTestQueryInputSizeReply *stuff = (xTestQueryInputSizeReply *)rep;
- REPLY (": sizeReturn(0x%lx)",
- stuff->size_return);
+ REPLY (": sizeReturn(0x%lx) sequence_num(%d)",
+ stuff->size_return,
+ stuff->sequenceNumber);
}
else
{
}
static char *
-_EvlogReplyXextXtest (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextXtest (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
if (evinfo->rep.isStart)
{
xXTestGetVersionReply *stuff = (xXTestGetVersionReply *)rep;
- REPLY (": MinorVersion(%d)",
- stuff->minorVersion);
+ REPLY (": MinorVersion(%d) sequence_num(%d)",
+ stuff->minorVersion,
+ stuff->sequenceNumber);
}
else
{
#include "xdbg_evlog.h"
static char *
-_EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
+_getMode(CARD8 mode, char *reply, int *len)
+{
+ const char* buf;
+ char dbuf[10];
+
+ switch (mode)
+ {
+ case XIGrabModeSync: buf = "XIGrabModeSync"; break;
+ case XIGrabModeAsync: buf = "XIGrabModeAsync"; break;
+ case XIGrabModeTouch: buf = "XIGrabModeTouch"; break;
+ default: buf = dbuf; sprintf (dbuf, "%d", mode); break;
+ }
+
+ REPLY ("%s", buf);
+
+ return reply;
+}
+
+static char *
+_EvlogRequestXinput (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
case X_GrabDevice:
{
xGrabDeviceReq *stuff = (xGrabDeviceReq *)req;
- REPLY (": XID(0x%lx) Time(0x%lx) evtCnt(%d) thisMode(%d) otherMode(%d) devID(%d)",
+ REPLY (": XID(0x%lx) device_ID(%d)",
stuff->grabWindow,
- stuff->time,
- stuff->event_count,
- stuff->this_device_mode,
- stuff->other_devices_mode,
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" this_dev_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->this_device_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" other_dev_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->other_devices_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" time(%lums) evt_cnt(%d) owner_events(%s)",
+ stuff->time,
+ stuff->event_count,
+ stuff->ownerEvents ? "YES" : "NO");
+ }
+
return reply;
}
case X_UngrabDevice:
{
xUngrabDeviceReq *stuff = (xUngrabDeviceReq *)req;
- REPLY (": Time(0x%lx) devID(%d)",
- stuff->time,
+ REPLY (": device_ID(%d)",
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ stuff->time);
+ }
+
return reply;
}
case X_GrabDeviceKey:
{
xGrabDeviceKeyReq *stuff = (xGrabDeviceKeyReq *)req;
- REPLY (": XID(0x%lx) evtCnt(%d) modifiers(%d) modDev(%d) grabDev(%d) key(%d)",
- stuff->grabWindow,
- stuff->event_count,
- stuff->modifiers,
- stuff->modifier_device,
- stuff->grabbed_device,
- stuff->key);
+ REPLY (": XID(0x%lx)",
+ stuff->grabWindow);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" evt_cnt(%d) modifiers(%d) mod_dev(%d) grab_dev(%d) key(%d)",
+ stuff->event_count,
+ stuff->modifiers,
+ stuff->modifier_device,
+ stuff->grabbed_device,
+ stuff->key);
+
+ REPLY ("\n");
+ REPLY ("%67s this_dev_mode",
+ " ");
+
+ REPLY ("(");
+ reply = _getMode(stuff->this_device_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" other_dev_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->other_devices_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" owner_events(%s)",
+ stuff->ownerEvents ? "YES" : "NO");
+ }
return reply;
}
case X_UngrabDeviceKey:
{
xUngrabDeviceKeyReq *stuff = (xUngrabDeviceKeyReq *)req;
- REPLY (": XID(0x%lx) modifiers(%d) modDev(%d) key(%d) grabDev(%d)",
- stuff->grabWindow,
- stuff->modifiers,
- stuff->modifier_device,
- stuff->key,
- stuff->grabbed_device);
+ REPLY (": XID(0x%lx)",
+ stuff->grabWindow);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" modifiers(%d) mod_dev(%d) grab_dev(%d) key(%d)",
+ stuff->modifiers,
+ stuff->modifier_device,
+ stuff->grabbed_device,
+ stuff->key);
+ }
return reply;
}
case X_GrabDeviceButton:
{
xGrabDeviceButtonReq *stuff = (xGrabDeviceButtonReq *)req;
- REPLY (": XID(0x%lx) evtCnt(%d) modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
- stuff->grabWindow,
- stuff->event_count,
- stuff->modifiers,
- stuff->modifier_device,
- stuff->grabbed_device,
- stuff->button);
+ REPLY (": XID(0x%lx))",
+ stuff->grabWindow);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" grab_dev(%d) mod_dev(%d) evt_cnt(%d) modifiers(%d) button(%d)",
+ stuff->grabbed_device,
+ stuff->modifier_device,
+ stuff->event_count,
+ stuff->modifiers,
+ stuff->button);
+
+ REPLY ("\n");
+ REPLY ("%67s this_dev_mode",
+ " ");
+ REPLY ("(");
+ reply = _getMode(stuff->this_device_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" other_dev_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->other_devices_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" owner_events(%s)",
+ stuff->ownerEvents ? "YES" : "NO");
+ }
return reply;
}
case X_UngrabDeviceButton:
{
xUngrabDeviceButtonReq *stuff = (xUngrabDeviceButtonReq *)req;
- REPLY (": XID(0x%lx) modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
- stuff->grabWindow,
- stuff->modifiers,
- stuff->modifier_device,
- stuff->grabbed_device,
- stuff->button);
+ REPLY (": XID(0x%lx)",
+ stuff->grabWindow);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
+ stuff->modifiers,
+ stuff->modifier_device,
+ stuff->grabbed_device,
+ stuff->button);
+ }
return reply;
}
case X_AllowDeviceEvents:
{
xAllowDeviceEventsReq *stuff = (xAllowDeviceEventsReq *)req;
- REPLY (": Time(0x%lx) devID(%d) mode(%d)",
+ REPLY (": device_ID(%d)",
+ stuff->deviceid);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums) mode(%d)",
stuff->time,
- stuff->deviceid,
stuff->mode);
+ }
return reply;
}
case X_SetDeviceFocus:
{
xSetDeviceFocusReq *stuff = (xSetDeviceFocusReq *)req;
- REPLY (": XID(0x%lx) Time(0x%lx) revertTo(%d) devID(%d)",
+ REPLY (": XID(0x%lx) dev_ID(%d)",
stuff->focus,
- stuff->time,
- stuff->revertTo,
stuff->device);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums) revertTo(%d)",
+ stuff->time,
+ stuff->revertTo);
+ }
+
return reply;
}
case X_XIWarpPointer:
{
xXIWarpPointerReq *stuff = (xXIWarpPointerReq *)req;
- REPLY (": srcWIN(0x%x) dstWin(0x%x) src(%d,%d %dx%d) dst(%d,%d) devID(%d)",
+ REPLY (": srcWIN(0x%x) dstWin(0x%x) src(%d,%d %dx%d) dst(%d,%d) device_ID(%d)",
stuff->src_win,
stuff->dst_win,
stuff->src_x,
case X_XISetClientPointer:
{
xXISetClientPointerReq *stuff = (xXISetClientPointerReq *)req;
- REPLY (": XID(0x%x) devID(%d)",
+ REPLY (": XID(0x%x) device_ID(%d)",
stuff->win,
stuff->deviceid);
REPLY (": XID(0x%x)",
stuff->win);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" num_masks(%d)",
+ stuff->num_masks);
+ }
+
return reply;
}
case X_XIQueryVersion:
{
xXIQueryVersionReq *stuff = (xXIQueryVersionReq *)req;
- REPLY (": majorVesion(%d) minorVesion(%d)",
+ REPLY (": major_vesion(%d) minor_vesion(%d)",
stuff->major_version,
stuff->minor_version);
case X_XIQueryDevice:
{
xXIQueryDeviceReq *stuff = (xXIQueryDeviceReq *)req;
- REPLY (": devID(%d)",
+ REPLY (": device_ID(%d)",
stuff->deviceid);
return reply;
case X_XISetFocus:
{
xXISetFocusReq *stuff = (xXISetFocusReq *)req;
- REPLY (": XID(0x%x) Time(0x%x) devID(%d)",
+ REPLY (": XID(0x%x) device_ID(%d)",
stuff->focus,
- stuff->time,
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%ums)",
+ stuff->time);
+ }
+
return reply;
}
case X_XIGrabDevice:
{
xXIGrabDeviceReq *stuff = (xXIGrabDeviceReq *)req;
- REPLY (": XID(0x%x) Time(0x%x) Cursor(0x%x) grabMode(%d) pairDevMode(%d) devID(%d)",
+ REPLY (": XID(0x%x) Cursor(0x%x) device_ID(%d)",
stuff->grab_window,
- stuff->time,
stuff->cursor,
- stuff->grab_mode,
- stuff->paired_device_mode,
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s grab_mode",
+ " ");
+ REPLY ("(");
+ reply = _getMode(stuff->grab_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" paired_device_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->paired_device_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" time(%ums) owner_events(%s)",
+ stuff->time,
+ stuff->owner_events ? "YES" : "NO");
+ }
+
return reply;
}
case X_XIUngrabDevice:
{
xXIUngrabDeviceReq *stuff = (xXIUngrabDeviceReq *)req;
- REPLY (": Time(0x%x) devID(%d)",
- stuff->time,
+ REPLY (": devID(%d)",
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%ums)",
+ stuff->time);
+ }
+
return reply;
}
case X_XIAllowEvents:
{
xXIAllowEventsReq *stuff = (xXIAllowEventsReq *)req;
- REPLY (": Time(0x%x) devID(%d) mode(%d)",
+ REPLY (": devID(%d)",
+ stuff->deviceid);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%ums) mode(%d)",
stuff->time,
- stuff->deviceid,
stuff->mode);
+ }
return reply;
}
case X_XIPassiveGrabDevice:
{
xXIPassiveGrabDeviceReq *stuff = (xXIPassiveGrabDeviceReq *)req;
- REPLY (": XID(0x%x) Time(0x%x) Cursor(0x%x) detail(0x%x) grabType(%d) grabMode(%d) pairDevMode(%d)",
+ REPLY (": XID(0x%x) Cursor(0x%x) device_ID(%d)",
stuff->grab_window,
- stuff->time,
stuff->cursor,
+ stuff->deviceid);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char * type;
+ char dtype[10];
+
+ switch(stuff->grab_type)
+ {
+ case XIGrabtypeButton: type = "XIGrabtypeButton"; break;
+ case XIGrabtypeKeycode: type = "XIGrabtypeKeycode"; break;
+ case XIGrabtypeEnter: type = "XIGrabtypeEnter"; break;
+ case XIGrabtypeFocusIn: type = "XIGrabtypeFocusIn"; break;
+ case XIGrabtypeTouchBegin: type = "XIGrabtypeTouchBegin"; break;
+ default: type = dtype; sprintf (dtype, "%d", stuff->grab_type); break;
+ }
+
+ REPLY (" time(%ums) detail(%d) grab_type(%s)",
+ stuff->time,
stuff->detail,
- stuff->grab_type,
- stuff->grab_mode,
- stuff->paired_device_mode);
+ type);
+
+ REPLY ("\n");
+ REPLY ("%67s", " ");
+
+ REPLY (" grab_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->grab_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" paired_device_mode");
+ REPLY ("(");
+ reply = _getMode(stuff->paired_device_mode, reply, len);
+ REPLY (")");
+
+ REPLY (" num_modifier(%d) owner_events(%s)",
+ stuff->num_modifiers,
+ stuff->owner_events ? "YES" : "NO");
+
+ }
return reply;
}
case X_XIPassiveUngrabDevice:
{
xXIPassiveUngrabDeviceReq *stuff = (xXIPassiveUngrabDeviceReq *)req;
- REPLY (": XID(0x%x) detail(0x%x) grabType(%d) devID(%d)",
+ REPLY (": XID(0x%x) device_ID(%d)",
stuff->grab_window,
- stuff->detail,
- stuff->grab_type,
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char * type;
+ char dtype[10];
+
+ switch(stuff->grab_type)
+ {
+ case XIGrabtypeButton: type = "XIGrabtypeButton"; break;
+ case XIGrabtypeKeycode: type = "XIGrabtypeKeycode"; break;
+ case XIGrabtypeEnter: type = "XIGrabtypeEnter"; break;
+ case XIGrabtypeFocusIn: type = "XIGrabtypeFocusIn"; break;
+ case XIGrabtypeTouchBegin: type = "XIGrabtypeTouchBegin"; break;
+ default: type = dtype; sprintf (dtype, "%d", stuff->grab_type); break;
+ }
+
+ REPLY (" detail(%d) grab_type(%s) num_modifiers(%d)",
+ stuff->detail,
+ type,
+ stuff->num_modifiers);
+ }
+
return reply;
}
case X_XIChangeProperty:
{
xXIChangePropertyReq *stuff = (xXIChangePropertyReq *)req;
- REPLY (": devID(%d) mode(%d) format(%d) numItems(%d)",
- stuff->deviceid,
- stuff->mode,
- stuff->format,
- stuff->num_items);
+ REPLY (": devID(%d)",
+ stuff->deviceid);
REPLY (" Property");
reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
REPLY (" Type");
reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char * mode;
+ char dmode[10];
+
+ switch(stuff->mode)
+ {
+ case XIPropModeReplace: mode = "XIPropModeReplace"; break;
+ case XIPropModePrepend: mode = "XIPropModePrepend"; break;
+ case XIPropModeAppend: mode = "XIPropModeAppend"; break;
+ default: mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+ }
+
+ REPLY (" mode(%s) format(%d) num_items(%d)",
+ mode,
+ stuff->format,
+ stuff->num_items);
+ }
+
return reply;
}
REPLY (" Type");
reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" delete(%s) offset(%u) length(%u)",
+ stuff->delete ? "YES" : "NO",
+ stuff->offset,
+ stuff->len);
+ }
+
return reply;
}
}
static char *
-_EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXinput (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
case XI_DeviceValuator:
{
deviceValuator *stuff = (deviceValuator *) evt;
- REPLY (": numValuator(%d) fstnumValuator(%d)",
+ REPLY (": device_ID(%d) numValuator(%d) fstnumValuator(%d)",
+ stuff->deviceid,
stuff->num_valuators,
stuff->first_valuator);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ int i;
+
+ REPLY (" sequence_num(%d) device_state(0x%x)\n",
+ stuff->sequenceNumber,
+ stuff->device_state);
+
+ REPLY ("%67s", " ");
+ for (i = 0 ; i < stuff->num_valuators ; i++)
+ {
+ REPLY (" valuator%d(%ld)",
+ i,
+ *(&stuff->valuator0 + i));
+ }
+ }
+
return reply;
}
case XI_DeviceKeyPress:
{
XDeviceKeyPressedEvent *stuff = (XDeviceKeyPressedEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) key_code(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->keycode,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
case XI_DeviceKeyRelease:
{
XDeviceKeyReleasedEvent *stuff = (XDeviceKeyReleasedEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) key_code(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->keycode,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
case XI_DeviceButtonPress:
{
XDeviceButtonPressedEvent *stuff = (XDeviceButtonPressedEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) button(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->button,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
case XI_DeviceButtonRelease:
{
XDeviceButtonReleasedEvent *stuff = (XDeviceButtonReleasedEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) button(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->button,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
case XI_DeviceMotionNotify:
{
XDeviceMotionEvent *stuff = (XDeviceMotionEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) is_hint(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->is_hint,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
stuff->deviceid,
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *mode, *detail;
+ char dmode[10], ddetail[10];
+
+ switch(stuff->mode)
+ {
+ case NotifyNormal: mode = "NotifyNormal"; break;
+ case NotifyGrab: mode = "NotifyGrab"; break;
+ case NotifyUngrab: mode = "NotifyUngrab"; break;
+ case NotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break;
+ default: mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+ }
+
+ switch(stuff->detail)
+ {
+ case NotifyAncestor: detail = "NotifyAncestor"; break;
+ case NotifyVirtual: detail = "NotifyVirtual"; break;
+ case NotifyInferior: detail = "NotifyInferior"; break;
+ case NotifyNonlinear: detail = "NotifyNonlinear"; break;
+ case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break;
+ case NotifyPointer: detail = "NotifyPointer"; break;
+ case NotifyPointerRoot: detail = "NotifyPointerRoot"; break;
+ case NotifyDetailNone: detail = "NotifyDetailNone"; break;
+ default: detail = ddetail; sprintf (ddetail, "%d", stuff->detail); break;
+ }
+
+ REPLY (" mode(%s) detail(%s) time(%lums)",
+ mode,
+ detail,
+ stuff->time);
+ }
+
return reply;
}
stuff->deviceid,
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *mode, *detail;
+ char dmode[10], ddetail[10];
+
+ switch(stuff->mode)
+ {
+ case NotifyNormal: mode = "NotifyNormal"; break;
+ case NotifyGrab: mode = "NotifyGrab"; break;
+ case NotifyUngrab: mode = "NotifyUngrab"; break;
+ case NotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break;
+ default: mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+ }
+
+ switch(stuff->detail)
+ {
+ case NotifyAncestor: detail = "NotifyAncestor"; break;
+ case NotifyVirtual: detail = "NotifyVirtual"; break;
+ case NotifyInferior: detail = "NotifyInferior"; break;
+ case NotifyNonlinear: detail = "NotifyNonlinear"; break;
+ case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break;
+ case NotifyPointer: detail = "NotifyPointer"; break;
+ case NotifyPointerRoot: detail = "NotifyPointerRoot"; break;
+ case NotifyDetailNone: detail = "NotifyDetailNone"; break;
+ default: detail = ddetail; sprintf (ddetail, "%d", stuff->detail); break;
+ }
+
+ REPLY (" mode(%s) detail(%s) time(%lums)",
+ mode,
+ detail,
+ stuff->time);
+ }
+
return reply;
}
case XI_ProximityIn:
{
XProximityInEvent *stuff = (XProximityInEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
case XI_ProximityOut:
{
XProximityOutEvent *stuff = (XProximityOutEvent *) evt;
- REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+ REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
stuff->deviceid,
stuff->window,
+ stuff->x,
+ stuff->y,
stuff->root,
+ stuff->x_root,
+ stuff->y_root,
stuff->subwindow);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s time(%lums) state(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+ " ",
+ stuff->time,
+ stuff->state,
+ stuff->same_screen ? "YES" : "NO",
+ stuff->device_state,
+ stuff->first_axis);
+ }
+
return reply;
}
stuff->deviceid,
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums) num_classes(%d)",
+ stuff->time,
+ stuff->num_classes);
+ }
+
return reply;
}
stuff->deviceid,
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *request;
+ char drequest[10];
+
+ switch(stuff->request)
+ {
+ case MappingModifier: request = "MappingModifier"; break;
+ case MappingKeyboard: request = "MappingKeyboard"; break;
+ case MappingPointer: request = "MappingPointer"; break;
+ default: request = drequest; sprintf (drequest, "%d", stuff->request); break;
+ }
+
+ REPLY (" time(%lums) request(%s) first_keycode(%d) count(%d)",
+ stuff->time,
+ request,
+ stuff->first_keycode,
+ stuff->count);
+ }
+
return reply;
}
stuff->deviceid,
stuff->window);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ const char *request;
+ char drequest[10];
+
+ switch(stuff->request)
+ {
+ case NewPointer: request = "NewPointer"; break;
+ case NewKeyboard: request = "NewKeyboard"; break;
+ default: request = drequest; sprintf (drequest, "%d", stuff->request); break;
+ }
+
+ REPLY (" time(%lums) request(%s)",
+ stuff->time,
+ request);
+ }
+
return reply;
}
REPLY (": deviceid(%d)",
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d)",
+ stuff->sequenceNumber);
+ }
+
return reply;
}
REPLY (": deviceid(%d)",
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" sequence_num(%d)",
+ stuff->sequenceNumber);
+ }
+
return reply;
}
REPLY (": deviceid(%d)",
stuff->deviceid);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums) device_change(%d) control(%d) sequence_num(%d)",
+ stuff->time,
+ stuff->devchange,
+ stuff->control,
+ stuff->sequenceNumber);
+ }
+
return reply;
}
REPLY (" Atom");
reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums) state(%d) sequence_num(%d)",
+ stuff->time,
+ stuff->state,
+ stuff->sequenceNumber);
+ }
+
return reply;
}
}
static char *
-_EvlogReplyXinput (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXinput (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
#include "xdbg_evlog.h"
static char *
-_EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXv(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xReq *req = evinfo->req.ptr;
REPLY (": XID(0x%lx)",
stuff->port);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ stuff->time);
+ }
+
return reply;
}
REPLY (": XID(0x%lx)",
stuff->port);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" time(%lums)",
+ stuff->time);
+ }
+
return reply;
}
case xv_SelectVideoNotify:
{
xvSelectVideoNotifyReq *stuff = (xvSelectVideoNotifyReq *)req;
- REPLY (": XID(0x%lx) On/Off(%d)",
- stuff->drawable,
- stuff->onoff);
+ REPLY (": XID(0x%lx)",
+ stuff->drawable);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" On/Off(%s)",
+ stuff->onoff ? "ON" : "OFF");
+ }
return reply;
}
case xv_SelectPortNotify:
{
xvSelectPortNotifyReq *stuff = (xvSelectPortNotifyReq *)req;
- REPLY (": XID(0x%lx) On/Off(%d)",
- stuff->port,
- stuff->onoff);
+ REPLY (": XID(0x%lx)",
+ stuff->port);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" On/Off(%s)",
+ stuff->onoff ? "ON" : "OFF");
+ }
return reply;
}
stuff->drw_w,
stuff->drw_h);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" motion(%d)",
+ stuff->motion);
+ }
+
return reply;
}
case xv_SetPortAttribute:
{
xvSetPortAttributeReq *stuff = (xvSetPortAttributeReq *)req;
- REPLY (": XID(0x%lx) value(%ld)",
- stuff->port,
- stuff->value);
+ REPLY (": XID(0x%lx) ",
+ stuff->port);
REPLY (" Attribute");
reply = xDbgGetAtom(stuff->attribute, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" value(%ld)",
+ stuff->value);
+ }
+
return reply;
}
case xv_ShmPutImage:
{
xvShmPutImageReq *stuff = (xvShmPutImageReq *)req;
- REPLY (": XID(0x%lx) Drawable(0x%lx) GC(0x%lx) ID(%lx) buf(%dx%d) src(%d,%d %dx%d) drw(%d,%d %dx%d) sendevent(%d)",
+ REPLY (": XID(0x%lx) Drawable(0x%lx) GC(0x%lx) ID(%lx) buf(%dx%d) src(%d,%d %dx%d) drw(%d,%d %dx%d)",
stuff->port,
stuff->drawable,
stuff->gc,
stuff->drw_x,
stuff->drw_y,
stuff->drw_w,
- stuff->drw_h,
- stuff->send_event);
+ stuff->drw_h);
+
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY ("\n");
+ REPLY ("%67s shmseg(0x%lx) offset(%ld) send_event(%s)",
+ " ",
+ stuff->shmseg,
+ stuff->offset,
+ stuff->send_event ? "YES" : "NO");
+ }
return reply;
}
}
static char *
-_EvlogEventXv (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXv (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
{
xEvent *evt = evinfo->evt.ptr;
case XvVideoNotify:
{
XvVideoNotifyEvent *stuff = (XvVideoNotifyEvent *) evt;
- REPLY (": XID(0x%lx) reason(%ld) portID(0x%lx)",
+ REPLY (": XID(0x%lx) portID(0x%lx)",
stuff->drawable,
- stuff->reason,
stuff->port_id);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" serial(%lu) reason(%lu) time(%lums)",
+ stuff->serial,
+ stuff->reason,
+ stuff->time);
+ }
+
return reply;
}
REPLY (" Attribute");
reply = xDbgGetAtom(stuff->attribute, evinfo, reply, len);
+ if (detail_level >= EVLOG_PRINT_DETAIL)
+ {
+ REPLY (" serial(%lu) value(%ld) time(%lums)",
+ stuff->serial,
+ stuff->value,
+ stuff->time);
+ }
+
return reply;
}
}
static char *
-_EvlogReplyXv (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXv (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
{
xGenericReply *rep = evinfo->rep.ptr;
#define EVLOG_MASK_ATOM (1<<5)
#define EVLOG_MASK_REGION (1<<6)
+#define EVLOG_PRINT_DEFAULT 0
+#define EVLOG_PRINT_DETAIL 1
+#define EVLOG_PRINT_REPLY_DETAIL 2
+
typedef struct _EvlogTable
{
int opcode;
int evt_base;
int err_base;
- char* (*req_func) (EvlogInfo *evinfo, char *reply, int *len);
- char* (*evt_func) (EvlogInfo *evinfo, int first_base, char *reply, int *len);
- char* (*rep_func) (EvlogInfo *evinfo, char *reply, int *len);
+ char* (*req_func) (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
+ char* (*evt_func) (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len);
+ char* (*rep_func) (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
};
#endif
dlog_enable = (enable > 0) ? TRUE:FALSE;
}
+API Bool
+xDbgGetLogEnableDlog ()
+{
+ return dlog_enable;
+}
+
API void*
xDbgLog (unsigned int module, int logoption, const char * file, int line, const char * f, ...)
{
#include <os.h>
#include <dlog.h>
+
unsigned int xDbgLogGetModule (char *name);
+Bool xDbgGetLogEnableDlog ();
#define _C(b,s) (((b) >> (s)) & 0xFF)
#define _B(c,s) ((((unsigned int)(c)) & 0xff) << (s))
if (argc != 3)
{
- XDBG_REPLY ("Error : too few arguments\n");
+ XDBG_REPLY ("DLog level: %d\n", xDbgGetLogEnableDlog() ? 1 : 0);
return;
}
_CommandEvlog (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
{
int on;
+ extern Bool xev_trace_on;
if (argc != 3)
{
- XDBG_REPLY ("Error : too few arguments\n");
+ XDBG_REPLY ("Evlog level: %d\n", xev_trace_on ? 1 : 0);
return;
}
}
static void
+_CommandEvlogDetail (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
+{
+ int level;
+ extern int xev_trace_detail_level;
+
+ if (argc != 3)
+ {
+ XDBG_REPLY ("Detail Level: %d\n", xev_trace_detail_level);
+ return;
+ }
+
+ level = atoi(argv[2]);
+
+ xDbgModuleEvlogDetail (pMod, level, reply, len);
+ XDBG_REPLY ("Success\n");
+}
+
+static void
_CommandSetEvlogRule (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
{
if (argc < 2)
},
{
+ "evlog_detail", "to set printing detail log level", "[0-2]",
+ NULL, "[Primary logs:0/ More detail logs:1/ Supplementary Reply logs:2]",
+ _CommandEvlogDetail
+ },
+
+ {
"evlog_rule", "to set evlog rules", "[add/remove/print]",
NULL, "[add allow/deny rules / remove (index) / print]",
_CommandSetEvlogRule
#define FP1616toDBL(x) ((x) * 1.0 / (1 << 16))
-static Bool xev_trace_on = FALSE;
+Bool xev_trace_on = FALSE;
+int xev_trace_detail_level = EVLOG_PRINT_DEFAULT;
static int xev_trace_fd = -1;
static int xev_trace_record_fd = -1;
static Atom atom_rotate = None;
if (xev_trace_record_fd >= 0)
{
- xDbgEvlogFillLog (&evinfo, TRUE, NULL, NULL);
- evtRecord (xev_trace_record_fd, &evinfo);
+ if (xDbgEvlogFillLog (&evinfo, EVLOG_PRINT_REPLY_DETAIL, NULL, NULL))
+ evtRecord (xev_trace_record_fd, &evinfo);
}
else
{
char log[1024];
int size = sizeof (log);
- xDbgEvlogFillLog (&evinfo, TRUE, log, &size);
- evtPrintF (xev_trace_fd, &evinfo, log);
+ if (xDbgEvlogFillLog (&evinfo, xev_trace_detail_level, log, &size))
+ evtPrintF (xev_trace_fd, &evinfo, log);
}
/* evatom initialize */
return;
}
+void
+xDbgModuleEvlogDetail (XDbgModule *pMod, int level, char *reply, int *len)
+{
+ xev_trace_detail_level = level;
+}
+
int
xDbgModuleEvlogInfoSetRule (XDbgModule *pMod, const int argc, const char ** argv, char *reply, int *len)
{
void xDbgModuleEvlogUninstallHooks (XDbgModule *pMod);
void xDbgModuleEvlogPrintEvents (XDbgModule *pMod, Bool on, const char * client_name, char *reply, int *len);
+void xDbgModuleEvlogDetail (XDbgModule *pMod, int level, char *reply, int *len);
int xDbgModuleEvlogInfoSetRule (XDbgModule *pMod, const int argc, const char ** argv, char *reply, int *len);
Bool xDbgModuleEvlogSetEvlogPath (XDbgModule *pMod, int pid, char *path, char *reply, int *len);