diff options
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/asoc.h | 45 | ||||
-rw-r--r-- | include/trace/events/btrfs.h | 6 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 6 | ||||
-rw-r--r-- | include/trace/events/sock.h | 68 | ||||
-rw-r--r-- | include/trace/events/udp.h | 32 | ||||
-rw-r--r-- | include/trace/events/vmscan.h | 77 | ||||
-rw-r--r-- | include/trace/events/writeback.h | 183 | ||||
-rw-r--r-- | include/trace/events/xen.h | 504 |
8 files changed, 899 insertions, 22 deletions
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index ae973d2e27a1..603f5a0f0365 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | struct snd_soc_jack; | 10 | struct snd_soc_jack; |
11 | struct snd_soc_codec; | 11 | struct snd_soc_codec; |
12 | struct snd_soc_platform; | ||
12 | struct snd_soc_card; | 13 | struct snd_soc_card; |
13 | struct snd_soc_dapm_widget; | 14 | struct snd_soc_dapm_widget; |
14 | 15 | ||
@@ -59,6 +60,50 @@ DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, | |||
59 | 60 | ||
60 | ); | 61 | ); |
61 | 62 | ||
63 | DECLARE_EVENT_CLASS(snd_soc_preg, | ||
64 | |||
65 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | ||
66 | unsigned int val), | ||
67 | |||
68 | TP_ARGS(platform, reg, val), | ||
69 | |||
70 | TP_STRUCT__entry( | ||
71 | __string( name, platform->name ) | ||
72 | __field( int, id ) | ||
73 | __field( unsigned int, reg ) | ||
74 | __field( unsigned int, val ) | ||
75 | ), | ||
76 | |||
77 | TP_fast_assign( | ||
78 | __assign_str(name, platform->name); | ||
79 | __entry->id = platform->id; | ||
80 | __entry->reg = reg; | ||
81 | __entry->val = val; | ||
82 | ), | ||
83 | |||
84 | TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name), | ||
85 | (int)__entry->id, (unsigned int)__entry->reg, | ||
86 | (unsigned int)__entry->val) | ||
87 | ); | ||
88 | |||
89 | DEFINE_EVENT(snd_soc_preg, snd_soc_preg_write, | ||
90 | |||
91 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | ||
92 | unsigned int val), | ||
93 | |||
94 | TP_ARGS(platform, reg, val) | ||
95 | |||
96 | ); | ||
97 | |||
98 | DEFINE_EVENT(snd_soc_preg, snd_soc_preg_read, | ||
99 | |||
100 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | ||
101 | unsigned int val), | ||
102 | |||
103 | TP_ARGS(platform, reg, val) | ||
104 | |||
105 | ); | ||
106 | |||
62 | DECLARE_EVENT_CLASS(snd_soc_card, | 107 | DECLARE_EVENT_CLASS(snd_soc_card, |
63 | 108 | ||
64 | TP_PROTO(struct snd_soc_card *card, int val), | 109 | TP_PROTO(struct snd_soc_card *card, int val), |
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index 4114129f0794..b31702ac15be 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h | |||
@@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage, | |||
284 | __field( long, pages_skipped ) | 284 | __field( long, pages_skipped ) |
285 | __field( loff_t, range_start ) | 285 | __field( loff_t, range_start ) |
286 | __field( loff_t, range_end ) | 286 | __field( loff_t, range_end ) |
287 | __field( char, nonblocking ) | ||
288 | __field( char, for_kupdate ) | 287 | __field( char, for_kupdate ) |
289 | __field( char, for_reclaim ) | 288 | __field( char, for_reclaim ) |
290 | __field( char, range_cyclic ) | 289 | __field( char, range_cyclic ) |
@@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage, | |||
299 | __entry->pages_skipped = wbc->pages_skipped; | 298 | __entry->pages_skipped = wbc->pages_skipped; |
300 | __entry->range_start = wbc->range_start; | 299 | __entry->range_start = wbc->range_start; |
301 | __entry->range_end = wbc->range_end; | 300 | __entry->range_end = wbc->range_end; |
302 | __entry->nonblocking = wbc->nonblocking; | ||
303 | __entry->for_kupdate = wbc->for_kupdate; | 301 | __entry->for_kupdate = wbc->for_kupdate; |
304 | __entry->for_reclaim = wbc->for_reclaim; | 302 | __entry->for_reclaim = wbc->for_reclaim; |
305 | __entry->range_cyclic = wbc->range_cyclic; | 303 | __entry->range_cyclic = wbc->range_cyclic; |
@@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage, | |||
310 | 308 | ||
311 | TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " | 309 | TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " |
312 | "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " | 310 | "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " |
313 | "range_end = %llu, nonblocking = %d, for_kupdate = %d, " | 311 | "range_end = %llu, for_kupdate = %d, " |
314 | "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", | 312 | "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", |
315 | show_root_type(__entry->root_objectid), | 313 | show_root_type(__entry->root_objectid), |
316 | (unsigned long)__entry->ino, __entry->index, | 314 | (unsigned long)__entry->ino, __entry->index, |
317 | __entry->nr_to_write, __entry->pages_skipped, | 315 | __entry->nr_to_write, __entry->pages_skipped, |
318 | __entry->range_start, __entry->range_end, | 316 | __entry->range_start, __entry->range_end, |
319 | __entry->nonblocking, __entry->for_kupdate, | 317 | __entry->for_kupdate, |
320 | __entry->for_reclaim, __entry->range_cyclic, | 318 | __entry->for_reclaim, __entry->range_cyclic, |
321 | (unsigned long)__entry->writeback_index) | 319 | (unsigned long)__entry->writeback_index) |
322 | ); | 320 | ); |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 5ce2b2f5f524..6363193a3418 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -380,7 +380,6 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
380 | __field( int, pages_written ) | 380 | __field( int, pages_written ) |
381 | __field( long, pages_skipped ) | 381 | __field( long, pages_skipped ) |
382 | __field( int, sync_mode ) | 382 | __field( int, sync_mode ) |
383 | __field( char, more_io ) | ||
384 | __field( pgoff_t, writeback_index ) | 383 | __field( pgoff_t, writeback_index ) |
385 | ), | 384 | ), |
386 | 385 | ||
@@ -391,16 +390,15 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
391 | __entry->pages_written = pages_written; | 390 | __entry->pages_written = pages_written; |
392 | __entry->pages_skipped = wbc->pages_skipped; | 391 | __entry->pages_skipped = wbc->pages_skipped; |
393 | __entry->sync_mode = wbc->sync_mode; | 392 | __entry->sync_mode = wbc->sync_mode; |
394 | __entry->more_io = wbc->more_io; | ||
395 | __entry->writeback_index = inode->i_mapping->writeback_index; | 393 | __entry->writeback_index = inode->i_mapping->writeback_index; |
396 | ), | 394 | ), |
397 | 395 | ||
398 | TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " | 396 | TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " |
399 | " more_io %d sync_mode %d writeback_index %lu", | 397 | "sync_mode %d writeback_index %lu", |
400 | MAJOR(__entry->dev), MINOR(__entry->dev), | 398 | MAJOR(__entry->dev), MINOR(__entry->dev), |
401 | (unsigned long) __entry->ino, __entry->ret, | 399 | (unsigned long) __entry->ino, __entry->ret, |
402 | __entry->pages_written, __entry->pages_skipped, | 400 | __entry->pages_written, __entry->pages_skipped, |
403 | __entry->more_io, __entry->sync_mode, | 401 | __entry->sync_mode, |
404 | (unsigned long) __entry->writeback_index) | 402 | (unsigned long) __entry->writeback_index) |
405 | ); | 403 | ); |
406 | 404 | ||
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h new file mode 100644 index 000000000000..779abb91df81 --- /dev/null +++ b/include/trace/events/sock.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM sock | ||
3 | |||
4 | #if !defined(_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_SOCK_H | ||
6 | |||
7 | #include <net/sock.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | TRACE_EVENT(sock_rcvqueue_full, | ||
11 | |||
12 | TP_PROTO(struct sock *sk, struct sk_buff *skb), | ||
13 | |||
14 | TP_ARGS(sk, skb), | ||
15 | |||
16 | TP_STRUCT__entry( | ||
17 | __field(int, rmem_alloc) | ||
18 | __field(unsigned int, truesize) | ||
19 | __field(int, sk_rcvbuf) | ||
20 | ), | ||
21 | |||
22 | TP_fast_assign( | ||
23 | __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc); | ||
24 | __entry->truesize = skb->truesize; | ||
25 | __entry->sk_rcvbuf = sk->sk_rcvbuf; | ||
26 | ), | ||
27 | |||
28 | TP_printk("rmem_alloc=%d truesize=%u sk_rcvbuf=%d", | ||
29 | __entry->rmem_alloc, __entry->truesize, __entry->sk_rcvbuf) | ||
30 | ); | ||
31 | |||
32 | TRACE_EVENT(sock_exceed_buf_limit, | ||
33 | |||
34 | TP_PROTO(struct sock *sk, struct proto *prot, long allocated), | ||
35 | |||
36 | TP_ARGS(sk, prot, allocated), | ||
37 | |||
38 | TP_STRUCT__entry( | ||
39 | __array(char, name, 32) | ||
40 | __field(long *, sysctl_mem) | ||
41 | __field(long, allocated) | ||
42 | __field(int, sysctl_rmem) | ||
43 | __field(int, rmem_alloc) | ||
44 | ), | ||
45 | |||
46 | TP_fast_assign( | ||
47 | strncpy(__entry->name, prot->name, 32); | ||
48 | __entry->sysctl_mem = prot->sysctl_mem; | ||
49 | __entry->allocated = allocated; | ||
50 | __entry->sysctl_rmem = prot->sysctl_rmem[0]; | ||
51 | __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc); | ||
52 | ), | ||
53 | |||
54 | TP_printk("proto:%s sysctl_mem=%ld,%ld,%ld allocated=%ld " | ||
55 | "sysctl_rmem=%d rmem_alloc=%d", | ||
56 | __entry->name, | ||
57 | __entry->sysctl_mem[0], | ||
58 | __entry->sysctl_mem[1], | ||
59 | __entry->sysctl_mem[2], | ||
60 | __entry->allocated, | ||
61 | __entry->sysctl_rmem, | ||
62 | __entry->rmem_alloc) | ||
63 | ); | ||
64 | |||
65 | #endif /* _TRACE_SOCK_H */ | ||
66 | |||
67 | /* This part must be outside protection */ | ||
68 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/udp.h b/include/trace/events/udp.h new file mode 100644 index 000000000000..a664bb940973 --- /dev/null +++ b/include/trace/events/udp.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM udp | ||
3 | |||
4 | #if !defined(_TRACE_UDP_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_UDP_H | ||
6 | |||
7 | #include <linux/udp.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | TRACE_EVENT(udp_fail_queue_rcv_skb, | ||
11 | |||
12 | TP_PROTO(int rc, struct sock *sk), | ||
13 | |||
14 | TP_ARGS(rc, sk), | ||
15 | |||
16 | TP_STRUCT__entry( | ||
17 | __field(int, rc) | ||
18 | __field(__u16, lport) | ||
19 | ), | ||
20 | |||
21 | TP_fast_assign( | ||
22 | __entry->rc = rc; | ||
23 | __entry->lport = inet_sk(sk)->inet_num; | ||
24 | ), | ||
25 | |||
26 | TP_printk("rc=%d port=%hu", __entry->rc, __entry->lport) | ||
27 | ); | ||
28 | |||
29 | #endif /* _TRACE_UDP_H */ | ||
30 | |||
31 | /* This part must be outside protection */ | ||
32 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index b2c33bd955fa..36851f7f13da 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -179,6 +179,83 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_re | |||
179 | TP_ARGS(nr_reclaimed) | 179 | TP_ARGS(nr_reclaimed) |
180 | ); | 180 | ); |
181 | 181 | ||
182 | TRACE_EVENT(mm_shrink_slab_start, | ||
183 | TP_PROTO(struct shrinker *shr, struct shrink_control *sc, | ||
184 | long nr_objects_to_shrink, unsigned long pgs_scanned, | ||
185 | unsigned long lru_pgs, unsigned long cache_items, | ||
186 | unsigned long long delta, unsigned long total_scan), | ||
187 | |||
188 | TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs, | ||
189 | cache_items, delta, total_scan), | ||
190 | |||
191 | TP_STRUCT__entry( | ||
192 | __field(struct shrinker *, shr) | ||
193 | __field(void *, shrink) | ||
194 | __field(long, nr_objects_to_shrink) | ||
195 | __field(gfp_t, gfp_flags) | ||
196 | __field(unsigned long, pgs_scanned) | ||
197 | __field(unsigned long, lru_pgs) | ||
198 | __field(unsigned long, cache_items) | ||
199 | __field(unsigned long long, delta) | ||
200 | __field(unsigned long, total_scan) | ||
201 | ), | ||
202 | |||
203 | TP_fast_assign( | ||
204 | __entry->shr = shr; | ||
205 | __entry->shrink = shr->shrink; | ||
206 | __entry->nr_objects_to_shrink = nr_objects_to_shrink; | ||
207 | __entry->gfp_flags = sc->gfp_mask; | ||
208 | __entry->pgs_scanned = pgs_scanned; | ||
209 | __entry->lru_pgs = lru_pgs; | ||
210 | __entry->cache_items = cache_items; | ||
211 | __entry->delta = delta; | ||
212 | __entry->total_scan = total_scan; | ||
213 | ), | ||
214 | |||
215 | TP_printk("%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld", | ||
216 | __entry->shrink, | ||
217 | __entry->shr, | ||
218 | __entry->nr_objects_to_shrink, | ||
219 | show_gfp_flags(__entry->gfp_flags), | ||
220 | __entry->pgs_scanned, | ||
221 | __entry->lru_pgs, | ||
222 | __entry->cache_items, | ||
223 | __entry->delta, | ||
224 | __entry->total_scan) | ||
225 | ); | ||
226 | |||
227 | TRACE_EVENT(mm_shrink_slab_end, | ||
228 | TP_PROTO(struct shrinker *shr, int shrinker_retval, | ||
229 | long unused_scan_cnt, long new_scan_cnt), | ||
230 | |||
231 | TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), | ||
232 | |||
233 | TP_STRUCT__entry( | ||
234 | __field(struct shrinker *, shr) | ||
235 | __field(void *, shrink) | ||
236 | __field(long, unused_scan) | ||
237 | __field(long, new_scan) | ||
238 | __field(int, retval) | ||
239 | __field(long, total_scan) | ||
240 | ), | ||
241 | |||
242 | TP_fast_assign( | ||
243 | __entry->shr = shr; | ||
244 | __entry->shrink = shr->shrink; | ||
245 | __entry->unused_scan = unused_scan_cnt; | ||
246 | __entry->new_scan = new_scan_cnt; | ||
247 | __entry->retval = shrinker_retval; | ||
248 | __entry->total_scan = new_scan_cnt - unused_scan_cnt; | ||
249 | ), | ||
250 | |||
251 | TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", | ||
252 | __entry->shrink, | ||
253 | __entry->shr, | ||
254 | __entry->unused_scan, | ||
255 | __entry->new_scan, | ||
256 | __entry->total_scan, | ||
257 | __entry->retval) | ||
258 | ); | ||
182 | 259 | ||
183 | DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, | 260 | DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
184 | 261 | ||
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 4e249b927eaa..6bca4cc0063c 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -8,6 +8,19 @@ | |||
8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
9 | #include <linux/writeback.h> | 9 | #include <linux/writeback.h> |
10 | 10 | ||
11 | #define show_inode_state(state) \ | ||
12 | __print_flags(state, "|", \ | ||
13 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ | ||
14 | {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ | ||
15 | {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ | ||
16 | {I_NEW, "I_NEW"}, \ | ||
17 | {I_WILL_FREE, "I_WILL_FREE"}, \ | ||
18 | {I_FREEING, "I_FREEING"}, \ | ||
19 | {I_CLEAR, "I_CLEAR"}, \ | ||
20 | {I_SYNC, "I_SYNC"}, \ | ||
21 | {I_REFERENCED, "I_REFERENCED"} \ | ||
22 | ) | ||
23 | |||
11 | struct wb_writeback_work; | 24 | struct wb_writeback_work; |
12 | 25 | ||
13 | DECLARE_EVENT_CLASS(writeback_work_class, | 26 | DECLARE_EVENT_CLASS(writeback_work_class, |
@@ -49,6 +62,9 @@ DEFINE_EVENT(writeback_work_class, name, \ | |||
49 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); | 62 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); |
50 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); | 63 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); |
51 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); | 64 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); |
65 | DEFINE_WRITEBACK_WORK_EVENT(writeback_start); | ||
66 | DEFINE_WRITEBACK_WORK_EVENT(writeback_written); | ||
67 | DEFINE_WRITEBACK_WORK_EVENT(writeback_wait); | ||
52 | 68 | ||
53 | TRACE_EVENT(writeback_pages_written, | 69 | TRACE_EVENT(writeback_pages_written, |
54 | TP_PROTO(long pages_written), | 70 | TP_PROTO(long pages_written), |
@@ -88,6 +104,30 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | |||
88 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | 104 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); |
89 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | 105 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); |
90 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | 106 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); |
107 | DEFINE_WRITEBACK_EVENT(balance_dirty_start); | ||
108 | DEFINE_WRITEBACK_EVENT(balance_dirty_wait); | ||
109 | |||
110 | TRACE_EVENT(balance_dirty_written, | ||
111 | |||
112 | TP_PROTO(struct backing_dev_info *bdi, int written), | ||
113 | |||
114 | TP_ARGS(bdi, written), | ||
115 | |||
116 | TP_STRUCT__entry( | ||
117 | __array(char, name, 32) | ||
118 | __field(int, written) | ||
119 | ), | ||
120 | |||
121 | TP_fast_assign( | ||
122 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
123 | __entry->written = written; | ||
124 | ), | ||
125 | |||
126 | TP_printk("bdi %s written %d", | ||
127 | __entry->name, | ||
128 | __entry->written | ||
129 | ) | ||
130 | ); | ||
91 | 131 | ||
92 | DECLARE_EVENT_CLASS(wbc_class, | 132 | DECLARE_EVENT_CLASS(wbc_class, |
93 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | 133 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
@@ -101,8 +141,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
101 | __field(int, for_background) | 141 | __field(int, for_background) |
102 | __field(int, for_reclaim) | 142 | __field(int, for_reclaim) |
103 | __field(int, range_cyclic) | 143 | __field(int, range_cyclic) |
104 | __field(int, more_io) | ||
105 | __field(unsigned long, older_than_this) | ||
106 | __field(long, range_start) | 144 | __field(long, range_start) |
107 | __field(long, range_end) | 145 | __field(long, range_end) |
108 | ), | 146 | ), |
@@ -116,15 +154,12 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
116 | __entry->for_background = wbc->for_background; | 154 | __entry->for_background = wbc->for_background; |
117 | __entry->for_reclaim = wbc->for_reclaim; | 155 | __entry->for_reclaim = wbc->for_reclaim; |
118 | __entry->range_cyclic = wbc->range_cyclic; | 156 | __entry->range_cyclic = wbc->range_cyclic; |
119 | __entry->more_io = wbc->more_io; | ||
120 | __entry->older_than_this = wbc->older_than_this ? | ||
121 | *wbc->older_than_this : 0; | ||
122 | __entry->range_start = (long)wbc->range_start; | 157 | __entry->range_start = (long)wbc->range_start; |
123 | __entry->range_end = (long)wbc->range_end; | 158 | __entry->range_end = (long)wbc->range_end; |
124 | ), | 159 | ), |
125 | 160 | ||
126 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " | 161 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " |
127 | "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " | 162 | "bgrd=%d reclm=%d cyclic=%d " |
128 | "start=0x%lx end=0x%lx", | 163 | "start=0x%lx end=0x%lx", |
129 | __entry->name, | 164 | __entry->name, |
130 | __entry->nr_to_write, | 165 | __entry->nr_to_write, |
@@ -134,8 +169,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
134 | __entry->for_background, | 169 | __entry->for_background, |
135 | __entry->for_reclaim, | 170 | __entry->for_reclaim, |
136 | __entry->range_cyclic, | 171 | __entry->range_cyclic, |
137 | __entry->more_io, | ||
138 | __entry->older_than_this, | ||
139 | __entry->range_start, | 172 | __entry->range_start, |
140 | __entry->range_end) | 173 | __entry->range_end) |
141 | ) | 174 | ) |
@@ -144,14 +177,79 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
144 | DEFINE_EVENT(wbc_class, name, \ | 177 | DEFINE_EVENT(wbc_class, name, \ |
145 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ | 178 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ |
146 | TP_ARGS(wbc, bdi)) | 179 | TP_ARGS(wbc, bdi)) |
147 | DEFINE_WBC_EVENT(wbc_writeback_start); | ||
148 | DEFINE_WBC_EVENT(wbc_writeback_written); | ||
149 | DEFINE_WBC_EVENT(wbc_writeback_wait); | ||
150 | DEFINE_WBC_EVENT(wbc_balance_dirty_start); | ||
151 | DEFINE_WBC_EVENT(wbc_balance_dirty_written); | ||
152 | DEFINE_WBC_EVENT(wbc_balance_dirty_wait); | ||
153 | DEFINE_WBC_EVENT(wbc_writepage); | 180 | DEFINE_WBC_EVENT(wbc_writepage); |
154 | 181 | ||
182 | TRACE_EVENT(writeback_queue_io, | ||
183 | TP_PROTO(struct bdi_writeback *wb, | ||
184 | unsigned long *older_than_this, | ||
185 | int moved), | ||
186 | TP_ARGS(wb, older_than_this, moved), | ||
187 | TP_STRUCT__entry( | ||
188 | __array(char, name, 32) | ||
189 | __field(unsigned long, older) | ||
190 | __field(long, age) | ||
191 | __field(int, moved) | ||
192 | ), | ||
193 | TP_fast_assign( | ||
194 | strncpy(__entry->name, dev_name(wb->bdi->dev), 32); | ||
195 | __entry->older = older_than_this ? *older_than_this : 0; | ||
196 | __entry->age = older_than_this ? | ||
197 | (jiffies - *older_than_this) * 1000 / HZ : -1; | ||
198 | __entry->moved = moved; | ||
199 | ), | ||
200 | TP_printk("bdi %s: older=%lu age=%ld enqueue=%d", | ||
201 | __entry->name, | ||
202 | __entry->older, /* older_than_this in jiffies */ | ||
203 | __entry->age, /* older_than_this in relative milliseconds */ | ||
204 | __entry->moved) | ||
205 | ); | ||
206 | |||
207 | TRACE_EVENT(global_dirty_state, | ||
208 | |||
209 | TP_PROTO(unsigned long background_thresh, | ||
210 | unsigned long dirty_thresh | ||
211 | ), | ||
212 | |||
213 | TP_ARGS(background_thresh, | ||
214 | dirty_thresh | ||
215 | ), | ||
216 | |||
217 | TP_STRUCT__entry( | ||
218 | __field(unsigned long, nr_dirty) | ||
219 | __field(unsigned long, nr_writeback) | ||
220 | __field(unsigned long, nr_unstable) | ||
221 | __field(unsigned long, background_thresh) | ||
222 | __field(unsigned long, dirty_thresh) | ||
223 | __field(unsigned long, dirty_limit) | ||
224 | __field(unsigned long, nr_dirtied) | ||
225 | __field(unsigned long, nr_written) | ||
226 | ), | ||
227 | |||
228 | TP_fast_assign( | ||
229 | __entry->nr_dirty = global_page_state(NR_FILE_DIRTY); | ||
230 | __entry->nr_writeback = global_page_state(NR_WRITEBACK); | ||
231 | __entry->nr_unstable = global_page_state(NR_UNSTABLE_NFS); | ||
232 | __entry->nr_dirtied = global_page_state(NR_DIRTIED); | ||
233 | __entry->nr_written = global_page_state(NR_WRITTEN); | ||
234 | __entry->background_thresh = background_thresh; | ||
235 | __entry->dirty_thresh = dirty_thresh; | ||
236 | __entry->dirty_limit = global_dirty_limit; | ||
237 | ), | ||
238 | |||
239 | TP_printk("dirty=%lu writeback=%lu unstable=%lu " | ||
240 | "bg_thresh=%lu thresh=%lu limit=%lu " | ||
241 | "dirtied=%lu written=%lu", | ||
242 | __entry->nr_dirty, | ||
243 | __entry->nr_writeback, | ||
244 | __entry->nr_unstable, | ||
245 | __entry->background_thresh, | ||
246 | __entry->dirty_thresh, | ||
247 | __entry->dirty_limit, | ||
248 | __entry->nr_dirtied, | ||
249 | __entry->nr_written | ||
250 | ) | ||
251 | ); | ||
252 | |||
155 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, | 253 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, |
156 | 254 | ||
157 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), | 255 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), |
@@ -187,6 +285,63 @@ DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested, | |||
187 | TP_ARGS(usec_timeout, usec_delayed) | 285 | TP_ARGS(usec_timeout, usec_delayed) |
188 | ); | 286 | ); |
189 | 287 | ||
288 | DECLARE_EVENT_CLASS(writeback_single_inode_template, | ||
289 | |||
290 | TP_PROTO(struct inode *inode, | ||
291 | struct writeback_control *wbc, | ||
292 | unsigned long nr_to_write | ||
293 | ), | ||
294 | |||
295 | TP_ARGS(inode, wbc, nr_to_write), | ||
296 | |||
297 | TP_STRUCT__entry( | ||
298 | __array(char, name, 32) | ||
299 | __field(unsigned long, ino) | ||
300 | __field(unsigned long, state) | ||
301 | __field(unsigned long, age) | ||
302 | __field(unsigned long, writeback_index) | ||
303 | __field(long, nr_to_write) | ||
304 | __field(unsigned long, wrote) | ||
305 | ), | ||
306 | |||
307 | TP_fast_assign( | ||
308 | strncpy(__entry->name, | ||
309 | dev_name(inode->i_mapping->backing_dev_info->dev), 32); | ||
310 | __entry->ino = inode->i_ino; | ||
311 | __entry->state = inode->i_state; | ||
312 | __entry->age = (jiffies - inode->dirtied_when) * | ||
313 | 1000 / HZ; | ||
314 | __entry->writeback_index = inode->i_mapping->writeback_index; | ||
315 | __entry->nr_to_write = nr_to_write; | ||
316 | __entry->wrote = nr_to_write - wbc->nr_to_write; | ||
317 | ), | ||
318 | |||
319 | TP_printk("bdi %s: ino=%lu state=%s age=%lu " | ||
320 | "index=%lu to_write=%ld wrote=%lu", | ||
321 | __entry->name, | ||
322 | __entry->ino, | ||
323 | show_inode_state(__entry->state), | ||
324 | __entry->age, | ||
325 | __entry->writeback_index, | ||
326 | __entry->nr_to_write, | ||
327 | __entry->wrote | ||
328 | ) | ||
329 | ); | ||
330 | |||
331 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_requeue, | ||
332 | TP_PROTO(struct inode *inode, | ||
333 | struct writeback_control *wbc, | ||
334 | unsigned long nr_to_write), | ||
335 | TP_ARGS(inode, wbc, nr_to_write) | ||
336 | ); | ||
337 | |||
338 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, | ||
339 | TP_PROTO(struct inode *inode, | ||
340 | struct writeback_control *wbc, | ||
341 | unsigned long nr_to_write), | ||
342 | TP_ARGS(inode, wbc, nr_to_write) | ||
343 | ); | ||
344 | |||
190 | #endif /* _TRACE_WRITEBACK_H */ | 345 | #endif /* _TRACE_WRITEBACK_H */ |
191 | 346 | ||
192 | /* This part must be outside protection */ | 347 | /* This part must be outside protection */ |
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h new file mode 100644 index 000000000000..44d8decee09e --- /dev/null +++ b/include/trace/events/xen.h | |||
@@ -0,0 +1,504 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM xen | ||
3 | |||
4 | #if !defined(_TRACE_XEN_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_XEN_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | #include <asm/paravirt_types.h> | ||
9 | #include <asm/xen/trace_types.h> | ||
10 | |||
11 | /* Multicalls */ | ||
12 | DECLARE_EVENT_CLASS(xen_mc__batch, | ||
13 | TP_PROTO(enum paravirt_lazy_mode mode), | ||
14 | TP_ARGS(mode), | ||
15 | TP_STRUCT__entry( | ||
16 | __field(enum paravirt_lazy_mode, mode) | ||
17 | ), | ||
18 | TP_fast_assign(__entry->mode = mode), | ||
19 | TP_printk("start batch LAZY_%s", | ||
20 | (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" : | ||
21 | (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE") | ||
22 | ); | ||
23 | #define DEFINE_XEN_MC_BATCH(name) \ | ||
24 | DEFINE_EVENT(xen_mc__batch, name, \ | ||
25 | TP_PROTO(enum paravirt_lazy_mode mode), \ | ||
26 | TP_ARGS(mode)) | ||
27 | |||
28 | DEFINE_XEN_MC_BATCH(xen_mc_batch); | ||
29 | DEFINE_XEN_MC_BATCH(xen_mc_issue); | ||
30 | |||
31 | TRACE_EVENT(xen_mc_entry, | ||
32 | TP_PROTO(struct multicall_entry *mc, unsigned nargs), | ||
33 | TP_ARGS(mc, nargs), | ||
34 | TP_STRUCT__entry( | ||
35 | __field(unsigned int, op) | ||
36 | __field(unsigned int, nargs) | ||
37 | __array(unsigned long, args, 6) | ||
38 | ), | ||
39 | TP_fast_assign(__entry->op = mc->op; | ||
40 | __entry->nargs = nargs; | ||
41 | memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs); | ||
42 | memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs)); | ||
43 | ), | ||
44 | TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]", | ||
45 | __entry->op, xen_hypercall_name(__entry->op), | ||
46 | __entry->args[0], __entry->args[1], __entry->args[2], | ||
47 | __entry->args[3], __entry->args[4], __entry->args[5]) | ||
48 | ); | ||
49 | |||
50 | TRACE_EVENT(xen_mc_entry_alloc, | ||
51 | TP_PROTO(size_t args), | ||
52 | TP_ARGS(args), | ||
53 | TP_STRUCT__entry( | ||
54 | __field(size_t, args) | ||
55 | ), | ||
56 | TP_fast_assign(__entry->args = args), | ||
57 | TP_printk("alloc entry %zu arg bytes", __entry->args) | ||
58 | ); | ||
59 | |||
60 | TRACE_EVENT(xen_mc_callback, | ||
61 | TP_PROTO(xen_mc_callback_fn_t fn, void *data), | ||
62 | TP_ARGS(fn, data), | ||
63 | TP_STRUCT__entry( | ||
64 | __field(xen_mc_callback_fn_t, fn) | ||
65 | __field(void *, data) | ||
66 | ), | ||
67 | TP_fast_assign( | ||
68 | __entry->fn = fn; | ||
69 | __entry->data = data; | ||
70 | ), | ||
71 | TP_printk("callback %pf, data %p", | ||
72 | __entry->fn, __entry->data) | ||
73 | ); | ||
74 | |||
75 | TRACE_EVENT(xen_mc_flush_reason, | ||
76 | TP_PROTO(enum xen_mc_flush_reason reason), | ||
77 | TP_ARGS(reason), | ||
78 | TP_STRUCT__entry( | ||
79 | __field(enum xen_mc_flush_reason, reason) | ||
80 | ), | ||
81 | TP_fast_assign(__entry->reason = reason), | ||
82 | TP_printk("flush reason %s", | ||
83 | (__entry->reason == XEN_MC_FL_NONE) ? "NONE" : | ||
84 | (__entry->reason == XEN_MC_FL_BATCH) ? "BATCH" : | ||
85 | (__entry->reason == XEN_MC_FL_ARGS) ? "ARGS" : | ||
86 | (__entry->reason == XEN_MC_FL_CALLBACK) ? "CALLBACK" : "??") | ||
87 | ); | ||
88 | |||
89 | TRACE_EVENT(xen_mc_flush, | ||
90 | TP_PROTO(unsigned mcidx, unsigned argidx, unsigned cbidx), | ||
91 | TP_ARGS(mcidx, argidx, cbidx), | ||
92 | TP_STRUCT__entry( | ||
93 | __field(unsigned, mcidx) | ||
94 | __field(unsigned, argidx) | ||
95 | __field(unsigned, cbidx) | ||
96 | ), | ||
97 | TP_fast_assign(__entry->mcidx = mcidx; | ||
98 | __entry->argidx = argidx; | ||
99 | __entry->cbidx = cbidx), | ||
100 | TP_printk("flushing %u hypercalls, %u arg bytes, %u callbacks", | ||
101 | __entry->mcidx, __entry->argidx, __entry->cbidx) | ||
102 | ); | ||
103 | |||
104 | TRACE_EVENT(xen_mc_extend_args, | ||
105 | TP_PROTO(unsigned long op, size_t args, enum xen_mc_extend_args res), | ||
106 | TP_ARGS(op, args, res), | ||
107 | TP_STRUCT__entry( | ||
108 | __field(unsigned int, op) | ||
109 | __field(size_t, args) | ||
110 | __field(enum xen_mc_extend_args, res) | ||
111 | ), | ||
112 | TP_fast_assign(__entry->op = op; | ||
113 | __entry->args = args; | ||
114 | __entry->res = res), | ||
115 | TP_printk("extending op %u%s by %zu bytes res %s", | ||
116 | __entry->op, xen_hypercall_name(__entry->op), | ||
117 | __entry->args, | ||
118 | __entry->res == XEN_MC_XE_OK ? "OK" : | ||
119 | __entry->res == XEN_MC_XE_BAD_OP ? "BAD_OP" : | ||
120 | __entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???") | ||
121 | ); | ||
122 | |||
123 | /* mmu */ | ||
124 | DECLARE_EVENT_CLASS(xen_mmu__set_pte, | ||
125 | TP_PROTO(pte_t *ptep, pte_t pteval), | ||
126 | TP_ARGS(ptep, pteval), | ||
127 | TP_STRUCT__entry( | ||
128 | __field(pte_t *, ptep) | ||
129 | __field(pteval_t, pteval) | ||
130 | ), | ||
131 | TP_fast_assign(__entry->ptep = ptep; | ||
132 | __entry->pteval = pteval.pte), | ||
133 | TP_printk("ptep %p pteval %0*llx (raw %0*llx)", | ||
134 | __entry->ptep, | ||
135 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), | ||
136 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) | ||
137 | ); | ||
138 | |||
139 | #define DEFINE_XEN_MMU_SET_PTE(name) \ | ||
140 | DEFINE_EVENT(xen_mmu__set_pte, name, \ | ||
141 | TP_PROTO(pte_t *ptep, pte_t pteval), \ | ||
142 | TP_ARGS(ptep, pteval)) | ||
143 | |||
144 | DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte); | ||
145 | DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte_atomic); | ||
146 | |||
147 | TRACE_EVENT(xen_mmu_set_domain_pte, | ||
148 | TP_PROTO(pte_t *ptep, pte_t pteval, unsigned domid), | ||
149 | TP_ARGS(ptep, pteval, domid), | ||
150 | TP_STRUCT__entry( | ||
151 | __field(pte_t *, ptep) | ||
152 | __field(pteval_t, pteval) | ||
153 | __field(unsigned, domid) | ||
154 | ), | ||
155 | TP_fast_assign(__entry->ptep = ptep; | ||
156 | __entry->pteval = pteval.pte; | ||
157 | __entry->domid = domid), | ||
158 | TP_printk("ptep %p pteval %0*llx (raw %0*llx) domid %u", | ||
159 | __entry->ptep, | ||
160 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), | ||
161 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval, | ||
162 | __entry->domid) | ||
163 | ); | ||
164 | |||
165 | TRACE_EVENT(xen_mmu_set_pte_at, | ||
166 | TP_PROTO(struct mm_struct *mm, unsigned long addr, | ||
167 | pte_t *ptep, pte_t pteval), | ||
168 | TP_ARGS(mm, addr, ptep, pteval), | ||
169 | TP_STRUCT__entry( | ||
170 | __field(struct mm_struct *, mm) | ||
171 | __field(unsigned long, addr) | ||
172 | __field(pte_t *, ptep) | ||
173 | __field(pteval_t, pteval) | ||
174 | ), | ||
175 | TP_fast_assign(__entry->mm = mm; | ||
176 | __entry->addr = addr; | ||
177 | __entry->ptep = ptep; | ||
178 | __entry->pteval = pteval.pte), | ||
179 | TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)", | ||
180 | __entry->mm, __entry->addr, __entry->ptep, | ||
181 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), | ||
182 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) | ||
183 | ); | ||
184 | |||
185 | TRACE_EVENT(xen_mmu_pte_clear, | ||
186 | TP_PROTO(struct mm_struct *mm, unsigned long addr, pte_t *ptep), | ||
187 | TP_ARGS(mm, addr, ptep), | ||
188 | TP_STRUCT__entry( | ||
189 | __field(struct mm_struct *, mm) | ||
190 | __field(unsigned long, addr) | ||
191 | __field(pte_t *, ptep) | ||
192 | ), | ||
193 | TP_fast_assign(__entry->mm = mm; | ||
194 | __entry->addr = addr; | ||
195 | __entry->ptep = ptep), | ||
196 | TP_printk("mm %p addr %lx ptep %p", | ||
197 | __entry->mm, __entry->addr, __entry->ptep) | ||
198 | ); | ||
199 | |||
200 | TRACE_EVENT(xen_mmu_set_pmd, | ||
201 | TP_PROTO(pmd_t *pmdp, pmd_t pmdval), | ||
202 | TP_ARGS(pmdp, pmdval), | ||
203 | TP_STRUCT__entry( | ||
204 | __field(pmd_t *, pmdp) | ||
205 | __field(pmdval_t, pmdval) | ||
206 | ), | ||
207 | TP_fast_assign(__entry->pmdp = pmdp; | ||
208 | __entry->pmdval = pmdval.pmd), | ||
209 | TP_printk("pmdp %p pmdval %0*llx (raw %0*llx)", | ||
210 | __entry->pmdp, | ||
211 | (int)sizeof(pmdval_t) * 2, (unsigned long long)pmd_val(native_make_pmd(__entry->pmdval)), | ||
212 | (int)sizeof(pmdval_t) * 2, (unsigned long long)__entry->pmdval) | ||
213 | ); | ||
214 | |||
215 | TRACE_EVENT(xen_mmu_pmd_clear, | ||
216 | TP_PROTO(pmd_t *pmdp), | ||
217 | TP_ARGS(pmdp), | ||
218 | TP_STRUCT__entry( | ||
219 | __field(pmd_t *, pmdp) | ||
220 | ), | ||
221 | TP_fast_assign(__entry->pmdp = pmdp), | ||
222 | TP_printk("pmdp %p", __entry->pmdp) | ||
223 | ); | ||
224 | |||
225 | #if PAGETABLE_LEVELS >= 4 | ||
226 | |||
227 | TRACE_EVENT(xen_mmu_set_pud, | ||
228 | TP_PROTO(pud_t *pudp, pud_t pudval), | ||
229 | TP_ARGS(pudp, pudval), | ||
230 | TP_STRUCT__entry( | ||
231 | __field(pud_t *, pudp) | ||
232 | __field(pudval_t, pudval) | ||
233 | ), | ||
234 | TP_fast_assign(__entry->pudp = pudp; | ||
235 | __entry->pudval = native_pud_val(pudval)), | ||
236 | TP_printk("pudp %p pudval %0*llx (raw %0*llx)", | ||
237 | __entry->pudp, | ||
238 | (int)sizeof(pudval_t) * 2, (unsigned long long)pud_val(native_make_pud(__entry->pudval)), | ||
239 | (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval) | ||
240 | ); | ||
241 | |||
242 | TRACE_EVENT(xen_mmu_set_pgd, | ||
243 | TP_PROTO(pgd_t *pgdp, pgd_t *user_pgdp, pgd_t pgdval), | ||
244 | TP_ARGS(pgdp, user_pgdp, pgdval), | ||
245 | TP_STRUCT__entry( | ||
246 | __field(pgd_t *, pgdp) | ||
247 | __field(pgd_t *, user_pgdp) | ||
248 | __field(pgdval_t, pgdval) | ||
249 | ), | ||
250 | TP_fast_assign(__entry->pgdp = pgdp; | ||
251 | __entry->user_pgdp = user_pgdp; | ||
252 | __entry->pgdval = pgdval.pgd), | ||
253 | TP_printk("pgdp %p user_pgdp %p pgdval %0*llx (raw %0*llx)", | ||
254 | __entry->pgdp, __entry->user_pgdp, | ||
255 | (int)sizeof(pgdval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pgdval)), | ||
256 | (int)sizeof(pgdval_t) * 2, (unsigned long long)__entry->pgdval) | ||
257 | ); | ||
258 | |||
259 | TRACE_EVENT(xen_mmu_pud_clear, | ||
260 | TP_PROTO(pud_t *pudp), | ||
261 | TP_ARGS(pudp), | ||
262 | TP_STRUCT__entry( | ||
263 | __field(pud_t *, pudp) | ||
264 | ), | ||
265 | TP_fast_assign(__entry->pudp = pudp), | ||
266 | TP_printk("pudp %p", __entry->pudp) | ||
267 | ); | ||
268 | #else | ||
269 | |||
270 | TRACE_EVENT(xen_mmu_set_pud, | ||
271 | TP_PROTO(pud_t *pudp, pud_t pudval), | ||
272 | TP_ARGS(pudp, pudval), | ||
273 | TP_STRUCT__entry( | ||
274 | __field(pud_t *, pudp) | ||
275 | __field(pudval_t, pudval) | ||
276 | ), | ||
277 | TP_fast_assign(__entry->pudp = pudp; | ||
278 | __entry->pudval = native_pud_val(pudval)), | ||
279 | TP_printk("pudp %p pudval %0*llx (raw %0*llx)", | ||
280 | __entry->pudp, | ||
281 | (int)sizeof(pudval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pudval)), | ||
282 | (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval) | ||
283 | ); | ||
284 | |||
285 | #endif | ||
286 | |||
287 | TRACE_EVENT(xen_mmu_pgd_clear, | ||
288 | TP_PROTO(pgd_t *pgdp), | ||
289 | TP_ARGS(pgdp), | ||
290 | TP_STRUCT__entry( | ||
291 | __field(pgd_t *, pgdp) | ||
292 | ), | ||
293 | TP_fast_assign(__entry->pgdp = pgdp), | ||
294 | TP_printk("pgdp %p", __entry->pgdp) | ||
295 | ); | ||
296 | |||
297 | DECLARE_EVENT_CLASS(xen_mmu_ptep_modify_prot, | ||
298 | TP_PROTO(struct mm_struct *mm, unsigned long addr, | ||
299 | pte_t *ptep, pte_t pteval), | ||
300 | TP_ARGS(mm, addr, ptep, pteval), | ||
301 | TP_STRUCT__entry( | ||
302 | __field(struct mm_struct *, mm) | ||
303 | __field(unsigned long, addr) | ||
304 | __field(pte_t *, ptep) | ||
305 | __field(pteval_t, pteval) | ||
306 | ), | ||
307 | TP_fast_assign(__entry->mm = mm; | ||
308 | __entry->addr = addr; | ||
309 | __entry->ptep = ptep; | ||
310 | __entry->pteval = pteval.pte), | ||
311 | TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)", | ||
312 | __entry->mm, __entry->addr, __entry->ptep, | ||
313 | (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)), | ||
314 | (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) | ||
315 | ); | ||
316 | #define DEFINE_XEN_MMU_PTEP_MODIFY_PROT(name) \ | ||
317 | DEFINE_EVENT(xen_mmu_ptep_modify_prot, name, \ | ||
318 | TP_PROTO(struct mm_struct *mm, unsigned long addr, \ | ||
319 | pte_t *ptep, pte_t pteval), \ | ||
320 | TP_ARGS(mm, addr, ptep, pteval)) | ||
321 | |||
322 | DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_start); | ||
323 | DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_commit); | ||
324 | |||
325 | TRACE_EVENT(xen_mmu_alloc_ptpage, | ||
326 | TP_PROTO(struct mm_struct *mm, unsigned long pfn, unsigned level, bool pinned), | ||
327 | TP_ARGS(mm, pfn, level, pinned), | ||
328 | TP_STRUCT__entry( | ||
329 | __field(struct mm_struct *, mm) | ||
330 | __field(unsigned long, pfn) | ||
331 | __field(unsigned, level) | ||
332 | __field(bool, pinned) | ||
333 | ), | ||
334 | TP_fast_assign(__entry->mm = mm; | ||
335 | __entry->pfn = pfn; | ||
336 | __entry->level = level; | ||
337 | __entry->pinned = pinned), | ||
338 | TP_printk("mm %p pfn %lx level %d %spinned", | ||
339 | __entry->mm, __entry->pfn, __entry->level, | ||
340 | __entry->pinned ? "" : "un") | ||
341 | ); | ||
342 | |||
343 | TRACE_EVENT(xen_mmu_release_ptpage, | ||
344 | TP_PROTO(unsigned long pfn, unsigned level, bool pinned), | ||
345 | TP_ARGS(pfn, level, pinned), | ||
346 | TP_STRUCT__entry( | ||
347 | __field(unsigned long, pfn) | ||
348 | __field(unsigned, level) | ||
349 | __field(bool, pinned) | ||
350 | ), | ||
351 | TP_fast_assign(__entry->pfn = pfn; | ||
352 | __entry->level = level; | ||
353 | __entry->pinned = pinned), | ||
354 | TP_printk("pfn %lx level %d %spinned", | ||
355 | __entry->pfn, __entry->level, | ||
356 | __entry->pinned ? "" : "un") | ||
357 | ); | ||
358 | |||
359 | DECLARE_EVENT_CLASS(xen_mmu_pgd, | ||
360 | TP_PROTO(struct mm_struct *mm, pgd_t *pgd), | ||
361 | TP_ARGS(mm, pgd), | ||
362 | TP_STRUCT__entry( | ||
363 | __field(struct mm_struct *, mm) | ||
364 | __field(pgd_t *, pgd) | ||
365 | ), | ||
366 | TP_fast_assign(__entry->mm = mm; | ||
367 | __entry->pgd = pgd), | ||
368 | TP_printk("mm %p pgd %p", __entry->mm, __entry->pgd) | ||
369 | ); | ||
370 | #define DEFINE_XEN_MMU_PGD_EVENT(name) \ | ||
371 | DEFINE_EVENT(xen_mmu_pgd, name, \ | ||
372 | TP_PROTO(struct mm_struct *mm, pgd_t *pgd), \ | ||
373 | TP_ARGS(mm, pgd)) | ||
374 | |||
375 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); | ||
376 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); | ||
377 | |||
378 | TRACE_EVENT(xen_mmu_flush_tlb, | ||
379 | TP_PROTO(int x), | ||
380 | TP_ARGS(x), | ||
381 | TP_STRUCT__entry(__array(char, x, 0)), | ||
382 | TP_fast_assign((void)x), | ||
383 | TP_printk("%s", "") | ||
384 | ); | ||
385 | |||
386 | TRACE_EVENT(xen_mmu_flush_tlb_single, | ||
387 | TP_PROTO(unsigned long addr), | ||
388 | TP_ARGS(addr), | ||
389 | TP_STRUCT__entry( | ||
390 | __field(unsigned long, addr) | ||
391 | ), | ||
392 | TP_fast_assign(__entry->addr = addr), | ||
393 | TP_printk("addr %lx", __entry->addr) | ||
394 | ); | ||
395 | |||
396 | TRACE_EVENT(xen_mmu_flush_tlb_others, | ||
397 | TP_PROTO(const struct cpumask *cpus, struct mm_struct *mm, | ||
398 | unsigned long addr), | ||
399 | TP_ARGS(cpus, mm, addr), | ||
400 | TP_STRUCT__entry( | ||
401 | __field(unsigned, ncpus) | ||
402 | __field(struct mm_struct *, mm) | ||
403 | __field(unsigned long, addr) | ||
404 | ), | ||
405 | TP_fast_assign(__entry->ncpus = cpumask_weight(cpus); | ||
406 | __entry->mm = mm; | ||
407 | __entry->addr = addr), | ||
408 | TP_printk("ncpus %d mm %p addr %lx", | ||
409 | __entry->ncpus, __entry->mm, __entry->addr) | ||
410 | ); | ||
411 | |||
412 | TRACE_EVENT(xen_mmu_write_cr3, | ||
413 | TP_PROTO(bool kernel, unsigned long cr3), | ||
414 | TP_ARGS(kernel, cr3), | ||
415 | TP_STRUCT__entry( | ||
416 | __field(bool, kernel) | ||
417 | __field(unsigned long, cr3) | ||
418 | ), | ||
419 | TP_fast_assign(__entry->kernel = kernel; | ||
420 | __entry->cr3 = cr3), | ||
421 | TP_printk("%s cr3 %lx", | ||
422 | __entry->kernel ? "kernel" : "user", __entry->cr3) | ||
423 | ); | ||
424 | |||
425 | |||
426 | /* CPU */ | ||
427 | TRACE_EVENT(xen_cpu_write_ldt_entry, | ||
428 | TP_PROTO(struct desc_struct *dt, int entrynum, u64 desc), | ||
429 | TP_ARGS(dt, entrynum, desc), | ||
430 | TP_STRUCT__entry( | ||
431 | __field(struct desc_struct *, dt) | ||
432 | __field(int, entrynum) | ||
433 | __field(u64, desc) | ||
434 | ), | ||
435 | TP_fast_assign(__entry->dt = dt; | ||
436 | __entry->entrynum = entrynum; | ||
437 | __entry->desc = desc; | ||
438 | ), | ||
439 | TP_printk("dt %p entrynum %d entry %016llx", | ||
440 | __entry->dt, __entry->entrynum, | ||
441 | (unsigned long long)__entry->desc) | ||
442 | ); | ||
443 | |||
444 | TRACE_EVENT(xen_cpu_write_idt_entry, | ||
445 | TP_PROTO(gate_desc *dt, int entrynum, const gate_desc *ent), | ||
446 | TP_ARGS(dt, entrynum, ent), | ||
447 | TP_STRUCT__entry( | ||
448 | __field(gate_desc *, dt) | ||
449 | __field(int, entrynum) | ||
450 | ), | ||
451 | TP_fast_assign(__entry->dt = dt; | ||
452 | __entry->entrynum = entrynum; | ||
453 | ), | ||
454 | TP_printk("dt %p entrynum %d", | ||
455 | __entry->dt, __entry->entrynum) | ||
456 | ); | ||
457 | |||
458 | TRACE_EVENT(xen_cpu_load_idt, | ||
459 | TP_PROTO(const struct desc_ptr *desc), | ||
460 | TP_ARGS(desc), | ||
461 | TP_STRUCT__entry( | ||
462 | __field(unsigned long, addr) | ||
463 | ), | ||
464 | TP_fast_assign(__entry->addr = desc->address), | ||
465 | TP_printk("addr %lx", __entry->addr) | ||
466 | ); | ||
467 | |||
468 | TRACE_EVENT(xen_cpu_write_gdt_entry, | ||
469 | TP_PROTO(struct desc_struct *dt, int entrynum, const void *desc, int type), | ||
470 | TP_ARGS(dt, entrynum, desc, type), | ||
471 | TP_STRUCT__entry( | ||
472 | __field(u64, desc) | ||
473 | __field(struct desc_struct *, dt) | ||
474 | __field(int, entrynum) | ||
475 | __field(int, type) | ||
476 | ), | ||
477 | TP_fast_assign(__entry->dt = dt; | ||
478 | __entry->entrynum = entrynum; | ||
479 | __entry->desc = *(u64 *)desc; | ||
480 | __entry->type = type; | ||
481 | ), | ||
482 | TP_printk("dt %p entrynum %d type %d desc %016llx", | ||
483 | __entry->dt, __entry->entrynum, __entry->type, | ||
484 | (unsigned long long)__entry->desc) | ||
485 | ); | ||
486 | |||
487 | TRACE_EVENT(xen_cpu_set_ldt, | ||
488 | TP_PROTO(const void *addr, unsigned entries), | ||
489 | TP_ARGS(addr, entries), | ||
490 | TP_STRUCT__entry( | ||
491 | __field(const void *, addr) | ||
492 | __field(unsigned, entries) | ||
493 | ), | ||
494 | TP_fast_assign(__entry->addr = addr; | ||
495 | __entry->entries = entries), | ||
496 | TP_printk("addr %p entries %u", | ||
497 | __entry->addr, __entry->entries) | ||
498 | ); | ||
499 | |||
500 | |||
501 | #endif /* _TRACE_XEN_H */ | ||
502 | |||
503 | /* This part must be outside protection */ | ||
504 | #include <trace/define_trace.h> | ||