include/nucleus/ltt.h

00001 /*
00002  * Copyright (C) 2004 Gilles Chanteperdrix <gilles.chanteperdrix@laposte.net>
00003  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
00004  *
00005  * Xenomai is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published
00007  * by the Free Software Foundation; either version 2 of the License,
00008  * or (at your option) any later version.
00009  *
00010  * Xenomai is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with Xenomai; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018  * 02111-1307, USA.
00019  */
00020 
00021 #ifndef _XENO_NUCLEUS_LTT_H
00022 #define _XENO_NUCLEUS_LTT_H
00023 
00024 #include <nucleus/types.h>
00025 
00026 #ifdef CONFIG_LTT
00027 
00028 #include <linux/ltt-core.h>
00029 
00030 struct xnltt_evmap {
00031 
00032     char *ltt_label;    /* !< Event label (creation time). */
00033     char *ltt_format;   /* !< Event format (creation time). */
00034     int ltt_evid;       /* !< LTT custom event id. */
00035     int ltt_filter;     /* !< Event filter. */
00036 };
00037 
00038 #define xeno_ev_ienter       0
00039 #define xeno_ev_iexit        1
00040 #define xeno_ev_resched      2
00041 #define xeno_ev_smpsched     3
00042 #define xeno_ev_fastsched    4
00043 #define xeno_ev_switch       5
00044 #define xeno_ev_fault        6
00045 #define xeno_ev_callout      7
00046 #define xeno_ev_finalize     8
00047 #define xeno_ev_thrinit      9
00048 #define xeno_ev_thrstart     10
00049 #define xeno_ev_threstart    11
00050 #define xeno_ev_thrdelete    12
00051 #define xeno_ev_thrsuspend   13
00052 #define xeno_ev_thresume     14
00053 #define xeno_ev_thrunblock   15
00054 #define xeno_ev_threnice     16
00055 #define xeno_ev_cpumigrate   17
00056 #define xeno_ev_sigdispatch  18
00057 #define xeno_ev_thrboot      19
00058 #define xeno_ev_tmtick       20
00059 #define xeno_ev_sleepon      21
00060 #define xeno_ev_wakeup1      22
00061 #define xeno_ev_wakeupx      23
00062 #define xeno_ev_syncflush    24
00063 #define xeno_ev_syncforget   25
00064 #define xeno_ev_lohandler    26
00065 #define xeno_ev_primarysw    27
00066 #define xeno_ev_primary      28
00067 #define xeno_ev_secondarysw  29
00068 #define xeno_ev_secondary    30
00069 #define xeno_ev_shadowmap    31
00070 #define xeno_ev_shadowunmap  32
00071 #define xeno_ev_shadowstart  33
00072 #define xeno_ev_syscall      34
00073 #define xeno_ev_shadowexit   35
00074 #define xeno_ev_thrsetmode   36
00075 #define xeno_ev_rdrotate     37
00076 #define xeno_ev_rractivate   38
00077 #define xeno_ev_rrdeactivate 39
00078 #define xeno_ev_timeset      40
00079 #define xeno_ev_addhook      41
00080 #define xeno_ev_remhook      42
00081 #define xeno_ev_thrperiodic  43
00082 #define xeno_ev_thrwait      44
00083 #define xeno_ev_tmstart      45
00084 #define xeno_ev_tmstop       46
00085 #define xeno_ev_mark         47
00086 #define xeno_ev_watchdog     48
00087 
00088 #define xeno_evthr  0x1
00089 #define xeno_evirq  0x2
00090 #define xeno_evsys  0x4
00091 #define xeno_evall  0x7
00092 
00093 #define XNLTT_MAX_EVENTS 64
00094 
00095 extern struct xnltt_evmap xnltt_evtable[];
00096 
00097 extern int xnltt_filter;
00098 
00099 #define xnltt_log_event(ev, args...) \
00100 do { \
00101   if (xnltt_evtable[ev].ltt_filter & xnltt_filter) \
00102     ltt_log_std_formatted_event(xnltt_evtable[ev].ltt_evid, ##args); \
00103 } while(0)
00104 
00105 static inline void xnltt_set_filter (int mask)
00106 {
00107     xnltt_filter = mask;
00108 }
00109 
00110 static inline void xnltt_stop_tracing (void)
00111 {
00112     xnltt_set_filter(0);
00113 }
00114 
00115 void xnltt_log_mark(const char *fmt,
00116                     ...);
00117 
00118 int xnltt_mount(void);
00119 
00120 void xnltt_umount(void);
00121 
00122 #else /* !CONFIG_LTT */
00123 
00124 #define xnltt_log_event(ev, args...); /* Eat the semi-colon. */
00125 
00126 static inline void xnltt_log_mark (const char *fmt, ...)
00127 {
00128 }
00129 
00130 static inline void xnltt_set_filter (int mask)
00131 {
00132 }
00133 
00134 static inline void xnltt_stop_tracing (void)
00135 {
00136 }
00137 
00138 #endif /* CONFIG_LTT */
00139 
00140 #endif /* !_XENO_NUCLEUS_LTT_H_ */

Generated on Mon Dec 25 13:57:10 2006 for Xenomai API by  doxygen 1.4.6