avatar
Rosa has added 55051b3a20
initial: add from SRPM
... ... --- /dev/null
... ... +++ b/.abf.yml
... ... @@ -0,0 +1,2 @@
1
sources:
2
  "strace-4.6.tar.xz": d84d6e215a65454aa5660e7b5c6200f6de39b89e
view file @ 55051b3a20
... ... --- /dev/null
... ... +++ b/strace-usbdevfs.patch
... ... @@ -0,0 +1,243 @@
1
diff -Naurp strace-4.6/defs.h strace-4.6.oden/defs.h
2
--- strace-4.6/defs.h	2011-03-15 18:19:09.000000000 +0100
3
+++ strace-4.6.oden/defs.h	2011-03-16 16:52:11.029913850 +0100
4
@@ -592,6 +592,7 @@ extern int proc_ioctl(struct tcb *, int,
5
 extern int stream_ioctl(struct tcb *, int, int);
6
 #ifdef LINUX
7
 extern int rtc_ioctl(struct tcb *, long, long);
8
+extern int usbdevfs_ioctl(struct tcb *, long, long);
9
 extern int scsi_ioctl(struct tcb *, long, long);
10
 extern int block_ioctl(struct tcb *, long, long);
11
 #endif
12
diff -Naurp strace-4.6/ioctl.c strace-4.6.oden/ioctl.c
13
--- strace-4.6/ioctl.c	2011-01-15 21:15:31.000000000 +0100
14
+++ strace-4.6.oden/ioctl.c	2011-03-16 16:55:21.862390660 +0100
15
@@ -155,6 +155,8 @@ long code, arg;
16
 	case 0x03:
17
 	case 0x12:
18
 		return block_ioctl(tcp, code, arg);
19
+	case 0x55:
20
+		return usbdevfs_ioctl(tcp, code, arg);
21
 	case 0x22:
22
 		return scsi_ioctl(tcp, code, arg);
23
 #endif
24
diff -Naurp strace-4.6/Makefile.am strace-4.6.oden/Makefile.am
25
--- strace-4.6/Makefile.am	2011-03-14 16:32:38.000000000 +0100
26
+++ strace-4.6.oden/Makefile.am	2011-03-16 16:54:28.580140526 +0100
27
@@ -18,7 +18,7 @@ AM_CPPFLAGS = -I$(srcdir)/$(OS)/$(ARCH)
28
 strace_SOURCES = strace.c syscall.c count.c util.c desc.c file.c ipc.c \
29
 		 io.c ioctl.c mem.c net.c process.c bjm.c quota.c \
30
 		 resource.c signal.c sock.c system.c term.c time.c \
31
-                proc.c scsi.c stream.c block.c
32
+		usbdevfs.c proc.c scsi.c stream.c block.c
33
 noinst_HEADERS = defs.h
34
 
35
 EXTRA_DIST = $(man_MANS) errnoent.sh signalent.sh syscallent.sh ioctlsort.c \
36
diff -Naurp strace-4.6/usbdevfs.c strace-4.6.oden/usbdevfs.c
37
--- strace-4.6/usbdevfs.c	1970-01-01 01:00:00.000000000 +0100
38
+++ strace-4.6.oden/usbdevfs.c	2011-03-16 16:52:11.031913898 +0100
39
@@ -0,0 +1,204 @@
40
+/*
41
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
42
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
43
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
44
+ * All rights reserved.
45
+ *
46
+ * Redistribution and use in source and binary forms, with or without
47
+ * modification, are permitted provided that the following conditions
48
+ * are met:
49
+ * 1. Redistributions of source code must retain the above copyright
50
+ *    notice, this list of conditions and the following disclaimer.
51
+ * 2. Redistributions in binary form must reproduce the above copyright
52
+ *    notice, this list of conditions and the following disclaimer in the
53
+ *    documentation and/or other materials provided with the distribution.
54
+ * 3. The name of the author may not be used to endorse or promote products
55
+ *    derived from this software without specific prior written permission.
56
+ *
57
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
58
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
61
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
62
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
66
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67
+ *
68
+ *	$Id: time.c,v 1.11 2004/10/06 22:27:43 roland Exp $
69
+ */
70
+
71
+#include "defs.h"
72
+
73
+#ifdef LINUX
74
+#include <linux/version.h>
75
+#include <sys/timex.h>
76
+#include <linux/ioctl.h>
77
+#include <linux/rtc.h>
78
+#include <linux/usbdevice_fs.h> /* for struct usbdevfs_urb */
79
+#endif /* LINUX */
80
+
81
+#ifdef LINUX
82
+#define USB_ENDPOINT_DIR_MASK          0x80
83
+
84
+static void
85
+print_ctrltransfer(tcp, ctrl)
86
+struct tcb *tcp;
87
+const struct usbdevfs_ctrltransfer *ctrl;
88
+{
89
+	tprintf("{requesttype=0x%x, request=0x%x, "
90
+		"value=0x%x, index=0x%x, "
91
+		"length=%d, timeout=%d, data=",
92
+		ctrl->bRequestType, ctrl->bRequest,
93
+		ctrl->wValue, ctrl->wIndex,
94
+		ctrl->wLength, ctrl->timeout);
95
+	printstr(tcp, (long)ctrl->data, ctrl->wLength);
96
+	tprintf("}");
97
+}
98
+
99
+static void
100
+print_ctrl(tcp, ctrl)
101
+struct tcb *tcp;
102
+const struct usbdevfs_ioctl *ctrl;
103
+{
104
+	tprintf("{ifno=0x%x, ioctl_code=0x%x}",
105
+		ctrl->ifno, ctrl->ioctl_code);
106
+}
107
+
108
+static void
109
+print_connectinfo(tcp, ci)
110
+struct tcb *tcp;
111
+const struct usbdevfs_connectinfo *ci;
112
+{
113
+	tprintf("{devnum=%d, slow=%d}",
114
+		ci->devnum, ci->slow);
115
+}
116
+
117
+
118
+static void
119
+print_urb(tcp, urb)
120
+struct tcb *tcp;
121
+const struct usbdevfs_urb *urb;
122
+{
123
+	tprintf("{type=%d, endpoint=0x%x, status=%d, "
124
+		"flags=0x%x, "
125
+		"buffer_length=%d, "
126
+		"actual_length=%d, start_frame=%d, "
127
+		"number_of_packets=%d, error_count=%d, "
128
+		"signr=%d, usercontext=%p, buffer=",
129
+		urb->type, urb->endpoint, urb->status,
130
+		urb->flags,
131
+		urb->buffer_length,
132
+		urb->actual_length, urb->start_frame,
133
+		urb->number_of_packets, urb->error_count,
134
+		urb->signr, urb->usercontext);
135
+}
136
+
137
+int
138
+usbdevfs_ioctl(tcp, code, arg)
139
+struct tcb *tcp;
140
+long code;
141
+long arg;
142
+{
143
+	switch (code) {
144
+	case USBDEVFS_REAPURBNDELAY:
145
+		if (exiting(tcp)) {
146
+			struct usbdevfs_urb urb;
147
+			void *urbaddr;
148
+			if (umove(tcp, arg, &urbaddr))
149
+				tprintf(", %#lx", arg);
150
+			else {
151
+				if (umove(tcp, urbaddr, &urb))
152
+					tprintf(", %#lx", arg);
153
+				else {
154
+					tprintf(", ");
155
+					print_urb(tcp, &urb);
156
+					printstr(tcp, (long)urb.buffer, urb.buffer_length);
157
+					tprintf("}");
158
+				}
159
+			}
160
+		}
161
+		break;
162
+	case USBDEVFS_CONTROL:
163
+		if (entering(tcp)) {
164
+			struct usbdevfs_ctrltransfer ctrl;
165
+			if (umove(tcp, arg, &ctrl) < 0)
166
+				tprintf(", %#lx", arg);
167
+			else {
168
+				tprintf(", ");
169
+				print_ctrltransfer(tcp, &ctrl);
170
+			}
171
+		}
172
+		break;
173
+		
174
+	case USBDEVFS_SETINTERFACE:
175
+		if (entering(tcp)) {
176
+			struct usbdevfs_setinterface setintf;
177
+			if (umove(tcp, arg, &setintf) < 0)
178
+				tprintf(", %#lx", arg);
179
+			else {
180
+				tprintf(", {interface=%d, altsetting=%d}",
181
+					setintf.interface, setintf.altsetting);
182
+			}
183
+		}
184
+		break;
185
+	case USBDEVFS_CLAIMINTERFACE:
186
+	case USBDEVFS_RELEASEINTERFACE:
187
+	case USBDEVFS_SETCONFIGURATION:
188
+		if (entering(tcp)) {
189
+			int val;
190
+			if (umove(tcp, arg, &val) < 0)
191
+				tprintf(", %#lx", arg);
192
+			else {
193
+				tprintf(", {%d}", val);
194
+			}
195
+		}
196
+		break;
197
+	case USBDEVFS_CONNECTINFO:
198
+		if (exiting(tcp)) {
199
+			struct usbdevfs_connectinfo ci;
200
+			if (umove(tcp, arg, &ci) < 0)
201
+				tprintf(", %#lx", arg);
202
+			else {
203
+				tprintf(", ");
204
+				print_connectinfo(tcp, &ci);
205
+			}
206
+		}
207
+		break;
208
+	case USBDEVFS_IOCTL:
209
+		if (entering(tcp)) {
210
+			struct usbdevfs_ioctl ctrl;
211
+			if (umove(tcp, arg, &ctrl) < 0)
212
+				tprintf(", %#lx", arg);
213
+			else {
214
+				tprintf(", ");
215
+				print_ctrl(tcp, &ctrl);
216
+			}
217
+		}
218
+		break;
219
+	case USBDEVFS_SUBMITURB:
220
+		if (entering(tcp)) {
221
+			struct usbdevfs_urb urb;
222
+			if (umove(tcp, arg, &urb) < 0)
223
+				tprintf(", %#lx", arg);
224
+			else {
225
+				tprintf(", ");
226
+				print_urb(tcp, &urb);
227
+				/* outgoing URB? */
228
+				if ((urb.endpoint & ~USB_ENDPOINT_DIR_MASK) == 0) {
229
+					printstr(tcp, (long)urb.buffer, urb.buffer_length);
230
+				}
231
+				tprintf("}");
232
+
233
+			}
234
+		}
235
+		break;
236
+	default:
237
+		if (entering(tcp))
238
+			tprintf(", %#lx", arg);
239
+		break;
240
+	}
241
+	return 1;
242
+}
243
+#endif /* LINUX */
... ... --- /dev/null
... ... +++ b/strace.spec
... ... @@ -0,0 +1,153 @@
1
Name:		strace
2
Version:	4.6
3
Release:	%mkrel 1
4
Summary:	Tracks and displays system calls associated with a running process
5
License:	BSD
6
Group:		Development/Kernel
7
URL:		http://sourceforge.net/projects/strace/
8
Source0:	http://easynews.dl.sourceforge.net/sourceforge/strace/strace-%{version}.tar.xz
9
# (fc) 4.5.16-2mdv display usbdevfs trace
10
Patch5:		http://iki.fi/lindi/strace-usbdevfs.patch
11
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
12
13
%description
14
The strace program intercepts and records the system calls called
15
and received by a running process.  Strace can print a record of
16
each system call, its arguments and its return value.  Strace is useful
17
for diagnosing problems and debugging, as well as for instructional
18
purposes.
19
20
Install strace if you need a tool to track the system calls made and
21
received by a process.
22
23
%prep
24
%setup -q
25
%patch5 -p1 -b .usbdevfs
26
27
#needed by patch5
28
autoreconf
29
30
%build
31
%configure2_5x
32
%{make}
33
34
%install
35
%{__rm} -rf %{buildroot}
36
%makeinstall_std
37
38
# remove unpackaged files
39
%{__rm} %{buildroot}%{_bindir}/strace-graph
40
41
%clean
42
%{__rm} -rf %{buildroot}
43
44
%files
45
%defattr(-,root,root)
46
%doc COPYRIGHT README* CREDITS ChangeLog INSTALL NEWS PORTING TODO
47
%{_bindir}/strace
48
%{_mandir}/man1/strace.1*
49
50
51
%changelog
52
* Wed Mar 16 2011 Oden Eriksson <oeriksson@mandriva.com> 4.6-1mdv2011.0
53
+ Revision: 645641
54
- 4.6
55
- rediffed P5
56
57
* Fri Dec 03 2010 Oden Eriksson <oeriksson@mandriva.com> 4.5.20-2mdv2011.0
58
+ Revision: 607754
59
- rebuild
60
61
* Mon May 17 2010 Eugeni Dodonov <eugeni@mandriva.com> 4.5.20-1mdv2010.1
62
+ Revision: 544966
63
- Updated to 4.5.20.
64
  Dropped merged patches.
65
66
* Sun Mar 14 2010 Oden Eriksson <oeriksson@mandriva.com> 4.5.19-2mdv2010.1
67
+ Revision: 519093
68
- P6: fix build (debian)
69
- rebuild
70
71
* Fri Oct 23 2009 Eugeni Dodonov <eugeni@mandriva.com> 4.5.19-1mdv2010.0
72
+ Revision: 459011
73
- Updated to 4.5.19.
74
  Drop patches 6,7,8,9 (integrated upstream).
75
76
* Mon Sep 28 2009 Olivier Blin <oblin@mandriva.com> 4.5.18-4mdv2010.0
77
+ Revision: 450366
78
- fix arm eabi (from Arnaud Patard, patch from upstream)
79
80
* Mon May 25 2009 Eugeni Dodonov <eugeni@mandriva.com> 4.5.18-3mdv2010.0
81
+ Revision: 379552
82
- Fixed off-by-one memory allocation error in util.c (#51181).
83
84
* Tue Feb 03 2009 Guillaume Rousse <guillomovitch@mandriva.org> 4.5.18-2mdv2009.1
85
+ Revision: 337175
86
- keep bash completion in its own package
87
88
* Mon Dec 22 2008 Oden Eriksson <oeriksson@mandriva.com> 4.5.18-1mdv2009.1
89
+ Revision: 317635
90
- 4.5.18
91
- drop upstream implemented patches (P0,P1)
92
- rediffed some fuzzy patches
93
- fix build with -Werror=format-security (P6)
94
95
* Wed Jun 18 2008 Thierry Vignaud <tv@mandriva.org> 4.5.16-3mdv2009.0
96
+ Revision: 225504
97
- rebuild
98
- kill re-definition of %%buildroot on Pixel's request
99
100
  + Olivier Blin <oblin@mandriva.com>
101
    - restore BuildRoot
102
103
* Mon Dec 17 2007 Frederic Crozat <fcrozat@mandriva.com> 4.5.16-2mdv2008.1
104
+ Revision: 121734
105
- Patch5 : add verbose output for usbdevfs
106
107
* Sat Nov 10 2007 David Walluck <walluck@mandriva.org> 4.5.16-1mdv2008.1
108
+ Revision: 107364
109
- 4.5.16
110
- update URL
111
112
* Tue May 22 2007 Guillaume Rousse <guillomovitch@mandriva.org> 4.5.15-2mdv2008.0
113
+ Revision: 29893
114
- small completion fix
115
116
117
* Thu Jan 25 2007 Per Øyvind Karlsen <pkarlsen@mandriva.com> 4.5.15-1mdv2007.0
118
+ Revision: 113407
119
- new release: 4.5.15
120
121
* Sun Jan 14 2007 Guillaume Rousse <guillomovitch@mandriva.org> 4.5.14-3mdv2007.1
122
+ Revision: 108816
123
- uncompress all patches
124
- add bash completion
125
- Import strace
126
127
* Sat Jun 10 2006 Per Øyvind Karlsen <pkarlsen@mandriva.com> 4.5.14-2mdv2007.0
128
- add fixes from PLD, will now build on sparc64 :)
129
130
* Tue Jan 17 2006 Stefan van der Eijk <stefan@eijk.nu> 4.5.14-1mdk
131
- 4.5.14
132
133
* Fri Aug 19 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 4.5.13-1mdk
134
- 4.5.13:
135
  * better x86_64 support for ia32 processes
136
  * better printing for linux aoi syscalls
137
  * update ppc syscalls
138
  * other bug fixes: statfs64, socket options (setsockopt, ipv6, 64-bit), etc.
139
140
* Sun Apr 17 2005 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 4.5.11-1mdk
141
- 4.5.11
142
- %%mrel
143
144
* Fri Dec 24 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 4.5.8-1mdk
145
- 4.5.8
146
- fix summary-ended-with-dot
147
148
* Tue Jun 29 2004 Stefan van der Eijk <stefan@mandrake.org> 4.5.5-1mdk
149
- 4.5.5
150
151
* Wed Apr 07 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 4.5.2-1mdk
152
- new release
153

Comments