2 #define TRACE_SYSTEM lttng_statedump
4 #if !defined(LTTNG_TRACE_LTTNG_STATEDUMP_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_LTTNG_STATEDUMP_H
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/nsproxy.h>
9 #include <linux/pid_namespace.h>
10 #include <linux/types.h>
11 #include <linux/version.h>
14 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
15 #define lttng_proc_inum ns.inum
17 #define lttng_proc_inum proc_inum
20 LTTNG_TRACEPOINT_EVENT(lttng_statedump_start
,
21 TP_PROTO(struct lttng_session
*session
),
26 LTTNG_TRACEPOINT_EVENT(lttng_statedump_end
,
27 TP_PROTO(struct lttng_session
*session
),
32 LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_state
,
33 TP_PROTO(struct lttng_session
*session
,
34 struct task_struct
*p
,
35 int type
, int mode
, int submode
, int status
,
36 struct pid_namespace
*pid_ns
),
37 TP_ARGS(session
, p
, type
, mode
, submode
, status
, pid_ns
),
39 ctf_integer(pid_t
, tid
, p
->pid
)
40 ctf_integer(pid_t
, vtid
, pid_ns
? task_pid_nr_ns(p
, pid_ns
) : 0)
41 ctf_integer(pid_t
, pid
, p
->tgid
)
42 ctf_integer(pid_t
, vpid
, pid_ns
? task_tgid_nr_ns(p
, pid_ns
) : 0)
43 ctf_integer(pid_t
, ppid
,
48 ret
= task_tgid_nr(p
->real_parent
);
52 ctf_integer(pid_t
, vppid
,
54 struct task_struct
*parent
;
59 parent
= rcu_dereference(p
->real_parent
);
60 ret
= task_tgid_nr_ns(parent
, pid_ns
);
65 ctf_array_text(char, name
, p
->comm
, TASK_COMM_LEN
)
66 ctf_integer(int, type
, type
)
67 ctf_integer(int, mode
, mode
)
68 ctf_integer(int, submode
, submode
)
69 ctf_integer(int, status
, status
)
70 ctf_integer(int, ns_level
, pid_ns
? pid_ns
->level
: 0)
71 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
72 ctf_integer(unsigned int, ns_inum
, pid_ns
? pid_ns
->lttng_proc_inum
: 0)
77 LTTNG_TRACEPOINT_EVENT(lttng_statedump_file_descriptor
,
78 TP_PROTO(struct lttng_session
*session
,
79 struct task_struct
*p
, int fd
, const char *filename
,
80 unsigned int flags
, fmode_t fmode
),
81 TP_ARGS(session
, p
, fd
, filename
, flags
, fmode
),
83 ctf_integer(pid_t
, pid
, p
->tgid
)
84 ctf_integer(int, fd
, fd
)
85 ctf_integer_oct(unsigned int, flags
, flags
)
86 ctf_integer_hex(fmode_t
, fmode
, fmode
)
87 ctf_string(filename
, filename
)
91 LTTNG_TRACEPOINT_EVENT(lttng_statedump_vm_map
,
92 TP_PROTO(struct lttng_session
*session
,
93 struct task_struct
*p
, struct vm_area_struct
*map
,
95 TP_ARGS(session
, p
, map
, inode
),
97 ctf_integer(pid_t
, pid
, p
->tgid
)
98 ctf_integer_hex(unsigned long, start
, map
->vm_start
)
99 ctf_integer_hex(unsigned long, end
, map
->vm_end
)
100 ctf_integer_hex(unsigned long, flags
, map
->vm_flags
)
101 ctf_integer(unsigned long, inode
, inode
)
102 ctf_integer(unsigned long, pgoff
, map
->vm_pgoff
<< PAGE_SHIFT
)
106 LTTNG_TRACEPOINT_EVENT(lttng_statedump_network_interface
,
107 TP_PROTO(struct lttng_session
*session
,
108 struct net_device
*dev
, struct in_ifaddr
*ifa
),
109 TP_ARGS(session
, dev
, ifa
),
111 ctf_string(name
, dev
->name
)
112 ctf_integer_network_hex(uint32_t, address_ipv4
,
113 ifa
? ifa
->ifa_address
: 0U)
117 LTTNG_TRACEPOINT_EVENT(lttng_statedump_block_device
,
118 TP_PROTO(struct lttng_session
*session
,
119 dev_t dev
, const char *diskname
),
120 TP_ARGS(session
, dev
, diskname
),
122 ctf_integer(dev_t
, dev
, dev
)
123 ctf_string(diskname
, diskname
)
127 /* Called with desc->lock held */
128 LTTNG_TRACEPOINT_EVENT(lttng_statedump_interrupt
,
129 TP_PROTO(struct lttng_session
*session
,
130 unsigned int irq
, const char *chip_name
,
131 struct irqaction
*action
),
132 TP_ARGS(session
, irq
, chip_name
, action
),
134 ctf_integer(unsigned int, irq
, irq
)
135 ctf_string(name
, chip_name
)
136 ctf_string(action
, action
->name
? : "")
140 #endif /* LTTNG_TRACE_LTTNG_STATEDUMP_H */
142 /* This part must be outside protection */
143 #include "../../../probes/define_trace.h"