Migrate tracepoint instrumentation to TP_FIELDS
[lttng-modules.git] / instrumentation / events / lttng-module / lttng-statedump.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM lttng_statedump
3
4 #if !defined(LTTNG_TRACE_LTTNG_STATEDUMP_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_LTTNG_STATEDUMP_H
6
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/nsproxy.h>
9 #include <linux/pid_namespace.h>
10 #include <linux/types.h>
11
12 LTTNG_TRACEPOINT_EVENT(lttng_statedump_start,
13 TP_PROTO(struct lttng_session *session),
14 TP_ARGS(session),
15 TP_FIELDS()
16 )
17
18 LTTNG_TRACEPOINT_EVENT(lttng_statedump_end,
19 TP_PROTO(struct lttng_session *session),
20 TP_ARGS(session),
21 TP_FIELDS()
22 )
23
24 LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_state,
25 TP_PROTO(struct lttng_session *session,
26 struct task_struct *p,
27 int type, int mode, int submode, int status,
28 struct pid_namespace *pid_ns),
29 TP_ARGS(session, p, type, mode, submode, status, pid_ns),
30 TP_FIELDS(
31 ctf_integer(pid_t, tid, p->pid)
32 ctf_integer(pid_t, vtid, pid_ns ? task_pid_nr_ns(p, pid_ns) : 0)
33 ctf_integer(pid_t, pid, p->tgid)
34 ctf_integer(pid_t, vpid, pid_ns ? task_tgid_nr_ns(p, pid_ns) : 0)
35 ctf_integer(pid_t, ppid,
36 ({
37 pid_t ret;
38
39 rcu_read_lock();
40 ret = task_tgid_nr(p->real_parent);
41 rcu_read_unlock();
42 ret;
43 }))
44 ctf_integer(pid_t, vppid,
45 ({
46 struct task_struct *parent;
47 pid_t ret = 0;
48
49 if (pid_ns) {
50 rcu_read_lock();
51 parent = rcu_dereference(p->real_parent);
52 ret = task_tgid_nr_ns(parent, pid_ns);
53 rcu_read_unlock();
54 }
55 ret;
56 }))
57 ctf_array_text(char, name, p->comm, TASK_COMM_LEN)
58 ctf_integer(int, type, type)
59 ctf_integer(int, mode, mode)
60 ctf_integer(int, submode, submode)
61 ctf_integer(int, status, status)
62 ctf_integer(int, ns_level, pid_ns ? pid_ns->level : 0)
63 )
64 )
65
66 LTTNG_TRACEPOINT_EVENT(lttng_statedump_file_descriptor,
67 TP_PROTO(struct lttng_session *session,
68 struct task_struct *p, int fd, const char *filename,
69 unsigned int flags, fmode_t fmode),
70 TP_ARGS(session, p, fd, filename, flags, fmode),
71 TP_FIELDS(
72 ctf_integer(pid_t, pid, p->tgid)
73 ctf_integer(int, fd, fd)
74 ctf_integer_oct(unsigned int, flags, flags)
75 ctf_integer_hex(fmode_t, fmode, fmode)
76 ctf_string(filename, filename)
77 )
78 )
79
80 LTTNG_TRACEPOINT_EVENT(lttng_statedump_vm_map,
81 TP_PROTO(struct lttng_session *session,
82 struct task_struct *p, struct vm_area_struct *map,
83 unsigned long inode),
84 TP_ARGS(session, p, map, inode),
85 TP_FIELDS(
86 ctf_integer(pid_t, pid, p->tgid)
87 ctf_integer_hex(unsigned long, start, map->vm_start)
88 ctf_integer_hex(unsigned long, end, map->vm_end)
89 ctf_integer_hex(unsigned long, flags, map->vm_flags)
90 ctf_integer(unsigned long, inode, inode)
91 ctf_integer(unsigned long, pgoff, map->vm_pgoff << PAGE_SHIFT)
92 )
93 )
94
95 LTTNG_TRACEPOINT_EVENT(lttng_statedump_network_interface,
96 TP_PROTO(struct lttng_session *session,
97 struct net_device *dev, struct in_ifaddr *ifa),
98 TP_ARGS(session, dev, ifa),
99 TP_FIELDS(
100 ctf_string(name, dev->name)
101 ctf_integer_network_hex(uint32_t, address_ipv4,
102 ifa ? ifa->ifa_address : 0U)
103 )
104 )
105
106 LTTNG_TRACEPOINT_EVENT(lttng_statedump_block_device,
107 TP_PROTO(struct lttng_session *session,
108 dev_t dev, const char *diskname),
109 TP_ARGS(session, dev, diskname),
110 TP_FIELDS(
111 ctf_integer(dev_t, dev, dev)
112 ctf_string(diskname, diskname)
113 )
114 )
115
116 /* Called with desc->lock held */
117 LTTNG_TRACEPOINT_EVENT(lttng_statedump_interrupt,
118 TP_PROTO(struct lttng_session *session,
119 unsigned int irq, const char *chip_name,
120 struct irqaction *action),
121 TP_ARGS(session, irq, chip_name, action),
122 TP_FIELDS(
123 ctf_integer(unsigned int, irq, irq)
124 ctf_string(name, chip_name)
125 ctf_string(action, action->name ? : "")
126 )
127 )
128
129 #endif /* LTTNG_TRACE_LTTNG_STATEDUMP_H */
130
131 /* This part must be outside protection */
132 #include "../../../probes/define_trace.h"
This page took 0.041681 seconds and 5 git commands to generate.