1 /* Copyright (c) 2005-2006, Oracle and/or its affiliates. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a
4  * copy of this software and associated documentation files (the "Software"),
5  * to deal in the Software without restriction, including without limitation
6  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7  * and/or sell copies of the Software, and to permit persons to whom the
8  * Software is furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice (including the next
11  * paragraph) shall be included in all copies or substantial portions of the
12  * Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 /*
24  * Xserver dtrace provider definition
25  */
26 #ifdef __APPLE__
27 #define string char *
28 #define pid_t uint32_t
29 #define zoneid_t uint32_t
30 #elif defined(__FreeBSD__)
31 #define zoneid_t id_t
32 #else
33 #include <sys/types.h>
34 #endif
35 
36 typedef const uint8_t *const_uint8_p;
37 typedef const double *const_double_p;
38 
39 provider Xserver {
40 	/* reqType, data, length, client id, request buffer */
41 	probe request__start(string, uint8_t, uint16_t, int, void *);
42 	/* reqType, data, sequence, client id, result */
43 	probe request__done(string, uint8_t, uint32_t, int, int);
44 	/* client id, client fd */
45 	probe client__connect(int, int);
46 	/* client id, client address, client pid, client zone id */
47 	probe client__auth(int, string, pid_t, zoneid_t);
48 	/* client id */
49 	probe client__disconnect(int);
50 	/* resource id, resource type, value, resource type name */
51 	probe resource__alloc(uint32_t, uint32_t, void *, string);
52 	/* resource id, resource type, value, resource type name */
53 	probe resource__free(uint32_t, uint32_t, void *, string);
54 	/* client id, event type, event* */
55 	probe send__event(int, uint8_t, void *);
56 	/* deviceid, type, button/keycode/touchid, flags, nvalues, mask, values */
57 	probe input__event(int, int, uint32_t, uint32_t, int8_t, const_uint8_p, const_double_p);
58 };
59 
60 #pragma D attributes Unstable/Unstable/Common provider Xserver provider
61 #pragma D attributes Private/Private/Unknown  provider Xserver module
62 #pragma D attributes Private/Private/Unknown  provider Xserver function
63 #pragma D attributes Unstable/Unstable/Common provider Xserver name
64 #pragma D attributes Unstable/Unstable/Common provider Xserver args
65 
66