# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-SUBDIRS = dbus lib module bin
+SUBDIRS = common lib module bin
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-SUBDIRS = xdbg
+SUBDIRS = xdbg xevlog_analyze
bin_PROGRAMS = xdbg
-xdbg_LDADD = $(XDBG_LIBS) ../../dbus/libdbus.la ../../lib/libxdbg-log.la
+xdbg_LDADD = $(XDBG_CLIENT_LIBS) ../../common/libcommon-client.la
xdbg_LDFLAGS = ${LDFLAGS}
xdbg_CFLAGS = \
${CFLAGS} \
- @XDBG_CFLAGS@ \
- -I$(top_srcdir)/dbus \
- -I$(top_srcdir)/lib
+ @XDBG_CLIENT_CFLAGS@ \
+ -I$(top_srcdir)/common
xdbg_sc_SOURCES = \
xdbg.c
#include <sys/mman.h>
#include <X11/Xlib.h>
-#include <xdbg.h>
#include "xdbg_dbus_client.h"
int main(int argc, char ** argv)
# Copyright 2013 Samsung Electronics co., Ltd. All Rights Reserved.
-#
+#
# Contact: Boram Park <boram1288.park@samsung.com>
-#
+#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# distribute, sub license, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
-#
+#
# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial portions
# of the Software.
-#
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-noinst_LTLIBRARIES = libdbus.la
+bin_PROGRAMS = xevlog_analyze
-libdbus_la_LIBADD = @XDBG_LIBS@
-libdbus_la_LDFLAGS = ${LDFLAGS}
-libdbus_la_CFLAGS = \
- ${CFLAGS} \
- @XDBG_CFLAGS@ \
- -I$(top_srcdir)/lib
+xevlog_analyze_LDADD = $(XDBG_CLIENT_LIBS) ../../common/libcommon-client.la
+xevlog_analyze_LDFLAGS = ${LDFLAGS}
+xevlog_analyze_CFLAGS = \
+ ${CFLAGS} \
+ @XDBG_CLIENT_CFLAGS@ \
+ -I$(top_srcdir)/common
-libdbus_la_SOURCES = \
- xdbg_dbus_server.c \
- xdbg_dbus_client.c
+xevlog_analyze_sc_SOURCES = \
+ xevlog_analyze.c
--- /dev/null
+/**************************************************************************
+
+xevlog-analyze
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+
+Contact: Boram Park <boram1288.park@samsung.com>
+ Sangjin LEE <lsj119@samsung.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xw32defs.h>
+#include <xdbg_types.h>
+#include <xdbg_evlog.h>
+
+typedef struct _EvlogOption
+{
+ int pid;
+ Bool help_opt;
+ char command_name[PATH_MAX+1];
+ char path_name[PATH_MAX+1];
+} EvlogOption;
+
+#define BUF_SIZE 256
+
+
+static void
+_printUsage(char* name)
+{
+ fprintf(stderr, "Usage: %s [OPTION]...\n", name);
+ fprintf(stderr, "\n");
+ fprintf(stderr, " Options:\n");
+ fprintf(stderr, " -f [File_Name] File to save information\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " -h Command Usage information\n");
+ fprintf(stderr, "\n");
+}
+
+static void _xEvlogAnalyzePrint (EvlogOption *eo)
+{
+ int fd = -1, cfd = -1;
+ int total, read_len;
+ int evlog_len;
+ char fd_name[256];
+ EvlogInfo evinfo={0,};
+
+ if (eo->help_opt)
+ {
+ _printUsage(eo->command_name);
+ return;
+ }
+
+ if (!eo->path_name)
+ {
+ printf ("failed: no evlog path\n");
+ return;
+ }
+
+ fd = open (eo->path_name, O_RDONLY);
+ if (fd < 0)
+ {
+ printf ("failed: open '%s'. (%s)\n", eo->path_name, strerror(errno));
+ return;
+ }
+
+ snprintf (fd_name, sizeof (fd_name), "/proc/%d/fd/1", eo->pid);
+ cfd = open (fd_name, O_RDWR);
+
+ if (cfd < 0)
+ {
+ printf ("failed: open consol '%s'. (%s)\n", fd_name, strerror(errno));
+ goto print_done;
+ }
+
+ while ((read_len = read (fd, &evlog_len, sizeof (int))) == sizeof (int))
+ {
+ char log[1024];
+ int size = sizeof (log);
+
+ total = read_len;
+
+ read_len = read (fd, &evinfo.time, sizeof (CARD32));
+ GOTO_IF_FAIL (read_len == sizeof (CARD32), print_done);
+ total += read_len;
+
+ read_len = read (fd, &evinfo.type, sizeof (EvlogType));
+ GOTO_IF_FAIL (read_len == sizeof (EvlogType), print_done);
+ GOTO_IF_FAIL (evinfo.type >= EVENT && evinfo.type <= FLUSH, print_done);
+ total += read_len;
+
+ read_len = read (fd, &evinfo.mask, sizeof (int));
+ GOTO_IF_FAIL (read_len == sizeof (int), print_done);
+ total += read_len;
+
+ if (evinfo.mask & EVLOG_MASK_CLIENT)
+ {
+ read_len = read (fd, &evinfo.client, sizeof (EvlogClient));
+ GOTO_IF_FAIL (read_len == sizeof (EvlogClient), print_done);
+ total += read_len;
+ }
+
+ if (evinfo.mask & EVLOG_MASK_REQUEST)
+ {
+ read_len = read (fd, &evinfo.req, sizeof(EvlogRequest));
+ GOTO_IF_FAIL (read_len == sizeof(EvlogRequest), print_done);
+ total += read_len;
+
+ evinfo.req.ptr = malloc (sizeof(xReq));
+ GOTO_IF_FAIL (evinfo.req.ptr != NULL, print_done);
+
+ read_len = read (fd, evinfo.req.ptr, sizeof (xReq));
+ GOTO_IF_FAIL (read_len == sizeof(xReq), print_done);
+ total += read_len;
+ }
+
+ else if (evinfo.mask & EVLOG_MASK_EVENT)
+ {
+ read_len = read (fd, &evinfo.evt, sizeof(EvlogEvent));
+ GOTO_IF_FAIL (read_len == sizeof(EvlogEvent), print_done);
+ total += read_len;
+
+ evinfo.evt.ptr = malloc (sizeof(xEvent));
+ GOTO_IF_FAIL (evinfo.evt.ptr != NULL, print_done);
+
+ read_len = read (fd, evinfo.evt.ptr, sizeof (xEvent));
+ GOTO_IF_FAIL (read_len == sizeof(xEvent), print_done);
+ total += read_len;
+ }
+ GOTO_IF_FAIL (evlog_len == total, print_done);
+
+ xDbgEvlogFillLog(&evinfo, log, &size);
+ printf ("%s", log);
+
+ if (evinfo.req.ptr)
+ {
+ free (evinfo.req.ptr);
+ evinfo.req.ptr = NULL;
+ }
+
+ else if (evinfo.evt.ptr)
+ {
+ free (evinfo.evt.ptr);
+ evinfo.evt.ptr = NULL;
+ }
+ }
+
+
+print_done:
+ if (evinfo.req.ptr)
+ free (evinfo.req.ptr);
+
+ else if (evinfo.evt.ptr)
+ free (evinfo.evt.ptr);
+
+ if (cfd >= 0)
+ close (cfd);
+
+ if (fd >= 0)
+ close (fd);
+}
+
+static void
+_checkOption(int argc, char** argv)
+{
+ int c;
+ int opt_str_len = 0;
+ char* opt_str = NULL;
+ EvlogOption eo = {0,};
+
+ eo.pid = atoi (argv[0]);
+ eo.help_opt = TRUE;
+ strncpy(eo.command_name, argv[1], PATH_MAX);
+
+ if (argc <= 2)
+ {
+ _printUsage( eo.command_name );
+ return;
+ }
+
+ while ((c = getopt(argc, argv, "f:h")) != EOF)
+ {
+ switch (c)
+ {
+
+ case 'f':
+ opt_str = optarg;
+ opt_str_len = strlen(opt_str);
+
+ if(opt_str_len > 0)
+ {
+ eo.help_opt = FALSE;
+ strncpy (eo.path_name, opt_str, opt_str_len);
+ }
+ break;
+
+ case 'h':
+ _printUsage( eo.command_name );
+ return;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ _xEvlogAnalyzePrint(&eo);
+}
+
+
+int main(int argc, char** argv)
+{
+
+ Display *dpy;
+ char **new_argv;
+ int new_argc, i;
+ char temp[128];
+
+ dpy = XOpenDisplay (NULL);
+ if (!dpy)
+ {
+ fprintf (stderr, "failed: open display\n");
+ exit (-1);
+ }
+
+ new_argc = argc + 1;
+ new_argv = (char**)malloc (new_argc * sizeof (char*));
+ if (!new_argv)
+ {
+ fprintf (stderr, "failed: malloc new argv\n");
+ exit (-1);
+ }
+
+ snprintf (temp, sizeof(temp), "%d", (int)getpid());
+ new_argv[0] = temp;
+
+ for (i = 0; i < argc; i++)
+ new_argv[i+1] = argv[i];
+
+ _checkOption(new_argc, new_argv);
+
+ free (new_argv);
+
+ XCloseDisplay (dpy);
+
+ return 0;
+}
--- /dev/null
+# Copyright 2013 Samsung Electronics co., Ltd. All Rights Reserved.
+#
+# Contact: Boram Park <boram1288.park@samsung.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sub license, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+COMMON_SOURCE = \
+ xdbg_dbus_client.c \
+ xdbg_evlog.c \
+ xdbg_evlog_request.c \
+ xdbg_evlog_event.c \
+ ds/bintree.c \
+ ds/bool_exp_parser.c \
+ ds/bool_exp_rule_checker.c \
+ ds/bool_exp_tokenizer.c
+
+COMMON_CFLAGS = \
+ ${CFLAGS} \
+ @XDBG_CFLAGS@ \
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/common/ds
+
+COMMON_CLIENT_CFLAGS = \
+ ${CFLAGS} \
+ @XDBG_CLIENT_CFLAGS@ \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/common/ds
+
+
+noinst_LTLIBRARIES = libcommon-client.la \
+ libcommon-server.la
+
+libcommon_client_la_LIBADD = ${LDFLAGS} @XDBG_LIBS@
+libcommon_client_la_LDFLAGS = ${LDFLAGS} @XDBG_LIBS@
+libcommon_client_la_CFLAGS = ${COMMON_CLIENT_CFLAGS}
+libcommon_client_la_SOURCES = $(COMMON_SOURCE)
+
+libcommon_server_la_LIBADD = ${LDFLAGS} @XDBG_LIBS@
+libcommon_server_la_LDFLAGS = ${LDFLAGS} @XDBG_LIBS@
+libcommon_server_la_CFLAGS = ${COMMON_CFLAGS}
+libcommon_server_la_SOURCES = $(COMMON_SOURCE) \
+ xdbg_dbus_server.c
if (tree->head)
bintree_postorder_traverse_recursive (tree, tree->head, tree->head, func, arg);
}
-
void bintree_postorder_traverse (BINARY_TREE tree, BINTREE_TRAVERSE_FUNC func, void * arg);
#endif /* _BOOL_EXP_BINTREE_H_ */
-
BINARY_TREE bool_exp_parse (const char * string);
#endif /* _BOOL_EXP_PARSER_H_ */
-
return default_policy == ALLOW;
}
-
int rulechecker_validate_rule (RULE_CHECKER rc, int direct, int reqID, const char * name, int pid, char * cmd);
#endif /* _BOOL_EXP_RULE_CHECKER_H_ */
-
} TOKEN;
#endif /* _BOOL_EXP_TOKEN_H_ */
-
TOKEN get_next_token (const char ** string);
#endif /* _BOOL_EXP_TOKENIZER_ */
-
#include <sys/types.h>
#include <unistd.h>
-#include "xdbg.h"
+#include "xdbg_types.h"
#include "xdbg_dbus_client.h"
#define REPLY_TIME 1000
#define STR_LEN 128
-#define WARNING_IF_FAIL(cond) {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond);}}
-#define RETURN_IF_FAIL(cond) {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond); return; }}
-#define RETURN_VAL_IF_FAIL(cond, val) {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond); return val; }}
-#define RETURN_VAL_IF_ERRNO(cond, val, errno) {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); return val; }}
-#define GOTO_IF_FAIL(cond, dst) {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond); goto dst; }}
-#define GOTO_IF_ERRNO(cond, dst, errno) {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); goto dst; }}
-
struct _XDbgDBusClientInfo
{
DBusConnection *conn;
#include <dix.h>
#include "xdbg.h"
+#include "xdbg_types.h"
#include "xdbg_dbus_server.h"
#define ARGV_NUM 128
--- /dev/null
+/**************************************************************************
+
+xdbg
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+
+Contact: Boram Park <boram1288.park@samsung.com>
+ Sangjin LEE <lsj119@samsung.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <time.h>
+
+#include "xdbg_types.h"
+#include "xdbg_evlog.h"
+#include "bool_exp_rule_checker.h"
+
+static char *evt_type[] = { "Event", "Request", "Reply", "Flush" };
+static char *evt_dir[] = { "<====", "---->", "<----", "*****" };
+
+static RULE_CHECKER rc = NULL;
+
+static void
+_mergeArgs (char * target, int argc, const char ** argv)
+{
+ int i;
+ int len;
+
+ for (i=0; i<argc; i++)
+ {
+ len = sprintf (target, "%s", argv[i]);
+ target += len;
+
+ if (i != argc - 1)
+ *(target++) = ' ';
+ }
+}
+
+static int
+_strcasecmp(const char *str1, const char *str2)
+{
+ const u_char *us1 = (const u_char *) str1, *us2 = (const u_char *) str2;
+
+ while (tolower(*us1) == tolower(*us2)) {
+ if (*us1++ == '\0')
+ return 0;
+ us2++;
+ }
+
+ return (tolower(*us1) - tolower(*us2));
+}
+
+char*
+xDbgEvlogGetCmd (char *path)
+{
+ char *p;
+ if (!path)
+ return NULL;
+ p = strrchr (path, '/');
+ return (p)?p+1:path;
+}
+
+Bool
+xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
+{
+ const char * command;
+
+ if (rc == NULL)
+ rc = rulechecker_init();
+
+ if (argc == 0)
+ {
+ rulechecker_print_rule (rc, reply);
+ return TRUE;
+ }
+
+ command = argv[0];
+
+ if (!_strcasecmp (command, "add"))
+ {
+ POLICY_TYPE policy_type;
+ RC_RESULT_TYPE result;
+ const char * policy = argv[1];
+ char rule[8192];
+
+ if (argc < 3)
+ {
+ XDBG_REPLY ("Error : Too few arguments.\n");
+ return FALSE;
+ }
+
+ if (!_strcasecmp (policy, "ALLOW"))
+ policy_type = ALLOW;
+ else if (!_strcasecmp (policy, "DENY"))
+ policy_type = DENY;
+ else
+ {
+ XDBG_REPLY ("Error : Unknown policy : [%s].\n Policy should be ALLOW or DENY.\n", policy);
+ return FALSE;
+ }
+
+ _mergeArgs (rule, argc - 2, &(argv[2]));
+
+ result = rulechecker_add_rule (rc, policy_type, rule);
+ if (result == RC_ERR_TOO_MANY_RULES)
+ {
+ XDBG_REPLY ("Error : Too many rules were added.\n");
+ return FALSE;
+ }
+ else if (result == RC_ERR_PARSE_ERROR)
+ {
+ XDBG_REPLY ("Error : An error occured during parsing the rule [%s]\n", rule);
+ return FALSE;
+ }
+
+ XDBG_REPLY ("The rule was successfully added.\n\n");
+ rulechecker_print_rule (rc, reply);
+ return TRUE;
+ }
+ else if (!_strcasecmp (command, "remove"))
+ {
+ const char * remove_idx;
+ int i;
+
+ if (argc < 2)
+ {
+ XDBG_REPLY ("Error : Too few arguments.\n");
+ return FALSE;
+ }
+
+ for (i=0; i<argc - 1; i++)
+ {
+ remove_idx = argv[i+1];
+
+ if (!_strcasecmp (remove_idx, "all"))
+ {
+ rulechecker_destroy (rc);
+ rc = rulechecker_init();
+ XDBG_REPLY ("Every rules were successfully removed.\n");
+ }
+ else
+ {
+ int index = atoi (remove_idx);
+ if (isdigit (*remove_idx) && rulechecker_remove_rule (rc, index) == 0)
+ XDBG_REPLY ("The rule [%d] was successfully removed.\n", index);
+ else
+ XDBG_REPLY ("Rule remove fail : No such rule [%s].\n", remove_idx);
+ }
+ }
+ rulechecker_print_rule (rc, reply);
+ return TRUE;
+ }
+ else if (!_strcasecmp (command, "print"))
+ {
+ rulechecker_print_rule (rc, reply);
+ return TRUE;
+ }
+ else if (!_strcasecmp (command, "help"))
+ {
+ XDBG_REPLY ("%s", rulechecker_print_usage());
+ return TRUE;
+ }
+
+ XDBG_REPLY ("%s\nUnknown command : [%s].\n\n", rulechecker_print_usage(), command);
+
+ return TRUE;
+}
+
+Bool
+xDbgEvlogRuleValidate (EvlogInfo *evinfo)
+{
+ const char *evlog_name = "";
+ char *cmd = "";
+
+ if (rc == NULL)
+ rc = rulechecker_init ();
+
+ if (!rc)
+ {
+ fprintf (stderr, "failed: create rulechecker\n");
+ return FALSE;
+ }
+
+ cmd = xDbgEvlogGetCmd (evinfo->client.command);
+
+ if (evinfo->type == REQUEST)
+ evlog_name = evinfo->req.name;
+ else if (evinfo->type == EVENT)
+ evlog_name = evinfo->evt.name;
+
+ return rulechecker_validate_rule (rc,
+ evinfo->type,
+ evinfo->req.id,
+ evlog_name,
+ evinfo->client.pid,
+ cmd);
+}
+
+void
+xDbgEvlogFillLog (EvlogInfo *evinfo, 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*)));
+
+ XDBG_REPLY ("[%10.3f][%5ld] %22s(%2d:%5d) %s %s",
+ evinfo->time / 1000.0,
+ evinfo->time - prev,
+ xDbgEvlogGetCmd (evinfo->client.command),
+ evinfo->client.index,
+ evinfo->client.pid,
+ evt_dir[evinfo->type],
+ evt_type[evinfo->type]);
+
+ if (evinfo->type == REQUEST)
+ {
+ XDBG_REPLY ("(");
+ reply = xDbgEvlogReqeust (evinfo, reply, len);
+ XDBG_REPLY (")");
+ }
+ else if (evinfo->type == EVENT)
+ {
+ XDBG_REPLY ("(");
+ reply = xDbgEvlogEvent (evinfo, reply, len);
+ XDBG_REPLY (")");
+ }
+ else
+ {
+ const char *evlog_name = "";
+ if (evinfo->type == REQUEST)
+ evlog_name = evinfo->req.name;
+ else if (evinfo->type == EVENT)
+ evlog_name = evinfo->evt.name;
+ XDBG_REPLY ("(%s)", evlog_name);
+ }
+
+ XDBG_REPLY ("\n");
+
+ prev = evinfo->time;
+}
--- /dev/null
+/**************************************************************************
+
+xdbg
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+
+Contact: Boram Park <boram1288.park@samsung.com>
+ Sangjin LEE <lsj119@samsung.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef __XDBG_EVLOG_H__
+#define __XDBG_EVLOG_H__
+
+#include "xdbg_types.h"
+#include "xdbg_evlog_request.h"
+#include "xdbg_evlog_event.h"
+
+char* xDbgEvlogGetCmd (char *path);
+Bool xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len);
+Bool xDbgEvlogRuleValidate (EvlogInfo *evinfo);
+void xDbgEvlogFillLog (EvlogInfo *evinfo, char *reply, int *len);
+
+#endif
#include <X11/extensions/damageproto.h>
#include <X11/extensions/damagewire.h>
#include <X11/extensions/XI2proto.h>
+#include <X11/Xlib.h>
#include <windowstr.h>
+#include <X11/extensions/Xdamage.h>
-#include <xdbg.h>
+#include "xdbg_types.h"
+#include "xdbg_evlog_event.h"
-#include "xdbg_module_types.h"
-#include "xdbg_module_evlog_request.h"
#define UNKNOWN_EVENT "<unknown>"
+#ifdef XDBG_CLIENT
+static int damage_base;
+static int damage_err_base;
+#else
static ExtensionEntry *damage;
+#endif
static Bool
-_EvlogEventGetExtentionEntry (void)
+_EvlogEventGetExtentionEntry ()
{
+#ifdef XDBG_CLIENT
+
static int init = 0;
static Bool success = FALSE;
+ Display *dpy;
if (init)
return success;
init = 1;
- damage = CheckExtension (DAMAGE_NAME);
- XDBG_RETURN_VAL_IF_FAIL (damage != NULL, FALSE);
+ dpy = XOpenDisplay (NULL);
+ if (!dpy)
+ {
+ fprintf (stderr, "failed: open display\n");
+ exit (-1);
+ }
+
+ if (!XDamageQueryExtension(dpy, &damage_base, &damage_err_base))
+ {
+ fprintf (stderr, "[UTILX] no X Damage extension. \n");
+ return False;
+ }
+ success = TRUE;
+ XCloseDisplay (dpy);
+ return success;
+
+#else
+
+ static int init = 0;
+ static Bool success = FALSE;
+
+ if (init)
+ return success;
+
+ init = 1;
+ damage = CheckExtension (DAMAGE_NAME);
+ RETURN_VAL_IF_FAIL (damage != NULL, FALSE);
success = TRUE;
return success;
+
+#endif
}
-Bool
-xDbgModuleEvlogEvent (xEvent *ev, char *buf, int remain)
+
+char *
+xDbgEvlogEvent (EvlogInfo *evinfo, char *reply, int *len)
{
- const char *evt_name;
- int len;
+ EvlogEvent ev;
+ xEvent *xEvt = NULL;
+
+ RETURN_VAL_IF_FAIL (evinfo != NULL, reply);
+ RETURN_VAL_IF_FAIL (evinfo->type == EVENT, reply);
+
+ ev = evinfo->evt;
+ xEvt = ev.ptr;
if (!_EvlogEventGetExtentionEntry ())
- return FALSE;
+ return reply;
- evt_name = LookupEventName ((int)(ev->u.u.type));
- len = snprintf (buf, remain, "%s", evt_name);
- buf += len;
- remain -= len;
+ XDBG_REPLY ("%s", ev.name);
- if (ev->u.u.type == damage->eventBase + XDamageNotify)
+#ifdef XDBG_CLIENT
+ if (xEvt->u.u.type == damage_base + XDamageNotify)
+#else
+ if (xEvt->u.u.type == damage->eventBase + XDamageNotify)
+#endif
{
- xDamageNotifyEvent *damage_e = (xDamageNotifyEvent*)ev;
- snprintf (buf, remain, ": XID(%lx) area(%d,%d %dx%d) geo(%d,%d %dx%d)",
+ xDamageNotifyEvent *damage_e = (xDamageNotifyEvent*)xEvt;
+ XDBG_REPLY (": XID(%lx) area(%d,%d %dx%d) geo(%d,%d %dx%d)",
damage_e->drawable,
damage_e->area.x,
damage_e->area.y,
damage_e->geometry.y,
damage_e->geometry.width,
damage_e->geometry.height);
- return TRUE;
+ return reply;
}
-
- return FALSE;
+ return reply;
}
-
**************************************************************************/
-#ifndef __XDBG_MODULE_EVLOG_EVENT_H__
-#define __XDBG_MODULE_EVLOG_EVENT_H__
+#ifndef __XDBG_EVLOG_EVENT_H__
+#define __XDBG_EVLOG_EVENT_H__
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
-Bool xDbgModuleEvlogEvent (xEvent *ev, char *buf, int remain);
+char * xDbgEvlogEvent (EvlogInfo *evinfo, char *reply, int *len);
-#endif /* __XDBG_MODULE_EVLOG_EVENT_H__ */
+#endif
#include <xacestr.h>
#include <X11/Xatom.h>
#include <X11/extensions/XI2proto.h>
+#include <X11/Xlib.h>
#include <windowstr.h>
+#include <sys/shm.h>
+#include <X11/extensions/XShm.h>
-#include <xdbg.h>
-
-#include "xdbg_module_types.h"
-#include "xdbg_module_evlog_request.h"
+#include "xdbg_types.h"
+#include "xdbg_evlog_request.h"
#define UNKNOWN_EVENT "<unknown>"
+#ifdef XDBG_CLIENT
+static int base;
+#else
static ExtensionEntry *xext;
+#endif
static Bool
-_EvlogRequestGetExtentionEntry (void)
+_EvlogRequestGetExtentionEntry ()
{
+#ifdef XDBG_CLIENT
+
static int init = 0;
static Bool success = FALSE;
+ Display *dpy;
if (init)
return success;
init = 1;
- xext = CheckExtension (SHMNAME);
- XDBG_RETURN_VAL_IF_FAIL (xext != NULL, FALSE);
+ dpy = XOpenDisplay (NULL);
+ if (!dpy)
+ {
+ fprintf (stderr, "failed: open display\n");
+ exit (-1);
+ }
+
+ if (!XShmQueryExtension (dpy))
+ {
+ fprintf (stderr, "[UTILX] no XShm extension. !!\n");
+ return False;
+ }
+ printf("debug request\n");
+ base = XShmGetEventBase(dpy);
+ success = TRUE;
+ XCloseDisplay (dpy);
+ return success;
+
+#else
+
+ static int init = 0;
+ static Bool success = FALSE;
+
+ if (init)
+ return success;
+
+ init = 1;
+ xext = CheckExtension (SHMNAME);
+ RETURN_VAL_IF_FAIL (xext != NULL, FALSE);
success = TRUE;
return success;
+
+#endif
}
-static Bool
-_EvlogRequestCore (xReq *req, char *buf, int remain)
+static char *
+_EvlogRequestCore (xReq *req, char *reply, int *len)
{
xReq *stuff = req;
case X_PutImage:
{
xPutImageReq *stuff = (xPutImageReq *)req;
- snprintf (buf, remain, ": XID(%lx) size(%dx%d) dst(%d,%d)",
+ XDBG_REPLY (": XID(%lx) size(%dx%d) dst(%d,%d)",
stuff->drawable,
stuff->width,
stuff->height,
stuff->dstX,
stuff->dstY);
- return TRUE;
+ return reply;
}
default:
break;
}
- return FALSE;
+ return reply;
}
-static Bool
-_EvlogRequestShm (xReq *req, char *buf, int remain)
+static char *
+_EvlogRequestShm (xReq *req, char *reply, int *len)
{
xReq *stuff = req;
case X_ShmPutImage:
{
xShmPutImageReq *stuff = (xShmPutImageReq *)req;
- snprintf (buf, remain, ": XID(%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
+ XDBG_REPLY (": XID(%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
stuff->drawable,
stuff->totalWidth,
stuff->totalHeight,
stuff->srcHeight,
stuff->dstX,
stuff->dstY);
- return TRUE;
+ return reply;
}
default:
break;
}
- return FALSE;
+ return reply;
}
-Bool
-xDbgModuleEvlogReqeust (EvlogClientInfo *evinfo, xReq *req, char *buf, int remain)
+char *
+xDbgEvlogReqeust (EvlogInfo *evinfo, char *reply, int *len)
{
- const char *req_name;
- int len;
+ EvlogRequest req;
+ xReq *xReq = NULL;
- if (!_EvlogRequestGetExtentionEntry () || !req)
- return FALSE;
+ RETURN_VAL_IF_FAIL (evinfo != NULL, reply);
+ RETURN_VAL_IF_FAIL (evinfo->type == REQUEST, reply);
- if (req->reqType < EXTENSION_BASE)
- {
- req_name = LookupRequestName (req->reqType, 0);
- len = snprintf (buf, remain, "%s", req_name);
- buf += len;
- remain -= len;
+ req = evinfo->req;
+ xReq = req.ptr;
- return _EvlogRequestCore (req, buf, remain);
+ if (!_EvlogRequestGetExtentionEntry ())
+ return reply;
+
+ XDBG_REPLY ("%s", req.name);
+
+ if (xReq->reqType < EXTENSION_BASE)
+ {
+ return _EvlogRequestCore (xReq, reply, len);
}
else
{
- req_name = LookupRequestName (req->reqType, req->data);
- len = snprintf (buf, remain, "%s", req_name);
- buf += len;
- remain -= len;
- if (req->reqType == xext->base)
- return _EvlogRequestShm (req, buf, remain);
+#ifdef XDBG_CLIENT
+ if (xReq->reqType == base)
+#else
+ if (xReq->reqType == xext->base)
+#endif
+
+ {
+ return _EvlogRequestShm (xReq, reply, len);
+ }
}
- return FALSE;
+ return reply;
}
**************************************************************************/
-#ifndef __XDBG_MODULE_EVLOG_REQUEST_H__
-#define __XDBG_MODULE_EVLOG_REQUEST_H__
+#ifndef __XDBG_EVLOG_REQUEST_H__
+#define __XDBG_EVLOG_REQUEST_H__
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
-Bool xDbgModuleEvlogReqeust (EvlogClientInfo *evinfo, xReq *req , char *buf, int remain);
+char * xDbgEvlogReqeust (EvlogInfo *evinfo, char *reply, int *len);
-#endif /* __XDBG_MODULE_EVLOG_REQUEST_H__ */
+#endif
--- /dev/null
+/**************************************************************************
+
+xdbg
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+
+Contact: Boram Park <boram1288.park@samsung.com>
+ Sangjin LEE <lsj119@samsung.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef __XDBG_TYPES_H__
+#define __XDBG_TYPES_H__
+
+#include <xf86.h>
+#include <X11/Xdefs.h> /* for Bool */
+
+#define XDBG_PATH_MAX 1024
+
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define SWAP(a, b) ({int t; t = a; a = b; b = t;})
+
+#define WARNING_IF_FAIL(cond) \
+ {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond);}}
+#define RETURN_IF_FAIL(cond) \
+ {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond); return; }}
+#define RETURN_VAL_IF_FAIL(cond, val) \
+ {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond); return val; }}
+#define RETURN_VAL_IF_ERRNO(cond, val, errno) \
+ {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); return val; }}
+#define GOTO_IF_FAIL(cond, dst) \
+ {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed.\n", __FUNCTION__, #cond); goto dst; }}
+#define GOTO_IF_ERRNO(cond, dst, errno) \
+ {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); goto dst; }}
+
+#define XDBG_REPLY(fmt, ARG...) \
+ do { \
+ if (reply && len && *len > 0) \
+ { \
+ int s = snprintf (reply, *len, fmt, ##ARG); \
+ reply += s; \
+ *len -= s; \
+ } \
+ } while (0)
+
+#define UNKNOWN_EVENT "<unknown>"
+
+typedef enum
+{
+ EVENT,
+ REQUEST,
+ REPLY,
+ FLUSH
+} EvlogType;
+
+#define EVLOG_MASK_CLIENT (1<<0)
+#define EVLOG_MASK_REQUEST (1<<1)
+#define EVLOG_MASK_EVENT (1<<2)
+
+typedef struct _EvlogClient
+{
+ int index;
+ int pid;
+ int gid;
+ int uid;
+ char command[PATH_MAX+1];
+} EvlogClient;
+
+typedef struct _EvlogRequest
+{
+ int id;
+ CARD32 length;
+ xReq *ptr;
+ char name[PATH_MAX+1];
+} EvlogRequest;
+
+typedef struct _EvlogEvent
+{
+ xEvent *ptr;
+ char name[PATH_MAX+1];
+} EvlogEvent;
+
+typedef struct _EvlogInfo
+{
+ EvlogType type;
+
+ int mask;
+ EvlogClient client;
+ EvlogRequest req;
+ EvlogEvent evt;
+
+ CARD32 time;
+} EvlogInfo;
+
+#endif
[moduledir="$libdir/xorg/modules"])
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XDBG, xorg-server x11 dbus-1 bigreqsproto compositeproto damageproto dmxproto dri2proto fixesproto fontsproto gestureproto inputproto kbproto randrproto recordproto renderproto resourceproto scrnsaverproto videoproto xcmiscproto xextproto xf86bigfontproto xf86dgaproto xf86driproto xf86vidmodeproto xineramaproto xproto libdrm)
+PKG_CHECK_MODULES(XDBG, xorg-server x11 xdamage xext dbus-1 bigreqsproto compositeproto damageproto dmxproto dri2proto fixesproto fontsproto gestureproto inputproto kbproto randrproto recordproto renderproto resourceproto scrnsaverproto videoproto xcmiscproto xextproto xf86bigfontproto xf86dgaproto xf86driproto xf86vidmodeproto xineramaproto xproto libdrm)
AC_SUBST([XDBG_CFLAGS])
AC_SUBST([XDBG_LIBS])
+XDBG_CLIENT_CFLAGS="${XDBG_CFLAGS} -DXDBG_CLIENT"
+XDBG_CLIENT_LIBS="${XDBG_LIBS}"
+AC_SUBST([XDBG_CLIENT_CFLAGS])
+AC_SUBST([XDBG_CLIENT_LIBS])
+
# Checks for header files.
AC_HEADER_STDC
AC_DEFINE_UNQUOTED(MODULE_NAME, "$MODULE_NAME", [module name])
AC_OUTPUT([Makefile
- dbus/Makefile
+ common/Makefile
bin/Makefile
bin/xdbg/Makefile
+ bin/xevlog_analyze/Makefile
lib/Makefile
lib/xdbg.pc
module/Makefile])
echo "LDFLAGS : $LDFLAGS"
echo "XDBG_CFLAGS: $XDBG_CFLAGS"
echo "XDBG_LIBS : $XDBG_LIBS"
+echo "XDBG_CLIENT_CFLAGS: $XDBG_CLIENT_CFLAGS"
+echo "XDBG_CLIENT_LIBS : $XDBG_CLIENT_LIBS"
libxdbg_log_la_CFLAGS = \
${CFLAGS} \
@XDBG_CFLAGS@ \
- -I$(top_srcdir)/lib
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/common
libxdbg_log_la_SOURCES = \
xdbg_log.c \
**************************************************************************/
+#if defined(XDBG_CLIENT)
+#error "This header is not for client."
+#endif
+
#ifndef __XDBG_H__
#define __XDBG_H__
**************************************************************************/
+#if defined(XDBG_CLIENT)
+#error "This header is not for client."
+#endif
+
#ifndef __XDBG_LOG_H__
#define __XDBG_LOG_H__
#define XDBG_KLOG(mod, fmt, ARG...) XLOG_KLOG(mod, "[%s] "fmt, __FUNCTION__, ##ARG)
#define XDBG_SLOG(mod, fmt, ARG...) XLOG_SLOG(mod, "[%s] "fmt, __FUNCTION__, ##ARG)
-#define XDBG_NEVER_GET_HERE(mod) XLOG_ERROR(mod, "[%s] ** NEVER GET HERE **\n", __FUNCTION__)
+#define XDBG_NEVER_GET_HERE(mod) XLOG_ERROR(mod, "[%s:%d] ** NEVER GET HERE **\n", __FUNCTION__,__LINE__)
#define XDBG_WARNING_IF_FAIL(cond) {if (!(cond)) { ErrorF ("[%s] '%s' failed.\n", __FUNCTION__, #cond);}}
#define XDBG_RETURN_IF_FAIL(cond) {if (!(cond)) { ErrorF ("[%s] '%s' failed.\n", __FUNCTION__, #cond); return; }}
#define XDBG_GOTO_IF_FAIL(cond, dst) {if (!(cond)) { ErrorF ("[%s] '%s' failed.\n", __FUNCTION__, #cond); goto dst; }}
#define XDBG_GOTO_IF_ERRNO(cond, dst, errno) {if (!(cond)) { ErrorF ("[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); goto dst; }}
-#define XDBG_REPLY(fmt, ARG...) \
- do { \
- if (reply && len && *len > 0) \
- { \
- int s = snprintf (reply, *len, fmt, ##ARG); \
- reply += s; \
- *len -= s; \
- } \
- } while (0)
-
unsigned int xDbgLogGetModule (char *name);
#define _C(b,s) (((b) >> (s)) & 0xFF)
#include "xdbg.h"
#include "xdbg_log_int.h"
-
+#include "xdbg_types.h"
#include <list.h>
#ifndef API
**************************************************************************/
+#if defined(XDBG_CLIENT)
+#error "This header is not for client."
+#endif
+
#ifndef __XDBG_LOG_DRMEVENT_H__
#define __XDBG_LOG_DRMEVENT_H__
#include "xorg-server.h"
#include "xdbg.h"
#include "xdbg_log_int.h"
+#include "xdbg_types.h"
+#include "xdbg_log_fpsdebug.h"
#ifndef API
#define API __attribute__ ((visibility("default")))
**************************************************************************/
+#if defined(XDBG_CLIENT)
+#error "This header is not for client."
+#endif
+
#ifndef __XDBG_LOG_FPSDEBUG_H__
#define __XDBG_LOG_FPSDEBUG_H__
#include <list.h>
#include "xdbg.h"
#include "xdbg_log_int.h"
+#include "xdbg_types.h"
+#include "xdbg_log_plist.h"
/* for debug message */
#define MMEM XDBG_M('M','E','M',0)
**************************************************************************/
+#if defined(XDBG_CLIENT)
+#error "This header is not for client."
+#endif
+
#ifndef __XDBG_LOG_PLIST_H__
#define __XDBG_LOG_PLIST_H__
libxdbg_la_LTLIBRARIES = libxdbg.la
libxdbg_ladir = @moduledir@
-libxdbg_la_LIBADD = @XDBG_LIBS@ ../dbus/libdbus.la ../lib/libxdbg-log.la
+libxdbg_la_LIBADD = @XDBG_LIBS@ ../common/libcommon-server.la ../lib/libxdbg-log.la
libxdbg_la_LDFLAGS = -module -avoid-version ${LDFLAGS}
libxdbg_la_CFLAGS = \
${CFLAGS} \
@XDBG_CFLAGS@ \
- -I$(top_srcdir)/dbus \
+ -I$(top_srcdir)/common \
-I$(top_srcdir)/lib \
- -I$(top_srcdir)/module \
- -I$(top_srcdir)/module/ds
+ -I$(top_srcdir)/module
libxdbg_la_SOURCES = \
xdbg_module.c \
xdbg_module_plist.c \
xdbg_module_fpsdebug.c \
xdbg_module_evlog.c \
- xdbg_module_evlog_request.c \
- xdbg_module_evlog_event.c \
- xdbg_module_drmevent.c \
- ds/bintree.c \
- ds/bool_exp_parser.c \
- ds/bool_exp_rule_checker.c \
- ds/bool_exp_tokenizer.c
+ xdbg_module_drmevent.c
**************************************************************************/
-#ifndef __XDBG_MODULE_TYPES_H__
-#define __XDBG_MODULE_TYPES_H__
+#ifndef __XDBG_MODULE_H__
+#define __XDBG_MODULE_H__
#include <xf86.h>
#include <X11/Xdefs.h> /* for Bool */
-
-#define XDBG_PATH_MAX 1024
-
-#ifndef MAX
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef SWAP
-#define SWAP(a, b) ({int t; t = a; a = b; b = t;})
-#endif
+#include "xdbg_types.h"
typedef struct _ModuleClientInfo
{
char *evlog_path;
} XDbgModule;
-typedef struct _EvlogClientInfo
-{
- int index;
- int pid;
- int gid;
- int uid;
- char command[PATH_MAX+1];
- pointer requestBuffer;
- CARD32 req_len;
-} EvlogClientInfo;
-
extern DevPrivateKeyRec debug_client_key;
#define DebugClientKey (&debug_client_key)
#define GetClientInfo(pClient) ((ModuleClientInfo*)dixLookupPrivate(&(pClient)->devPrivates, DebugClientKey))
-#endif /* __XDBG_MODULE_TYPES_H__ */
+#endif /* __XDBG_MODULE_H__ */
#include <stdio.h>
#include "xdbg.h"
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
+#include "xdbg_module.h"
void
#ifndef __XDBG_MODULE_CLIST_H__
#define __XDBG_MODULE_CLIST_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
void xDbgModuleCList (XDbgModule *pMod, char *reply, int *len);
#include <windowstr.h>
#include <xacestr.h>
#include <xdbg.h>
+#include "xdbg_types.h"
#include <xf86Priv.h>
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
#include "xdbg_module_clist.h"
#include "xdbg_module_plist.h"
#include "xdbg_module_evlog.h"
}
static void
-_CommandSetEvlogPrint (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
-{
- char *evlog_path;
-
- if (argc < 3 || !argv[2] || strlen(argv[2]) <= 0)
- evlog_path = pMod->evlog_path;
- else
- evlog_path = argv[2];
-
- xDbgModuleEvlogPrintEvlog (pMod, pid, evlog_path, reply, len);
-}
-
-static void
_CommandDrmEventPending (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
{
if (argc != 2)
},
{
- "evlog_print", "to print evlog file", "[filepath]",
- NULL, "[filepath]",
- _CommandSetEvlogPrint
- },
-
- {
"drmevent_pending", "to print pending drmvents", "",
NULL, "",
_CommandDrmEventPending
#ifndef __XDBG_MODULE_COMMAND_H__
#define __XDBG_MODULE_COMMAND_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
void xDbgModuleCommand (void *data, int argc, char **argv, char *reply, int *len);
Bool xDbgModuleCommandInitLogPath (XDbgModule *pMod);
#include "xdbg.h"
#include "xdbg_log_int.h"
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
+#include "xdbg_module.h"
void
#ifndef __XDBG_MODULE_DRMEVENT_H__
#define __XDBG_MODULE_DRMEVENT_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
void xDbgModuleDrmEventPending (XDbgModule *pMod, char *reply, int *remain);
#include <windowstr.h>
#include <xdbg.h>
-
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
+#include "xdbg_module.h"
#include "xdbg_module_evlog.h"
-#include "xdbg_module_evlog_request.h"
-#include "xdbg_module_evlog_event.h"
-#include "bool_exp_rule_checker.h"
+#include "xdbg_evlog.h"
#define XREGISTRY
#include "registry.h"
static Atom atom_rotate = None;
static Atom atom_client_pid = None;
-RULE_CHECKER rc = NULL;
-
-#define UNKNOWN_EVENT "<unknown>"
-
-typedef enum
-{
- EVENT,
- REQUEST,
- REPLY,
- FLUSH
-} evtType;
-
-#define EVTDATA_MASK_CLIENT_INFO 0x1
-#define EVTDATA_MASK_CLIENT_REQ 0x2
-#define EVTDATA_MASK_EVENT 0x4
-
-static char *evt_type[] = { "Event", "Request", "Reply", "Flush" };
-static char *evt_dir[] = { "<====", "---->", "<----", "*****" };
-
-static void _evtPrintF (int fd, const char * format, ...)
+static void evtRecord (int fd, EvlogInfo *evinfo)
{
- va_list args;
+ int write_len = 0;
- va_start (args, format);
- if (fd < 0)
- VErrorF (format, args);
- else
- vdprintf (fd, format, args);
- va_end (args);
-}
+ XDBG_RETURN_IF_FAIL (fd >= 0)
-static void evtGetReqInfo (evtType type, EvlogClientInfo *evinfo, xReq *req, xEvent *ev,
- int *req_id, const char **req_string,
- char **c_cmd, int *c_index, int *c_pid)
-{
- if (type == REQUEST && req)
- {
- *req_id = req->reqType;
- if (req->reqType < EXTENSION_BASE)
- *req_string = LookupRequestName (req->reqType, 0);
- else
- *req_string = LookupRequestName (req->reqType, req->data);
- }
- else if (type == EVENT && ev)
- *req_string = LookupEventName ((int)(ev->u.u.type));
-
- if(evinfo)
+ if (evinfo)
{
- *c_index = evinfo->index;
- *c_pid = evinfo->pid;
+ evinfo->mask = 0;
- *c_cmd = rindex (evinfo->command, '/');
- if (*c_cmd == NULL)
- *c_cmd = evinfo->command;
- else
- *c_cmd = *c_cmd + 1;
- }
-}
-
-static void evtRecord (CARD32 msec, evtType type, EvlogClientInfo *evinfo, xEvent *ev)
-{
- int mask = 0;
- int write_len = sizeof (int) +
- sizeof (CARD32) +
- sizeof (evtType) +
- sizeof (int);
+ write_len = sizeof (int) +
+ sizeof (EvlogType) +
+ sizeof (int) +
+ sizeof (CARD32);
- if (xev_trace_record_fd < 0)
- return;
+ evinfo->mask |= EVLOG_MASK_CLIENT;
+ write_len += sizeof (EvlogClient);
- if (evinfo)
- {
- mask |= EVTDATA_MASK_CLIENT_INFO;
- write_len += sizeof (EvlogClientInfo);
-
- if (evinfo->requestBuffer)
+ if (evinfo->type == REQUEST)
{
- mask |= EVTDATA_MASK_CLIENT_REQ;
- write_len += evinfo->req_len;
+ evinfo->mask |= EVLOG_MASK_REQUEST;
+ write_len += sizeof (EvlogRequest) + sizeof (xReq);
+ }
+ else if (evinfo->type == EVENT)
+ {
+ evinfo->mask |= EVLOG_MASK_EVENT;
+ write_len += sizeof (EvlogEvent) + sizeof (xEvent);
}
- }
-
- if (ev)
- {
- mask |= EVTDATA_MASK_EVENT;
- write_len += sizeof (xEvent);
}
if (write (xev_trace_record_fd, &write_len, sizeof(int)) == -1)
XDBG_ERROR (MXDBG, "failed: write write_len\n");
return;
}
- if (write (xev_trace_record_fd, &msec, sizeof(CARD32)) == -1)
- {
- XDBG_ERROR (MXDBG, "failed: write msec\n");
- return;
- }
- if (write (xev_trace_record_fd, &type, sizeof(evtType)) == -1)
- {
- XDBG_ERROR (MXDBG, "failed: write type\n");
- return;
- }
- if (write (xev_trace_record_fd, &mask, sizeof(int)) == -1)
- {
- XDBG_ERROR (MXDBG, "failed: write mask\n");
- return;
- }
if (evinfo)
{
- if (write (xev_trace_record_fd, evinfo, sizeof (EvlogClientInfo)) == -1)
+ if (write (xev_trace_record_fd, &evinfo->time, sizeof(CARD32)) == -1)
+ {
+ XDBG_ERROR (MXDBG, "failed: write msec\n");
+ return;
+ }
+ if (write (xev_trace_record_fd, &evinfo->type, sizeof(EvlogType)) == -1)
+ {
+ XDBG_ERROR (MXDBG, "failed: write type\n");
+ return;
+ }
+ if (write (xev_trace_record_fd, &evinfo->mask, sizeof(int)) == -1)
+ {
+ XDBG_ERROR (MXDBG, "failed: write mask\n");
+ return;
+ }
+ if (write (xev_trace_record_fd, &evinfo->client, sizeof (EvlogClient)) == -1)
{
XDBG_ERROR (MXDBG, "failed: write client\n");
return;
}
- if (evinfo->requestBuffer)
- if (write (xev_trace_record_fd, evinfo->requestBuffer, evinfo->req_len) == -1)
+
+ if (evinfo->type == REQUEST)
+ {
+ if (write (xev_trace_record_fd, &evinfo->req, sizeof (EvlogRequest)) == -1)
{
- XDBG_ERROR (MXDBG, "failed: write requestBuffer\n");
+ XDBG_ERROR (MXDBG, "failed: write request\n");
return;
}
- }
-
- if (ev)
- if (write (xev_trace_record_fd, ev, sizeof (xEvent)) == -1)
+ if (write (xev_trace_record_fd, evinfo->req.ptr, sizeof (xReq)) == -1)
+ {
+ XDBG_ERROR (MXDBG, "failed: write request\n");
+ return;
+ }
+ }
+ else if (evinfo->type == EVENT)
{
- XDBG_ERROR (MXDBG, "failed: write ev\n");
- return;
+ if (write (xev_trace_record_fd, &evinfo->evt, sizeof (EvlogEvent)) == -1)
+ {
+ XDBG_ERROR (MXDBG, "failed: write event\n");
+ return;
+ }
+ if (write (xev_trace_record_fd, evinfo->evt.ptr, sizeof (xEvent)) == -1)
+ {
+ XDBG_ERROR (MXDBG, "failed: write event\n");
+ return;
+ }
}
+ }
}
-static void evtPrintF (int fd, CARD32 msec, evtType type, EvlogClientInfo *evinfo, xEvent *ev)
+static void evtPrintF (int fd, EvlogInfo *evinfo)
{
- int req_id = 0;
- const char *req_string = "";
- const char *req_detail = "";
- char tempbuf[256] = {0,};
- char *c_cmd = "";
- int c_index = 0;
- int c_pid = 0;
- static CARD32 prev;
- xReq *req = NULL;
-
- XDBG_RETURN_IF_FAIL (type >= 0 && (sizeof (evt_dir) / sizeof (char*)));
- XDBG_RETURN_IF_FAIL (type >= 0 && (sizeof (evt_type) / sizeof (char*)));
-
- if(evinfo)
- {
- req = (xReq *)evinfo->requestBuffer;
- }
+ char log[1024];
+ int size = sizeof (log);
- evtGetReqInfo (type, evinfo, req, ev, &req_id, &req_string, &c_cmd, &c_index, &c_pid);
+ xDbgEvlogFillLog (evinfo, log, &size);
- if (type == REQUEST)
- {
- XDBG_RETURN_IF_FAIL (evinfo != NULL);
- XDBG_RETURN_IF_FAIL (req != NULL);
- xDbgModuleEvlogReqeust (evinfo, req, tempbuf, sizeof (tempbuf));
- req_detail = tempbuf;
- }
- else if (type == EVENT)
- {
- XDBG_RETURN_IF_FAIL (ev != NULL);
- xDbgModuleEvlogEvent (ev, tempbuf, sizeof (tempbuf));
- req_detail = tempbuf;
- }
+ if (fd < 0)
+ ErrorF ("%s", log);
else
- req_detail = req_string;
-
- _evtPrintF (fd, "[%10.3f][%4ld] %15s(%2d:%4d) %s %7s (%s)\n",
- msec / 1000.0,
- msec - prev,
- c_cmd, c_index, c_pid,
- evt_dir[type],
- evt_type[type], req_detail);
-
- prev = msec;
+ dprintf (fd, "%s", log);
}
-static void evtPrint (evtType type, ClientPtr client, xEvent *ev)
+static void evtPrint (EvlogType type, ClientPtr client, xEvent *ev)
{
- int req_id = 0;
- const char *req_string = "";
- char *c_cmd = "";
- int c_index = 0;
- int c_pid = 0;
- CARD32 curr;
- ModuleClientInfo *info = NULL;
- EvlogClientInfo evinfo;
- xReq *req = NULL;
+ EvlogInfo evinfo = {0,};
if (xev_trace_on == FALSE)
return;
+ /* evinfo.type */
+ evinfo.type = type;
+
+ /* evinfo.client */
if (client)
{
- info = GetClientInfo (client);
+ ModuleClientInfo *info = GetClientInfo (client);
XDBG_RETURN_IF_FAIL (info != NULL);
- memset (&evinfo, 0, sizeof (EvlogClientInfo));
+ evinfo.mask |= EVLOG_MASK_CLIENT;
+ evinfo.client.index = info->index;
+ evinfo.client.pid = info->pid;
+ evinfo.client.gid = info->gid;
+ evinfo.client.uid = info->uid;
+ strncpy (evinfo.client.command, info->command, strlen (info->command));
+
+ /* evinfo.req */
+ if (type == REQUEST)
+ {
+ REQUEST (xReq);
- evinfo.index = info->index;
- evinfo.pid = info->pid;
- evinfo.gid = info->gid;
- evinfo.uid = info->uid;
- strncpy (evinfo.command, info->command, strlen (info->command));
- evinfo.requestBuffer = client->requestBuffer;
- evinfo.req_len = client->req_len;
+ evinfo.mask |= EVLOG_MASK_REQUEST;
+ evinfo.req.id = stuff->reqType;
+ evinfo.req.length = client->req_len;
+ evinfo.req.ptr = client->requestBuffer;
- req = (xReq *)evinfo.requestBuffer;
+ if (stuff->reqType < EXTENSION_BASE)
+ snprintf (evinfo.req.name, sizeof (evinfo.req.name), "%s",
+ LookupRequestName (stuff->reqType, 0));
+ else
+ snprintf (evinfo.req.name, sizeof (evinfo.req.name), "%s",
+ LookupRequestName (stuff->reqType, stuff->data));
+ }
}
- evtGetReqInfo (type, (client)?&evinfo:NULL, req, ev, &req_id, &req_string, &c_cmd, &c_index, &c_pid);
+ /* evinfo.evt */
+ if (ev)
+ {
+ XDBG_RETURN_IF_FAIL (type == EVENT);
- if (rc == NULL)
- rc = rulechecker_init();
+ evinfo.mask |= EVLOG_MASK_EVENT;
+ evinfo.evt.ptr = ev;
+ snprintf (evinfo.evt.name, sizeof (evinfo.evt.name), "%s",
+ LookupEventName ((int)(ev->u.u.type)));
+ }
- if (!rulechecker_validate_rule (rc, type, req_id, req_string, c_pid, c_cmd))
- return;
+ /* evinfo.time */
+ evinfo.time = GetTimeInMillis ();
- curr = GetTimeInMillis ();
+ if (!xDbgEvlogRuleValidate (&evinfo))
+ return;
if (xev_trace_record_fd >= 0)
- evtRecord (curr, type, (client)?&evinfo:NULL, ev);
+ evtRecord (xev_trace_record_fd, &evinfo);
else
- evtPrintF (xev_trace_fd, curr, type, (client)?&evinfo:NULL, ev);
-}
-
-static void _mergeArgs (char * target, int argc, const char ** argv)
-{
- int i;
- int len;
-
- for (i=0; i<argc; i++)
- {
- len = sprintf (target, "%s", argv[i]);
- target += len;
-
- if (i != argc - 1)
- *(target++) = ' ';
- }
+ evtPrintF (xev_trace_fd, &evinfo);
}
static const char*
int
xDbgModuleEvlogInfoSetRule (XDbgModule *pMod, const int argc, const char ** argv, char *reply, int *len)
{
- const char * command;
-
- if (rc == NULL)
- rc = rulechecker_init();
-
- if (argc == 0)
- {
- rulechecker_print_rule (rc, reply);
- return 0;
- }
-
- command = argv[0];
-
- if (!strcasecmp (command, "add"))
- {
- POLICY_TYPE policy_type;
- RC_RESULT_TYPE result;
- const char * policy = argv[1];
- char rule[8192];
-
- if (argc < 3)
- {
- XDBG_REPLY ("Error : Too few arguments.\n");
- return -1;
- }
-
- if (!strcasecmp (policy, "ALLOW"))
- policy_type = ALLOW;
- else if (!strcasecmp (policy, "DENY"))
- policy_type = DENY;
- else
- {
- XDBG_REPLY ("Error : Unknown policy : [%s].\n Policy should be ALLOW or DENY.\n", policy);
- return -1;
- }
-
- _mergeArgs (rule, argc - 2, &(argv[2]));
-
- result = rulechecker_add_rule (rc, policy_type, rule);
- if (result == RC_ERR_TOO_MANY_RULES)
- {
- XDBG_REPLY ("Error : Too many rules were added.\n");
- return -1;
- }
- else if (result == RC_ERR_PARSE_ERROR)
- {
- XDBG_REPLY ("Error : An error occured during parsing the rule [%s]\n", rule);
- return -1;
- }
-
- XDBG_REPLY ("The rule was successfully added.\n\n");
- rulechecker_print_rule (rc, reply);
- return 0;
- }
- else if (!strcasecmp (command, "remove"))
- {
- const char * remove_idx;
- int i;
-
- if (argc < 2)
- {
- XDBG_REPLY ("Error : Too few arguments.\n");
- return -1;
- }
-
- for (i=0; i<argc - 1; i++)
- {
- remove_idx = argv[i+1];
-
- if (!strcasecmp (remove_idx, "all"))
- {
- rulechecker_destroy (rc);
- rc = rulechecker_init();
- XDBG_REPLY ("Every rules were successfully removed.\n");
- }
- else
- {
- int index = atoi (remove_idx);
- if (isdigit (*remove_idx) && rulechecker_remove_rule (rc, index) == 0)
- XDBG_REPLY ("The rule [%d] was successfully removed.\n", index);
- else
- XDBG_REPLY ("Rule remove fail : No such rule [%s].\n", remove_idx);
- }
- }
- rulechecker_print_rule (rc, reply);
- return 0;
- }
- else if (!strcasecmp (command, "print"))
- {
- rulechecker_print_rule (rc, reply);
- return 0;
- }
- else if (!strcasecmp (command, "help"))
- {
- XDBG_REPLY ("%s", rulechecker_print_usage());
- return 0;
- }
-
- XDBG_REPLY ("%s\nUnknown command : [%s].\n\n", rulechecker_print_usage(), command);
-
- return 0;
+ return xDbgEvlogRuleSet (argc, argv, reply, len);
}
Bool
return TRUE;
}
-
-void
-xDbgModuleEvlogPrintEvlog (XDbgModule *pMod, int pid, char *evlog_path, char *reply, int *len)
-{
- int fd = -1, cfd = -1;
- int total, read_len;
- int evlog_len;
- pointer requestBuffer = NULL;
- char fd_name[256];
-
- if (!evlog_path)
- {
- XDBG_REPLY ("failed: no evlog path\n");
- return;
- }
-
- fd = open (evlog_path, O_RDONLY);
- if (fd < 0)
- {
- XDBG_REPLY ("failed: open '%s'. (%s)\n", evlog_path, strerror(errno));
- return;
- }
-
- snprintf (fd_name, sizeof (fd_name), "/proc/%d/fd/1", pid);
- cfd = open (fd_name, O_RDWR);
- if (cfd < 0)
- {
- XDBG_REPLY ("failed: open consol '%s'. (%s)\n", fd_name, strerror(errno));
- goto print_done;
- }
-
- while ((read_len = read (fd, &evlog_len, sizeof (int))) == sizeof (int))
- {
- CARD32 msec;
- evtType type;
- int mask;
- EvlogClientInfo evinfo;
- xEvent ev;
-
- total = read_len;
-
- read_len = read (fd, &msec, sizeof (CARD32));
- XDBG_GOTO_IF_FAIL (read_len == sizeof (CARD32), print_done);
- total += read_len;
-
- read_len = read (fd, &type, sizeof (evtType));
- XDBG_GOTO_IF_FAIL (read_len == sizeof (evtType), print_done);
- XDBG_GOTO_IF_FAIL (type >= EVENT && type <= FLUSH, print_done);
- total += read_len;
-
- read_len = read (fd, &mask, sizeof (int));
- XDBG_GOTO_IF_FAIL (read_len == sizeof (int), print_done);
- total += read_len;
-
- if (mask & EVTDATA_MASK_CLIENT_INFO)
- {
- read_len = read (fd, &evinfo, sizeof (EvlogClientInfo));
- XDBG_GOTO_IF_FAIL (read_len == sizeof (EvlogClientInfo), print_done);
- total += read_len;
-
- if (mask & EVTDATA_MASK_CLIENT_REQ && evinfo.req_len > 0)
- {
- requestBuffer = malloc (evinfo.req_len);
- XDBG_GOTO_IF_FAIL (requestBuffer != NULL, print_done);
-
- read_len = read (fd, requestBuffer, evinfo.req_len);
- XDBG_GOTO_IF_FAIL (read_len == evinfo.req_len, print_done);
- total += read_len;
-
- evinfo.requestBuffer = requestBuffer;
- }
- }
-
- if (mask & EVTDATA_MASK_EVENT)
- {
- read_len = read (fd, &ev, sizeof (xEvent));
- XDBG_GOTO_IF_FAIL (read_len == sizeof (xEvent), print_done);
- total += read_len;
- }
-
- XDBG_GOTO_IF_FAIL (evlog_len == total, print_done);
-
- evtPrintF (cfd, msec, type, &evinfo, &ev);
-
- if (requestBuffer)
- {
- free (requestBuffer);
- requestBuffer = NULL;
- }
- }
-
-print_done:
- if (requestBuffer)
- free (requestBuffer);
-
- if (cfd >= 0)
- close (cfd);
-
- if (fd >= 0)
- close (fd);
-}
#ifndef __XDBG_MODULE_EVLOG_H__
#define __XDBG_MODULE_EVLOG_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
Bool xDbgModuleEvlogInstallHooks (XDbgModule *pMod);
void xDbgModuleEvlogUninstallHooks (XDbgModule *pMod);
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);
-void xDbgModuleEvlogPrintEvlog (XDbgModule *pMod, int pid, char *evlog_path, char *reply, int *len);
#endif /* __XDBG_MODULE_EVLOG_H__ */
#include "xdbg.h"
#include "xdbg_log_int.h"
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
+#include "xdbg_module.h"
void
xDbgModuleFpsDebug (XDbgModule *pMod, int on, char *reply, int *len)
#ifndef __XDBG_MODULE_FPSDEBUG_H__
#define __XDBG_MODULE_FPSDEBUG_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
void xDbgModuleFpsDebug (XDbgModule *pMod, int on, char *reply, int *len);
#include <xdbg.h>
#include "xdbg_dbus_server.h"
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
#include "xdbg_module_command.h"
#include "xdbg_module_evlog.h"
#ifndef __XDBG_MODULE_MAIN_H__
#define __XDBG_MODULE_MAIN_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
Bool xDbgModuleMain (XDbgModule *pMod);
void xDbgModuleMainExit (XDbgModule *pMod);
#include <xdbg.h>
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
/* Supported options */
typedef enum
#ifndef __XDBG_MODULE_OPTIONS_H__
#define __XDBG_MODULE_OPTIONS_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
void xDbgModuleParseOptions (XDbgModule *pMod, XF86OptionPtr pOpt);
#include "xdbg.h"
#include "xdbg_log_int.h"
-#include "xdbg_module_types.h"
+#include "xdbg_types.h"
+#include "xdbg_module.h"
+
void
xDbgModulePList (XDbgModule *pMod, char *reply, int *len)
#ifndef __XDBG_MODULE_PLIST_H__
#define __XDBG_MODULE_PLIST_H__
-#include "xdbg_module_types.h"
+#include "xdbg_module.h"
void xDbgModulePList (XDbgModule *pMod, char *reply, int *remain);
BuildRequires: pkgconfig(xorg-server)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xdamage)
BuildRequires: pkgconfig(xorg-macros)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(bigreqsproto)
%defattr(-,root,root,-)
/usr/share/license/%{name}
%{_bindir}/xdbg
+%{_bindir}/xevlog_analyze
%{_libdir}/libxdbg-log.so.*
%{_libdir}/xorg/modules/libxdbg.so