rpms/xscope/F-10 import.log, NONE, 1.1 xscope-1.1-diff_to_git.patch, NONE, 1.1 xscope-1.1-lessmacros.patch, NONE, 1.1 xscope.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Yanko Kaneti yaneti at fedoraproject.org
Wed Jul 1 05:24:09 UTC 2009


Author: yaneti

Update of /cvs/pkgs/rpms/xscope/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22877/F-10

Modified Files:
	.cvsignore sources 
Added Files:
	import.log xscope-1.1-diff_to_git.patch 
	xscope-1.1-lessmacros.patch xscope.spec 
Log Message:
Initial import on branch F-10



--- NEW FILE import.log ---
xscope-1_1-3_gitfccbbd6_fc12:F-10:xscope-1.1-3.gitfccbbd6.fc12.src.rpm:1246425806

xscope-1.1-diff_to_git.patch:

--- NEW FILE xscope-1.1-diff_to_git.patch ---
diff --git a/AUTHORS b/AUTHORS
index 3dd770c..b3bbcec 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1 +1,2 @@
 James Peterson, MCC
+Keith Packard
diff --git a/Makefile.am b/Makefile.am
index 89928cf..7bbf2e6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2008-2009 Sun Microsystems, Inc.  All rights reserved.
 # Use subject to license terms.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -30,28 +30,51 @@
 
 bin_PROGRAMS = xscope
 
-AM_CFLAGS = $(XSCOPE_CFLAGS)
+AM_CFLAGS = $(CWARNFLAGS) $(XSCOPE_CFLAGS)
 xscope_LDADD = $(XSCOPE_LIBS)
 
 xscope_SOURCES =	\
+	audio.c \
+	bigreqscope.h \
 	common.c \
 	decode11.c \
+	decode_bigreq.c \
+	decode_lbx.c \
+	decode_randr.c \
+	decode_render.c \
+	decode_shm.c \
+	decode_wcp.c \
+	decodenas.c \
+	extensions.c \
+	extensions.h \
 	fd.c \
 	fd.h \
+	lbxscope.h \
+	nas.h \
 	print11.c \
+	print_bigreq.c \
+	print_lbx.c \
+	print_randr.c \
+	print_render.c \
+	print_shm.c \
+	print_wcp.c \
+	printnas.c \
 	proto.h \
 	prtype.c \
+	randrscope.h \
+	renderscope.h \
+	scope-transport.c \
 	scope.c \
 	scope.h \
 	server.c \
+	shmscope.h \
 	table11.c \
-	x11.h \
-	scope-transport.c
+	wcpscope.h \
+	x11.h
 
 appman_PRE = \
         xscope.man
 
-
 appmandir = $(APP_MAN_DIR)
 
 appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
@@ -63,7 +86,7 @@ MAINTAINERCLEANFILES = ChangeLog
 .PHONY: ChangeLog
 
 ChangeLog:
-	(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+	$(CHANGELOG_CMD)
 
 dist-hook: ChangeLog
 
@@ -90,3 +113,16 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man
 
 .man.$(APP_MAN_SUFFIX):
 	sed $(MAN_SUBSTS) < $< > $@
+
+if LINT
+# Check source code with tools like lint & sparse
+
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+		$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+
+lint:	$(BUILT_SOURCES)
+	@for f in $(xscope_SOURCES) ; do \
+	    case $$f in *.c) \
+		$(LINT) $(ALL_LINT_FLAGS) $(srcdir)/$$f ;; esac ; \
+        done
+endif LINT
diff --git a/README b/README
index e69de29..39e78b1 100644
--- a/README
+++ b/README
@@ -0,0 +1,91 @@
+
+	XSCOPE -- a program to monitor X11/Client conversations
+
+XSCOPE is a program to monitor the connections between the X11 window
+server and a client program.  xscope runs as a separate process.  By
+adjusting the host and/or display number that a X11 client attaches
+to, the client is attached to xscope instead of X11.  xscope attaches
+to X11 as if it were the client.  All bytes from the client are sent
+to xscope which passes them on to X11; All bytes from X11 are sent to
+xscope which sends them on to the client.  xscope is transparent to
+the client and X11.
+
+In addition to passing characters back and forth, xscope will print
+information about this traffic on stdout, giving performance and
+debugging information for an X11 client and server.
+
+
+  --------------               --------------             --------------
+  |            |               |            |             |            |
+  |            | ------------> |            | ----------> |            |
+  |   client   |               |  xscope    |             |   server   |
+  |            |               |            |             |            |
+  |            | <-----------  |            | <---------- |            |
+  |            |               |            |             |            |
+  --------------               --------------             --------------
+                                     |
+				     |
+				     v
+			    trace output to stdout
+
+
+When running with xscope, three processes are involved, potentially all
+on different machines:
+
+X11 -- the X11 window server will be running on machine "A" for Display "B".
+	("A" is a machine name; "B" is a display number).
+
+xscope -- xscope must be told where the X11 window server is 
+	(what machine and what display).  The options for xscope are 
+	-h<X11-host> and -d<display-number>.  In our example, -hA and -dB. 
+	Typically the display-number is not given. xscope will not try to 
+	connect to X11 until the client connects to xscope.
+
+client -- the client should connect to xscope rather than X11.  To avoid 
+	changing the code for the client, xscope listens on the same port 
+	as X11. If X11 and xscope are on different machines, this works 
+	well.  However, if X11 and xscope are on the same machine, this 
+	creates a port conflict.  To resolve this conflict, xscope can 
+	be given a different input or output port number, as necessary 
+	to avoid the port that X11 is listening to.  The client must connect 
+	to this offset port number.  The input port for xscope is set by 
+	-i<port-number>; the output port is set by -o<port-number>. The 
+	default input port is 1; the default output port is 0. These ports
+	are offset by the X11 base (6000) and the display number. The client 
+	attaches to xscope by changing its display number by the port offset.
+
+For example, with X11 running on "bagel", display 0 (the default), and
+xscope and the client running on "cleo", we would start xscope as
+"xscope -hbagel -i0".  The client program could then connect to "X11" on
+"cleo:0", and would be attached to xscope, which would then attach to
+X11 on "bagel:0".
+
+If, however, all three processes were running on "cleo", we would
+start xscope by "xscope -i1".  This would cause it to listen on
+port 6001 (which is display 1 for X11).  The client would attach to
+X11 on "cleo:1", and xscope would connect through to X11 on "cleo:0".
+
+
+LIMITATIONS:
+
+xscope has been written and used on a Sun3. Additional code may be needed
+for byteswapping on different architectures.
+
+The command line arguments for specifying the real X server should probably
+	be changed to be more consistent with X11R3 applications.
+
+The Imakefile may be incorrect.
+
+The builtin atoms have been wired in directly; they should probably be
+picked up from a header file.
+
+No provision is included for extensions to the base protocol.
+
+There is no code yet to interpret typed commands from the keyboard.
+   It would be possible for a command language at the keyboard to create
+   artificial characters to be sent to X11 or the client as if they were 
+   generated  by the other, or to dynamically alter requests or replies.
+
+
+
+
diff --git a/audio.c b/audio.c
new file mode 100644
index 0000000..94fd08a
[...16285 lines suppressed...]
+			 const unsigned char *values);
+extern void PrintValueRec (unsigned long key, unsigned long cmask,
+			   short ctype);
 
 /* ************************************************************ */
 /*								*/
 /*								*/
 /* ************************************************************ */
 
-/* declaraction of the types of some common functions */
-
-extern unsigned long    ILong();
-extern unsigned short   IShort();
-extern unsigned short   IByte();
-extern Boolean          IBool();
-
-extern long    PrintList();
-extern long    PrintListSTR();
-extern long    pad();
+/* declaration of the types of some common functions */
+
+extern unsigned long    ILong(const unsigned char *buf);
+extern unsigned short   IShort(const unsigned char *buf);
+extern unsigned short   IChar2B(const unsigned char *buf);
+extern unsigned short   IByte(const unsigned char *buf);
+extern Boolean          IBool(const unsigned char *buf);
+
+extern int PrintString8(const unsigned char *buf, int number,
+			const char *name);
+extern int PrintString16(const unsigned char *buf, int number,
+			 const char *name);
+extern void PrintTString8(const unsigned char *buf, long number,
+			  const char *name);
+extern void PrintTString16(const unsigned char *buf, long number,
+			   const char *name);
+
+extern long PrintList (const unsigned char *buf, long number, short ListType,
+		       const char *name);
+extern long PrintListSTR (const unsigned char *buf, long number,
+			  const char *name);
+
+extern long pad(long n);
+
+extern const char REQUESTHEADER[], EVENTHEADER[], ERRORHEADER[], REPLYHEADER[];
+
+#define GC_function		0x00000001L
+#define GC_plane_mask		0x00000002L
+#define GC_foreground		0x00000004L
+#define GC_background		0x00000008L
+#define GC_line_width		0x00000010L
+#define GC_line_style		0x00000020L
+#define GC_cap_style		0x00000040L
+#define GC_join_style		0x00000080L
+#define GC_fill_style		0x00000100L
+#define GC_fill_rule		0x00000200L
+#define GC_tile			0x00000400L
+#define GC_stipple		0x00000800L
+#define GC_tile_stipple_x_origin   0x00001000L
+#define GC_tile_stipple_y_origin   0x00002000L
+#define GC_font			0x00004000L
+#define GC_subwindow_mode	0x00008000L
+#define GC_graphics_exposures   0x00010000L
+#define GC_clip_x_origin	0x00020000L
+#define GC_clip_y_origin	0x00040000L
+#define GC_clip_mask		0x00080000L
+#define GC_dash_offset		0x00100000L
+#define GC_dashes		0x00200000L
+#define GC_arc_mode		0x00400000L
+
+#define printreqlen(buf, fd, dvalue)					\
+	do {								\
+	    if (IShort(&(buf)[2]) == 0 && CS[(fd)].bigreqEnabled) {	\
+		printfield (buf, 4, 4, CARD32, "request length");	\
+		buf += 4;						\
+	    } else {							\
+		printfield (buf, 2, 2, CARD16, "request length");	\
+	    }								\
+	} while (0)
 
 #endif /* XSCOPE_X11_H */
diff --git a/xstats.c b/xstats.c
new file mode 100644
index 0000000..33ec4c7
--- /dev/null
+++ b/xstats.c
@@ -0,0 +1,114 @@
+#define REQUEST	0
+#define REPLY	1
+#define ERROR	2
+#define EVENT	3
+
+string_to_action (s)
+    char    *s;
+{
+    if (!strcmp (s, "@@REQUEST")) return REQUEST;
+    if (!strcmp (s, "@@REPLY")) return REPLY;
+    if (!strcmp (s, "@@ERROR")) return ERROR;
+    if (!strcmp (s, "@@EVENT")) return EVENT;
+}
+    
+typedef struct {
+    double  time;
+    int	    action;
+    int	    client;
+    int	    major;
+    int	    minor;
+    int	    len;
+} ActionRec, *ActionPtr;
+
+unsigned long	requestCount[256][256];
+unsigned long	replyCount[256][256];
+unsigned long	eventCount[256][256];
+unsigned long	errorCount[256][256];
+
+unsigned long	requestBytes[256][256];
+unsigned long	replyBytes[256][256];
+unsigned long	eventBytes[256][256];
+unsigned long	errorBytes[256][256];
+
+unsigned long	tRequestBytes;
+unsigned long	tReplyBytes;
+unsigned long	tEventBytes;
+unsigned long	tErrorBytes;
+    
+unsigned long	tRequestCount;
+unsigned long	tReplyCount;
+unsigned long	tEventCount;
+unsigned long	tErrorCount;
+    
+dump (c, b)
+    unsigned long   c[256][256];
+    unsigned long   b[256][256];
+{
+    int		    i, j;
+    unsigned long   count, bytes;
+
+    for (i = 0; i < 256; i++)
+    {
+	for (j = 0; j < 256; j++)
+	{
+	    if (count = c[i][j])
+	    {
+		bytes = b[i][j];
+		printf ("%3d %3d count %5d bytes %7d\n", i, j, count, bytes);
+	    }
+	}
+    }
+}
+
+main ()
+{
+    ActionRec	a;
+    char	aname[128];
+    int		i, j;
+    
+    while (scanf ("%lf: %s %d %d %d %d\n",
+		  &a.time, aname, &a.client, &a.major, &a.minor, &a.len) == 6)
+    {
+	a.action = string_to_action (aname);
+	switch (a.action) {
+	case REQUEST:
+	    requestCount[a.major][a.minor]++;
+	    requestBytes[a.major][a.minor] += a.len;
+	    tRequestCount++;
+	    tRequestBytes += a.len;
+	    break;
+	case REPLY:
+	    replyCount[a.major][a.minor]++;
+	    replyBytes[a.major][a.minor] += a.len;
+	    tReplyCount++;
+	    tReplyBytes += a.len;
+	    break;
+	case EVENT:
+	    eventCount[a.major][a.minor]++;
+	    eventBytes[a.major][a.minor] += a.len;
+	    tEventCount++;
+	    tEventBytes += a.len;
+	    break;
+	case ERROR:
+	    errorCount[a.major][a.minor]++;
+	    errorBytes[a.major][a.minor] += a.len;
+	    tErrorCount++;
+	    tErrorBytes += a.len;
+	    break;
+	}
+    }
+    printf ("requests:\n");
+    dump (requestCount, requestBytes);
+    printf ("replies:\n");
+    dump (replyCount, replyBytes);
+    printf ("events:\n");
+    dump (eventCount, eventBytes);
+    printf ("errors:\n");
+    dump (errorCount, errorBytes);
+    printf ("send    count %5d bytes %7d\n",
+	    tRequestCount, tRequestBytes);
+    printf ("recv    count %5d bytes %7d\n",
+	    tEventCount + tErrorCount + tReplyCount,
+	    tEventBytes + tErrorBytes + tReplyBytes);
+}

xscope-1.1-lessmacros.patch:

--- NEW FILE xscope-1.1-lessmacros.patch ---
diff -ur xscope-1.1/configure.ac xscope-1.1.lessmacros/configure.ac
--- xscope-1.1/configure.ac	2009-06-27 08:16:40.000000000 +0300
+++ xscope-1.1.lessmacros/configure.ac	2009-06-27 08:17:33.000000000 +0300
@@ -39,7 +39,7 @@
 
 # Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG, XORG_WITH_LINT
 m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.2)
+XORG_MACROS_VERSION(1.1)
 
 AC_PROG_CC
 XORG_CWARNFLAGS


--- NEW FILE xscope.spec ---
Name:           xscope
Version:        1.1
Release:        3.gitfccbbd6%{?dist}
Summary:        X Window Protocol Viewer

Group:          User Interface/X
License:        MIT
URL:            http://cgit.freedesktop.org/xorg/app/xscope/
Source0:        ftp://ftp.freedesktop.org/pub/xorg/individual/app/%{name}-%{version}.tar.bz2
# git diff --diff-filter=ACMRT xscope-1.1 fccbbd6
Patch0:         xscope-1.1-diff_to_git.patch
# to build on Fedora 10 reduce the xorg-macros required version
Patch1:         xscope-1.1-lessmacros.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  xorg-x11-xtrans-devel, xorg-x11-proto-devel
# required for the autoreconf
BuildRequires:  automake, autoconf, xorg-x11-util-macros

%description
xscope sits in-between an X11 client and an X11 server and prints the contents
of each request, reply, error, or event that is communicated between them.
This information can be useful in debugging and performance tuning of X11 
servers and clients.


%prep
%setup -q
%patch0 -p1 -b .diff_to_git
%patch1 -p1 -b .lessmacros
# required for changes in patch0 and patch1
autoreconf -f

%build
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc AUTHORS README COPYING ChangeLog 
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz


%changelog
* Sun Jun 28 2009 Yanko Kaneti <yaneti at declera.com> 1.1-3.gitfccbbd6
- The software has a MIT not BSD license

* Sat Jun 27 2009 Yanko Kaneti <yaneti at declera.com> 1.1-2.gitfccbbd6
- Implement review feedback
- Patch to build on Fedora 10

* Sun Jun 14 2009 Yanko Kaneti <yaneti at declera.com> 1.1-1.gitfccbbd6
- First attempt at packaging.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xscope/F-10/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	1 Jul 2009 02:36:06 -0000	1.1
+++ .cvsignore	1 Jul 2009 05:24:08 -0000	1.2
@@ -0,0 +1 @@
+xscope-1.1.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xscope/F-10/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	1 Jul 2009 02:36:07 -0000	1.1
+++ sources	1 Jul 2009 05:24:08 -0000	1.2
@@ -0,0 +1 @@
+c37ec177b56d5909584c1672b6beabd5  xscope-1.1.tar.bz2




More information about the fedora-extras-commits mailing list