1 #ifndef CREATE_SYSCALL_TABLE
3 #define OVERRIDE_64_connect
4 SC_LTTNG_TRACEPOINT_EVENT_CODE(connect
,
5 TP_PROTO(sc_exit(long ret
,) int fd
, struct sockaddr
* uservaddr
, int addrlen
),
6 TP_ARGS(sc_exit(ret
,) fd
, uservaddr
, addrlen
),
8 __typeof__(uservaddr
->sa_family
) sa_family
;
12 int v4addr_len
, v6addr_len
;
16 memset(tp_locvar
, 0, sizeof(*tp_locvar
));
17 if (addrlen
< sizeof(struct sockaddr
))
19 (void) get_user(tp_locvar
->sa_family
, &uservaddr
->sa_family
);
20 switch (tp_locvar
->sa_family
) {
22 if (addrlen
< sizeof(struct sockaddr_in
))
24 (void) get_user(tp_locvar
->dport
, &((struct sockaddr_in
*) uservaddr
)->sin_port
);
25 (void) get_user(tp_locvar
->v4addr
, &((struct sockaddr_in
*) uservaddr
)->sin_addr
.s_addr
);
26 tp_locvar
->v4addr_len
= 4;
29 if (addrlen
< sizeof(struct sockaddr_in6
))
31 (void) get_user(tp_locvar
->dport
, &((struct sockaddr_in6
*) uservaddr
)->sin6_port
);
32 if (copy_from_user(tp_locvar
->v6addr
,
33 &((struct sockaddr_in6
*) uservaddr
)->sin6_addr
.in6_u
.u6_addr8
,
34 sizeof(tp_locvar
->v6addr
)))
35 memset(tp_locvar
->v6addr
, 0, sizeof(tp_locvar
->v6addr
));
36 tp_locvar
->v6addr_len
= 8;
43 sc_exit(__field(long, ret
))
44 sc_in(__field(int, fd
))
45 sc_in(__field_hex(struct sockaddr
*, uservaddr
))
46 sc_in(__field_hex(int, addrlen
))
47 sc_in(__field(int, family
))
48 sc_in(__field_network(uint16_t, dport
))
49 sc_in(__dynamic_array_network(uint8_t, v4addr
, tp_locvar
->v4addr_len
))
50 sc_in(__dynamic_array_network_hex(uint16_t, v6addr
, tp_locvar
->v6addr_len
))
53 sc_exit(tp_assign(ret
, ret
))
54 sc_in(tp_assign(fd
, fd
))
55 sc_in(tp_assign(uservaddr
, uservaddr
))
56 sc_in(tp_assign(addrlen
, addrlen
))
57 sc_in(tp_assign(family
, tp_locvar
->sa_family
))
58 sc_in(tp_assign(dport
, tp_locvar
->dport
))
59 sc_in(tp_memcpy_dyn(v4addr
, &tp_locvar
->v4addr
))
60 sc_in(tp_memcpy_dyn(v6addr
, &tp_locvar
->v6addr
))
65 #define OVERRIDE_64_accept
66 SC_LTTNG_TRACEPOINT_EVENT_CODE(accept
,
67 TP_PROTO(sc_exit(long ret
,) int fd
, struct sockaddr
* upeer_sockaddr
, int * upeer_addrlen
),
68 TP_ARGS(sc_exit(ret
,) fd
, upeer_sockaddr
, upeer_addrlen
),
70 __typeof__(upeer_sockaddr
->sa_family
) sa_family
;
74 int v4addr_len
, v6addr_len
;
79 memset(tp_locvar
, 0, sizeof(*tp_locvar
));
80 (void) get_user(tp_locvar
->uaddr_len
, upeer_addrlen
);
83 if (tp_locvar
->uaddr_len
< sizeof(struct sockaddr
))
85 (void) get_user(tp_locvar
->sa_family
, &upeer_sockaddr
->sa_family
);
86 switch (tp_locvar
->sa_family
) {
88 if (tp_locvar
->uaddr_len
< sizeof(struct sockaddr_in
))
90 (void) get_user(tp_locvar
->sport
, &((struct sockaddr_in
*) upeer_sockaddr
)->sin_port
);
91 (void) get_user(tp_locvar
->v4addr
, &((struct sockaddr_in
*) upeer_sockaddr
)->sin_addr
.s_addr
);
92 tp_locvar
->v4addr_len
= 4;
95 if (tp_locvar
->uaddr_len
< sizeof(struct sockaddr_in6
))
97 (void) get_user(tp_locvar
->sport
, &((struct sockaddr_in6
*) upeer_sockaddr
)->sin6_port
);
98 if (copy_from_user(tp_locvar
->v6addr
,
99 &((struct sockaddr_in6
*) upeer_sockaddr
)->sin6_addr
.in6_u
.u6_addr8
,
100 sizeof(tp_locvar
->v6addr
)))
101 memset(tp_locvar
->v6addr
, 0, sizeof(tp_locvar
->v6addr
));
102 tp_locvar
->v6addr_len
= 8;
109 sc_exit(__field(long, ret
))
110 sc_in(__field(int, fd
))
111 sc_in(__field_hex(struct sockaddr
*, upeer_sockaddr
))
112 sc_inout(__field(int, upeer_addrlen
))
113 sc_out(__field(int, family
))
114 sc_out(__field_network(uint16_t, sport
))
115 sc_out(__dynamic_array_network(uint8_t, v4addr
, tp_locvar
->v4addr_len
))
116 sc_out(__dynamic_array_network_hex(uint16_t, v6addr
, tp_locvar
->v6addr_len
))
119 sc_exit(tp_assign(ret
, ret
))
120 sc_in(tp_assign(fd
, fd
))
121 sc_in(tp_assign(upeer_sockaddr
, upeer_sockaddr
))
122 sc_inout(tp_assign(upeer_addrlen
, tp_locvar
->uaddr_len
))
123 sc_out(tp_assign(family
, tp_locvar
->sa_family
))
124 sc_out(tp_assign(sport
, tp_locvar
->sport
))
125 sc_out(tp_memcpy_dyn(v4addr
, &tp_locvar
->v4addr
))
126 sc_out(tp_memcpy_dyn(v6addr
, &tp_locvar
->v6addr
))
131 #else /* CREATE_SYSCALL_TABLE */
133 #define OVERRIDE_TABLE_64_clone
134 TRACE_SYSCALL_TABLE(clone
, clone
, 56, 5)
135 #define OVERRIDE_TABLE_64_execve
136 TRACE_SYSCALL_TABLE(execve
, execve
, 59, 3)
137 #define OVERRIDE_TABLE_64_getcpu
138 TRACE_SYSCALL_TABLE(getcpu
, getcpu
, 309, 3)
140 #endif /* CREATE_SYSCALL_TABLE */
This page took 0.035077 seconds and 4 git commands to generate.