cobalt-core.h 16.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * Copyright (C) 2014 Jan Kiszka <jan.kiszka@siemens.com>.
 * Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>.
 *
 * Xenomai is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * Xenomai is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Xenomai; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */
20
#undef TRACE_SYSTEM
21
#define TRACE_SYSTEM cobalt_core
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

#if !defined(_TRACE_COBALT_CORE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_COBALT_CORE_H

#include <linux/tracepoint.h>

DECLARE_EVENT_CLASS(thread_event,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread),

	TP_STRUCT__entry(
		__field(pid_t, pid)
		__field(unsigned long, state)
		__field(unsigned long, info)
	),

	TP_fast_assign(
		__entry->state = thread->state;
		__entry->info = thread->info;
		__entry->pid = xnthread_host_pid(thread);
	),

44
45
	TP_printk("pid=%d state=0x%lx info=0x%lx",
		  __entry->pid, __entry->state, __entry->info)
46
47
);

48
49
50
DECLARE_EVENT_CLASS(curr_thread_event,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread),
51
52
53

	TP_STRUCT__entry(
		__field(struct xnthread *, thread)
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
		__field(unsigned long, state)
		__field(unsigned long, info)
	),

	TP_fast_assign(
		__entry->state = thread->state;
		__entry->info = thread->info;
	),

	TP_printk("state=0x%lx info=0x%lx",
		  __entry->state, __entry->info)
);

DECLARE_EVENT_CLASS(synch_wait_event,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch),

	TP_STRUCT__entry(
72
73
74
75
76
77
78
		__field(struct xnsynch *, synch)
	),

	TP_fast_assign(
		__entry->synch = synch;
	),

79
	TP_printk("synch=%p", __entry->synch)
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
);

DECLARE_EVENT_CLASS(synch_post_event,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch),

	TP_STRUCT__entry(
		__field(struct xnsynch *, synch)
	),

	TP_fast_assign(
		__entry->synch = synch;
	),

	TP_printk("synch=%p", __entry->synch)
);

DECLARE_EVENT_CLASS(irq_event,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq),

	TP_STRUCT__entry(
		__field(unsigned int, irq)
	),

	TP_fast_assign(
		__entry->irq = irq;
	),

	TP_printk("irq=%u", __entry->irq)
);

DECLARE_EVENT_CLASS(clock_event,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq),

	TP_STRUCT__entry(
		__field(unsigned int, irq)
	),

	TP_fast_assign(
		__entry->irq = irq;
	),

	TP_printk("clock_irq=%u", __entry->irq)
);

DECLARE_EVENT_CLASS(timer_event,
	TP_PROTO(struct xntimer *timer),
	TP_ARGS(timer),

	TP_STRUCT__entry(
		__field(struct xntimer *, timer)
	),

	TP_fast_assign(
		__entry->timer = timer;
	),

	TP_printk("timer=%p", __entry->timer)
);

TRACE_EVENT(cobalt_schedule,
	TP_PROTO(struct xnsched *sched),
	TP_ARGS(sched),

	TP_STRUCT__entry(
		__field(unsigned long, status)
	),

	TP_fast_assign(
		__entry->status = sched->status;
	),

	TP_printk("status=0x%lx", __entry->status)
);

TRACE_EVENT(cobalt_schedule_remote,
	TP_PROTO(struct xnsched *sched),
	TP_ARGS(sched),

	TP_STRUCT__entry(
		__field(unsigned long, status)
	),

	TP_fast_assign(
		__entry->status = sched->status;
	),

	TP_printk("status=0x%lx", __entry->status)
);

TRACE_EVENT(cobalt_switch_context,
	TP_PROTO(struct xnthread *prev, struct xnthread *next),
	TP_ARGS(prev, next),

	TP_STRUCT__entry(
		__field(struct xnthread *, prev)
178
		__string(prev_name, prev->name)
179
180
181
182
		__field(pid_t, prev_pid)
		__field(int, prev_prio)
		__field(unsigned long, prev_state)
		__field(struct xnthread *, next)
183
		__string(next_name, next->name)
184
185
		__field(pid_t, next_pid)
		__field(int, next_prio)
186
187
188
189
	),

	TP_fast_assign(
		__entry->prev = prev;
190
		__assign_str(prev_name, prev->name);
191
192
193
194
		__entry->prev_pid = xnthread_host_pid(prev);
		__entry->prev_prio = xnthread_current_priority(prev);
		__entry->prev_state = prev->state;
		__entry->next = next;
195
		__assign_str(next_name, next->name);
196
197
		__entry->next_pid = xnthread_host_pid(next);
		__entry->next_prio = xnthread_current_priority(next);
198
199
	),

200
201
	TP_printk("prev_name=%s prev_pid=%d prev_prio=%d prev_state=0x%lx ==> next_name=%s next_pid=%d next_prio=%d",
		  __get_str(prev_name), __entry->prev_pid,
202
		  __entry->prev_prio, __entry->prev_state,
203
		  __get_str(next_name), __entry->next_pid, __entry->next_prio)
204
205
);

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
#ifdef CONFIG_XENO_OPT_SCHED_QUOTA

TRACE_EVENT(cobalt_schedquota_refill,
	TP_PROTO(int dummy),
	TP_ARGS(dummy),

	TP_STRUCT__entry(
		__field(int, dummy)
	),

	TP_fast_assign(
		(void)dummy;
	),

	TP_printk("%s", "")
);

DECLARE_EVENT_CLASS(schedquota_group_event,
	TP_PROTO(struct xnsched_quota_group *tg),
	TP_ARGS(tg),

	TP_STRUCT__entry(
		__field(int, tgid)
	),

	TP_fast_assign(
		__entry->tgid = tg->tgid;
	),

	TP_printk("tgid=%d",
		  __entry->tgid)
);

DEFINE_EVENT(schedquota_group_event, cobalt_schedquota_create_group,
	TP_PROTO(struct xnsched_quota_group *tg),
	TP_ARGS(tg)
);

DEFINE_EVENT(schedquota_group_event, cobalt_schedquota_destroy_group,
	TP_PROTO(struct xnsched_quota_group *tg),
	TP_ARGS(tg)
);

TRACE_EVENT(cobalt_schedquota_set_limit,
	TP_PROTO(struct xnsched_quota_group *tg,
		 int percent,
		 int peak_percent),
	TP_ARGS(tg, percent, peak_percent),

	TP_STRUCT__entry(
		__field(int, tgid)
		__field(int, percent)
		__field(int, peak_percent)
	),

	TP_fast_assign(
		__entry->tgid = tg->tgid;
		__entry->percent = percent;
		__entry->peak_percent = peak_percent;
	),

	TP_printk("tgid=%d percent=%d peak_percent=%d",
		  __entry->tgid, __entry->percent, __entry->peak_percent)
);

DECLARE_EVENT_CLASS(schedquota_thread_event,
	TP_PROTO(struct xnsched_quota_group *tg,
		 struct xnthread *thread),
	TP_ARGS(tg, thread),

	TP_STRUCT__entry(
		__field(int, tgid)
		__field(struct xnthread *, thread)
		__field(pid_t, pid)
	),

	TP_fast_assign(
		__entry->tgid = tg->tgid;
		__entry->thread = thread;
		__entry->pid = xnthread_host_pid(thread);
	),

	TP_printk("tgid=%d thread=%p pid=%d",
		  __entry->tgid, __entry->thread, __entry->pid)
);

DEFINE_EVENT(schedquota_thread_event, cobalt_schedquota_add_thread,
	TP_PROTO(struct xnsched_quota_group *tg,
		 struct xnthread *thread),
	TP_ARGS(tg, thread)
);

DEFINE_EVENT(schedquota_thread_event, cobalt_schedquota_remove_thread,
	TP_PROTO(struct xnsched_quota_group *tg,
		 struct xnthread *thread),
	TP_ARGS(tg, thread)
);

#endif /* CONFIG_XENO_OPT_SCHED_QUOTA */

306
307
308
309
310
311
312
313
TRACE_EVENT(cobalt_thread_init,
	TP_PROTO(struct xnthread *thread,
		 const struct xnthread_init_attr *attr,
		 struct xnsched_class *sched_class),
	TP_ARGS(thread, attr, sched_class),

	TP_STRUCT__entry(
		__field(struct xnthread *, thread)
314
		__string(thread_name, thread->name)
315
316
317
318
319
320
321
		__string(class_name, sched_class->name)
		__field(unsigned long, flags)
		__field(int, cprio)
	),

	TP_fast_assign(
		__entry->thread = thread;
322
		__assign_str(thread_name, thread->name);
323
324
325
326
327
		__entry->flags = attr->flags;
		__assign_str(class_name, sched_class->name);
		__entry->cprio = thread->cprio;
	),

328
	TP_printk("thread=%p name=%s flags=0x%lx class=%s prio=%d",
329
330
331
332
333
334
335
336
337
338
		   __entry->thread, __get_str(thread_name), __entry->flags,
		   __get_str(class_name), __entry->cprio)
);

TRACE_EVENT(cobalt_thread_suspend,
	TP_PROTO(struct xnthread *thread, unsigned long mask, xnticks_t timeout,
		 xntmode_t timeout_mode, struct xnsynch *wchan),
	TP_ARGS(thread, mask, timeout, timeout_mode, wchan),

	TP_STRUCT__entry(
339
		__field(pid_t, pid)
340
341
342
343
344
345
346
		__field(unsigned long, mask)
		__field(xnticks_t, timeout)
		__field(xntmode_t, timeout_mode)
		__field(struct xnsynch *, wchan)
	),

	TP_fast_assign(
347
		__entry->pid = xnthread_host_pid(thread);
348
349
350
351
352
353
		__entry->mask = mask;
		__entry->timeout = timeout;
		__entry->timeout_mode = timeout_mode;
		__entry->wchan = wchan;
	),

354
355
	TP_printk("pid=%d mask=0x%lx timeout=%Lu timeout_mode=%d wchan=%p",
		  __entry->pid, __entry->mask,
356
357
358
359
360
361
362
363
		  __entry->timeout, __entry->timeout_mode, __entry->wchan)
);

TRACE_EVENT(cobalt_thread_resume,
	TP_PROTO(struct xnthread *thread, unsigned long mask),
	TP_ARGS(thread, mask),

	TP_STRUCT__entry(
364
365
		__string(name, thread->name)
		__field(pid_t, pid)
366
367
368
369
		__field(unsigned long, mask)
	),

	TP_fast_assign(
370
371
		__assign_str(name, thread->name);
		__entry->pid = xnthread_host_pid(thread);
372
373
374
		__entry->mask = mask;
	),

375
376
	TP_printk("name=%s pid=%d mask=0x%lx",
		  __get_str(name), __entry->pid, __entry->mask)
377
378
379
);

TRACE_EVENT(cobalt_thread_fault,
380
381
	TP_PROTO(struct ipipe_trap_data *td),
	TP_ARGS(td),
382
383
384
385
386
387
388
389
390
391
392

	TP_STRUCT__entry(
		__field(void *,	ip)
		__field(unsigned int, type)
	),

	TP_fast_assign(
		__entry->ip = (void *)xnarch_fault_pc(td);
		__entry->type = xnarch_fault_trap(td);
	),

393
394
	TP_printk("ip=%p type=%x",
		  __entry->ip, __entry->type)
395
396
);

397
398
399
400
401
402
TRACE_EVENT(cobalt_thread_set_current_prio,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread),

	TP_STRUCT__entry(
		__field(struct xnthread *, thread)
403
		__field(pid_t, pid)
404
405
406
407
		__field(int, cprio)
	),

	TP_fast_assign(
408
409
		__entry->thread = thread;
		__entry->pid = xnthread_host_pid(thread);
410
411
412
		__entry->cprio = xnthread_current_priority(thread);
	),

413
414
	TP_printk("thread=%p pid=%d prio=%d",
		  __entry->thread, __entry->pid, __entry->cprio)
415
416
);

417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
DEFINE_EVENT(thread_event, cobalt_thread_start,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

DEFINE_EVENT(thread_event, cobalt_thread_cancel,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

DEFINE_EVENT(thread_event, cobalt_thread_join,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

DEFINE_EVENT(thread_event, cobalt_thread_unblock,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

437
DEFINE_EVENT(curr_thread_event, cobalt_thread_wait_period,
438
439
440
441
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

442
DEFINE_EVENT(curr_thread_event, cobalt_thread_missed_period,
443
444
445
446
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

447
DEFINE_EVENT(curr_thread_event, cobalt_thread_set_mode,
448
449
450
451
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

452
453
454
455
456
457
458
459
460
461
462
463
464
TRACE_EVENT(cobalt_thread_migrate,
	TP_PROTO(unsigned int cpu),
	TP_ARGS(cpu),

	TP_STRUCT__entry(
		__field(unsigned int, cpu)
	),

	TP_fast_assign(
		__entry->cpu = cpu;
	),

	TP_printk("cpu=%u", __entry->cpu)
465
466
);

467
TRACE_EVENT(cobalt_thread_migrate_passive,
468
	TP_PROTO(struct xnthread *thread, unsigned int cpu),
469
470
471
472
	TP_ARGS(thread, cpu),

	TP_STRUCT__entry(
		__field(struct xnthread *, thread)
473
		__field(pid_t, pid)
474
475
476
477
478
		__field(unsigned int, cpu)
	),

	TP_fast_assign(
		__entry->thread = thread;
479
		__entry->pid = xnthread_host_pid(thread);
480
481
482
		__entry->cpu = cpu;
	),

483
484
	TP_printk("thread=%p pid=%d cpu=%u",
		  __entry->thread, __entry->pid, __entry->cpu)
485
486
);

487
DEFINE_EVENT(curr_thread_event, cobalt_shadow_gohard,
488
489
490
491
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

492
DEFINE_EVENT(curr_thread_event, cobalt_watchdog_signal,
493
494
495
496
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

497
DEFINE_EVENT(curr_thread_event, cobalt_shadow_hardened,
498
499
500
501
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

502
503
504
505
506
507
508
509
#define cobalt_print_relax_reason(reason)				\
	__print_symbolic(reason,					\
			 { SIGDEBUG_UNDEFINED,		"undefined" },	\
			 { SIGDEBUG_MIGRATE_SIGNAL,	"signal" },	\
			 { SIGDEBUG_MIGRATE_SYSCALL,	"syscall" },	\
			 { SIGDEBUG_MIGRATE_FAULT,	"fault" })

TRACE_EVENT(cobalt_shadow_gorelax,
510
511
	TP_PROTO(int reason),
	TP_ARGS(reason),
512
513
514
515
516
517
518
519
520

	TP_STRUCT__entry(
		__field(int, reason)
	),

	TP_fast_assign(
		__entry->reason = reason;
	),

521
	TP_printk("reason=%s", cobalt_print_relax_reason(__entry->reason))
522
523
);

524
DEFINE_EVENT(curr_thread_event, cobalt_shadow_relaxed,
525
526
527
528
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

529
DEFINE_EVENT(curr_thread_event, cobalt_shadow_entry,
530
531
532
533
534
535
536
537
538
539
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

TRACE_EVENT(cobalt_shadow_map,
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread),

	TP_STRUCT__entry(
		__field(struct xnthread *, thread)
540
		__field(pid_t, pid)
541
542
543
544
		__field(int, prio)
	),

	TP_fast_assign(
545
546
		__entry->thread = thread;
		__entry->pid = xnthread_host_pid(thread);
547
548
549
		__entry->prio = xnthread_base_priority(thread);
	),

550
551
	TP_printk("thread=%p pid=%d prio=%d",
		  __entry->thread, __entry->pid, __entry->prio)
552
553
);

554
DEFINE_EVENT(curr_thread_event, cobalt_shadow_unmap,
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
	TP_PROTO(struct xnthread *thread),
	TP_ARGS(thread)
);

TRACE_EVENT(cobalt_lostage_request,
        TP_PROTO(const char *type, struct task_struct *task),
	TP_ARGS(type, task),

	TP_STRUCT__entry(
		__field(pid_t, pid)
		__array(char, comm, TASK_COMM_LEN)
		__field(const char *, type)
	),

	TP_fast_assign(
		__entry->type = type;
571
		__entry->pid = task_pid_nr(task);
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
		memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
	),

	TP_printk("request=%s pid=%d comm=%s",
		  __entry->type, __entry->pid, __entry->comm)
);

TRACE_EVENT(cobalt_lostage_wakeup,
	TP_PROTO(struct task_struct *task),
	TP_ARGS(task),

	TP_STRUCT__entry(
		__field(pid_t, pid)
		__array(char, comm, TASK_COMM_LEN)
	),

	TP_fast_assign(
589
		__entry->pid = task_pid_nr(task);
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
		memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
	),

	TP_printk("pid=%d comm=%s",
		  __entry->pid, __entry->comm)
);

TRACE_EVENT(cobalt_lostage_signal,
	TP_PROTO(struct task_struct *task, int sig),
	TP_ARGS(task, sig),

	TP_STRUCT__entry(
		__field(pid_t, pid)
		__array(char, comm, TASK_COMM_LEN)
		__field(int, sig)
	),

	TP_fast_assign(
608
		__entry->pid = task_pid_nr(task);
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
		__entry->sig = sig;
		memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
	),

	TP_printk("pid=%d comm=%s sig=%d",
		  __entry->pid, __entry->comm, __entry->sig)
);

DEFINE_EVENT(irq_event, cobalt_irq_entry,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

DEFINE_EVENT(irq_event, cobalt_irq_exit,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

627
628
629
630
631
632
633
634
635
636
DEFINE_EVENT(irq_event, cobalt_irq_attach,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

DEFINE_EVENT(irq_event, cobalt_irq_detach,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
DEFINE_EVENT(irq_event, cobalt_irq_enable,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

DEFINE_EVENT(irq_event, cobalt_irq_disable,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

DEFINE_EVENT(clock_event, cobalt_clock_entry,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

DEFINE_EVENT(clock_event, cobalt_clock_exit,
	TP_PROTO(unsigned int irq),
	TP_ARGS(irq)
);

DEFINE_EVENT(timer_event, cobalt_timer_stop,
	TP_PROTO(struct xntimer *timer),
	TP_ARGS(timer)
);

DEFINE_EVENT(timer_event, cobalt_timer_expire,
	TP_PROTO(struct xntimer *timer),
	TP_ARGS(timer)
);

#define cobalt_print_timer_mode(mode)			\
	__print_symbolic(mode,				\
			 { XN_RELATIVE, "rel" },	\
			 { XN_ABSOLUTE, "abs" },	\
			 { XN_REALTIME, "rt" })

TRACE_EVENT(cobalt_timer_start,
	TP_PROTO(struct xntimer *timer, xnticks_t value, xnticks_t interval,
		 xntmode_t mode),
	TP_ARGS(timer, value, interval, mode),

	TP_STRUCT__entry(
		__field(struct xntimer *, timer)
#ifdef CONFIG_XENO_OPT_STATS
681
		__string(name, timer->name)
682
683
684
685
686
687
688
689
690
#endif
		__field(xnticks_t, value)
		__field(xnticks_t, interval)
		__field(xntmode_t, mode)
	),

	TP_fast_assign(
		__entry->timer = timer;
#ifdef CONFIG_XENO_OPT_STATS
691
		__assign_str(name, timer->name);
692
693
694
695
696
697
698
699
700
#endif
		__entry->value = value;
		__entry->interval = interval;
		__entry->mode = mode;
	),

	TP_printk("timer=%p(%s) value=%Lu interval=%Lu mode=%s",
		  __entry->timer,
#ifdef CONFIG_XENO_OPT_STATS
701
		  __get_str(name),
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
#else
		  "(anon)",
#endif
		  __entry->value, __entry->interval,
		  cobalt_print_timer_mode(__entry->mode))
);

#ifdef CONFIG_SMP

TRACE_EVENT(cobalt_timer_migrate,
	TP_PROTO(struct xntimer *timer, unsigned int cpu),
	TP_ARGS(timer, cpu),

	TP_STRUCT__entry(
		__field(struct xntimer *, timer)
		__field(unsigned int, cpu)
	),

	TP_fast_assign(
		__entry->timer = timer;
		__entry->cpu = cpu;
	),

	TP_printk("timer=%p cpu=%u",
		  __entry->timer, __entry->cpu)
);

#endif /* CONFIG_SMP */

DEFINE_EVENT(synch_wait_event, cobalt_synch_sleepon,
732
733
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
734
735
);

736
DEFINE_EVENT(synch_wait_event, cobalt_synch_try_acquire,
737
738
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
739
740
);

741
DEFINE_EVENT(synch_wait_event, cobalt_synch_acquire,
742
743
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
);

DEFINE_EVENT(synch_post_event, cobalt_synch_release,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
);

DEFINE_EVENT(synch_post_event, cobalt_synch_wakeup,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
);

DEFINE_EVENT(synch_post_event, cobalt_synch_wakeup_many,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
);

DEFINE_EVENT(synch_post_event, cobalt_synch_flush,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
);

DEFINE_EVENT(synch_post_event, cobalt_synch_forget,
	TP_PROTO(struct xnsynch *synch),
	TP_ARGS(synch)
);

#endif /* _TRACE_COBALT_CORE_H */

/* This part must be outside protection */
774
775
776
#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE cobalt-core
777
#include <trace/define_trace.h>