1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
| /*
| * Copyright (c) 2012, Chris Andrews. All rights reserved.
| */
|
| /*
| * Stub functions containing DTrace tracepoints for probes and
| * is-enabled probes. These functions are copied for each probe
| * dynamically created.
| *
| */
| .text
|
| .align 4, 0x90
| .globl usdt_tracepoint_isenabled
| .globl _usdt_tracepoint_isenabled
| .globl usdt_tracepoint_probe
| .globl _usdt_tracepoint_probe
| .globl usdt_tracepoint_end
| .globl _usdt_tracepoint_end
| .globl usdt_probe_args
| .globl _usdt_probe_args
|
| usdt_tracepoint_isenabled:
| _usdt_tracepoint_isenabled:
| pushl %ebp
| movl %esp, %ebp
| subl $8, %esp
| xorl %eax, %eax
| nop
| nop
| leave
| ret
| usdt_tracepoint_probe:
| _usdt_tracepoint_probe:
| nop
| nop
| nop
| nop
| nop
| addl $0x20,%esp
| leave
| usdt_tracepoint_end:
| _usdt_tracepoint_end:
| ret
|
| /*
| * Probe argument marshalling, i386 style
| *
| */
|
| usdt_probe_args:
| _usdt_probe_args:
| pushl %ebp
| movl %esp,%ebp
| subl $8,%esp
| subl $8,%esp
| movl 8(%ebp),%edx
| movl 0xc(%ebp),%ecx
| test %ecx,%ecx
| je fire
| args: movl %ecx,%eax
| sal $2,%eax
| subl $4,%eax
| addl 0x10(%ebp),%eax
| pushl (%eax)
| dec %ecx
| jne args
| fire: jmp *%edx
|
|