summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-07-18 21:00:48 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-08-01 20:18:35 +0300
commita10c459b06a32d490d3659bef600d1d378fe870b (patch)
tree10e40ab41db716871763511d909fe0bc5860135c
parent14d29799d15db2bdf1255b2f99e43dd6a4bd973a (diff)
dix: introduce a hack for logging server workloadregistry-fix
It logs X11 requests and their time spent being processed, writing in a file (xserver-requests.txt). Also the input processing is recorded (INPUTPROCESSING). This all can be used for characterization of the workload. X Registery code is used to get the name (parsing protocol.txt). TODO: see if this commit is overlapping somehow X Record Extension and cnee (seems it's tied with the core protocol only and doesn't record extensions). Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r--dix/dispatch.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 17f308cf5..5f2fad1b2 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -348,6 +348,9 @@ Dispatch(void)
HWEventQueuePtr* icheck = checkForInput;
long start_tick;
+ FILE *fd;
+ fd = fopen("xserver-requests.txt","a+");
+
nextFreeClientID = 1;
nClients = 0;
@@ -360,7 +363,11 @@ Dispatch(void)
{
if (*icheck[0] != *icheck[1])
{
+ int a, b;
+ a = GetTimeInMillis();
ProcessInputEvents();
+ b = GetTimeInMillis();
+ fprintf(fd, "INPUTPROCESSING:::%d\n", b - a);
FlushIfCriticalOutputPending();
}
@@ -396,8 +403,13 @@ Dispatch(void)
while (!isItTimeToYield)
{
if (*icheck[0] != *icheck[1])
- ProcessInputEvents();
-
+ {
+ int a, b;
+ a = GetTimeInMillis();
+ ProcessInputEvents();
+ b = GetTimeInMillis();
+ fprintf(fd, "INPUTPROCESSING:::%d\n", b - a);
+ }
FlushIfCriticalOutputPending();
if (!SmartScheduleDisable &&
(SmartScheduleTime - start_tick) >= SmartScheduleSlice)
@@ -423,6 +435,9 @@ Dispatch(void)
((xReq *)client->requestBuffer)->length,
client->index, client->requestBuffer);
#endif
+ int a, b;
+ a = GetTimeInMillis();
+
if (result > (maxBigRequestSize << 2))
result = BadLength;
else {
@@ -431,6 +446,11 @@ Dispatch(void)
result = (* client->requestVector[MAJOROP])(client);
XaceHookAuditEnd(client, result);
}
+
+ b = GetTimeInMillis();
+ fprintf(fd, "%s:%d:%d\n",
+ LookupRequestName(MAJOROP, MinorOpcodeOfRequest(client)),
+ MAJOROP, b - a);
#ifdef XSERVER_DTRACE
XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
client->sequence, client->index, result);
@@ -456,6 +476,7 @@ Dispatch(void)
}
dispatchException &= ~DE_PRIORITYCHANGE;
}
+ fclose(fd);
#if defined(DDXBEFORERESET)
ddxBeforeReset ();
#endif