Xenomai  3.0.8
trace.h
1 /*
2  * Copyright (C) 2006 Jan Kiszka <jan.kiszka@web.de>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 #ifndef _COBALT_KERNEL_TRACE_H
20 #define _COBALT_KERNEL_TRACE_H
21 
22 #include <linux/types.h>
23 #include <linux/ipipe_trace.h>
24 #include <cobalt/uapi/kernel/trace.h>
25 
26 static inline int xntrace_max_begin(unsigned long v)
27 {
28  ipipe_trace_begin(v);
29  return 0;
30 }
31 
32 static inline int xntrace_max_end(unsigned long v)
33 {
34  ipipe_trace_end(v);
35  return 0;
36 }
37 
38 static inline int xntrace_max_reset(void)
39 {
40  ipipe_trace_max_reset();
41  return 0;
42 }
43 
44 static inline int xntrace_user_start(void)
45 {
46  return ipipe_trace_frozen_reset();
47 }
48 
49 static inline int xntrace_user_stop(unsigned long v)
50 {
51  ipipe_trace_freeze(v);
52  return 0;
53 }
54 
55 static inline int xntrace_user_freeze(unsigned long v, int once)
56 {
57  int ret = 0;
58 
59  if (!once)
60  ret = ipipe_trace_frozen_reset();
61 
62  ipipe_trace_freeze(v);
63 
64  return ret;
65 }
66 
67 static inline int xntrace_special(unsigned char id, unsigned long v)
68 {
69  ipipe_trace_special(id, v);
70  return 0;
71 }
72 
73 static inline int xntrace_special_u64(unsigned char id,
74  unsigned long long v)
75 {
76  ipipe_trace_special(id, (unsigned long)(v >> 32));
77  ipipe_trace_special(id, (unsigned long)(v & 0xFFFFFFFF));
78  return 0;
79 }
80 
81 static inline int xntrace_pid(pid_t pid, short prio)
82 {
83  ipipe_trace_pid(pid, prio);
84  return 0;
85 }
86 
87 static inline int xntrace_tick(unsigned long delay_ticks)
88 {
89  ipipe_trace_event(0, delay_ticks);
90  return 0;
91 }
92 
93 static inline int xntrace_panic_freeze(void)
94 {
95  ipipe_trace_panic_freeze();
96  return 0;
97 }
98 
99 static inline int xntrace_panic_dump(void)
100 {
101  ipipe_trace_panic_dump();
102  return 0;
103 }
104 
105 #endif /* !_COBALT_KERNEL_TRACE_H */