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 unsigned 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(ctf_integer(long, ret
, ret
))
44 sc_in(ctf_integer(int, fd
, fd
))
45 sc_in(ctf_integer_hex(struct sockaddr
*, uservaddr
, uservaddr
))
46 sc_in(ctf_integer_hex(int, addrlen
, addrlen
))
47 sc_in(ctf_integer(int, family
, tp_locvar
->sa_family
))
48 sc_in(ctf_integer_network(uint16_t, dport
, tp_locvar
->dport
))
49 sc_in(ctf_sequence_network(uint8_t, v4addr
, &tp_locvar
->v4addr
, unsigned int, tp_locvar
->v4addr_len
))
50 sc_in(ctf_sequence_network(uint16_t, v6addr
, &tp_locvar
->v6addr
, unsigned int, tp_locvar
->v6addr_len
))
54 #define OVERRIDE_64_accept
55 SC_LTTNG_TRACEPOINT_EVENT_CODE(accept
,
56 TP_PROTO(sc_exit(long ret
,) int fd
, struct sockaddr
* upeer_sockaddr
, int * upeer_addrlen
),
57 TP_ARGS(sc_exit(ret
,) fd
, upeer_sockaddr
, upeer_addrlen
),
59 __typeof__(upeer_sockaddr
->sa_family
) sa_family
;
63 int v4addr_len
, v6addr_len
;
68 memset(tp_locvar
, 0, sizeof(*tp_locvar
));
69 (void) get_user(tp_locvar
->uaddr_len
, upeer_addrlen
);
72 if (tp_locvar
->uaddr_len
< sizeof(struct sockaddr
))
74 (void) get_user(tp_locvar
->sa_family
, &upeer_sockaddr
->sa_family
);
75 switch (tp_locvar
->sa_family
) {
77 if (tp_locvar
->uaddr_len
< sizeof(struct sockaddr_in
))
79 (void) get_user(tp_locvar
->sport
, &((struct sockaddr_in
*) upeer_sockaddr
)->sin_port
);
80 (void) get_user(tp_locvar
->v4addr
, &((struct sockaddr_in
*) upeer_sockaddr
)->sin_addr
.s_addr
);
81 tp_locvar
->v4addr_len
= 4;
84 if (tp_locvar
->uaddr_len
< sizeof(struct sockaddr_in6
))
86 (void) get_user(tp_locvar
->sport
, &((struct sockaddr_in6
*) upeer_sockaddr
)->sin6_port
);
87 if (copy_from_user(tp_locvar
->v6addr
,
88 &((struct sockaddr_in6
*) upeer_sockaddr
)->sin6_addr
.in6_u
.u6_addr8
,
89 sizeof(tp_locvar
->v6addr
)))
90 memset(tp_locvar
->v6addr
, 0, sizeof(tp_locvar
->v6addr
));
91 tp_locvar
->v6addr_len
= 8;
98 sc_exit(ctf_integer(long, ret
, ret
))
99 sc_in(ctf_integer(int, fd
, fd
))
100 sc_in(ctf_integer_hex(struct sockaddr
*, upeer_sockaddr
, upeer_sockaddr
))
101 sc_inout(ctf_integer(int, upeer_addrlen
, tp_locvar
->uaddr_len
))
102 sc_out(ctf_integer(int, family
, tp_locvar
->sa_family
))
103 sc_out(ctf_integer_network(uint16_t, sport
, tp_locvar
->sport
))
104 sc_in(ctf_sequence_network(uint8_t, v4addr
, &tp_locvar
->v4addr
, unsigned int, tp_locvar
->v4addr_len
))
105 sc_in(ctf_sequence_network(uint16_t, v6addr
, &tp_locvar
->v6addr
, unsigned int, tp_locvar
->v6addr_len
))
109 #define OVERRIDE_64_pipe
110 SC_LTTNG_TRACEPOINT_EVENT(pipe
,
111 TP_PROTO(sc_exit(long ret
,) int * fildes
),
112 TP_ARGS(sc_exit(ret
,) fildes
),
113 TP_FIELDS(sc_exit(ctf_integer(long, ret
, ret
))
114 sc_out(ctf_user_array(int, fildes
, fildes
, 2))
118 #else /* CREATE_SYSCALL_TABLE */
120 #define OVERRIDE_TABLE_64_clone
121 TRACE_SYSCALL_TABLE(clone
, clone
, 56, 5)
122 #define OVERRIDE_TABLE_64_execve
123 TRACE_SYSCALL_TABLE(execve
, execve
, 59, 3)
124 #define OVERRIDE_TABLE_64_getcpu
125 TRACE_SYSCALL_TABLE(getcpu
, getcpu
, 309, 3)
127 #endif /* CREATE_SYSCALL_TABLE */
This page took 0.03706 seconds and 4 git commands to generate.