update credits
[librepilot.git] / flight / pios / inc / pios_trace.h
blob959c6e17a18331d1cdd68daa7a9444c631e9b652
1 /**
2 ******************************************************************************
4 * @file pios_trace.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
6 * @addtogroup PiOS
7 * @{
8 * @addtogroup PiOS
9 * @{
10 * @brief PiOS debug trace printing interface
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef PIOS_TRACE_H
28 #define PIOS_TRACE_H
30 extern unsigned int pios_trace_mask;
33 * Tracing flags.
34 * The flags masked in PIOS_TRACE_ALWAYS are always traced.
37 #define PIOS_TRACE_OS 0x00000002
38 #define PIOS_TRACE_ALLOCATE 0x00000004
39 #define PIOS_TRACE_TEST 0x00000008
40 #define PIOS_TRACE_BAD_BLOCKS 0x00000010
41 #define PIOS_TRACE_ERASE 0x00000020
42 #define PIOS_TRACE_GC 0x00000040
43 #define PIOS_TRACE_WRITE 0x00000080
44 #define PIOS_TRACE_TRACING 0x00000100
45 #define PIOS_TRACE_DELETION 0x00000200
46 #define PIOS_TRACE_BUFFERS 0x00000400
47 #define PIOS_TRACE_NANDACCESS 0x00000800
48 #define PIOS_TRACE_GC_DETAIL 0x00001000
49 #define PIOS_TRACE_SCAN_DEBUG 0x00002000
50 #define PIOS_TRACE_MTD 0x00004000
51 #define PIOS_TRACE_CHECKPOINT 0x00008000
53 #define PIOS_TRACE_VERIFY 0x00010000
54 #define PIOS_TRACE_VERIFY_NAND 0x00020000
55 #define PIOS_TRACE_VERIFY_FULL 0x00040000
56 #define PIOS_TRACE_VERIFY_ALL 0x000f0000
58 #define PIOS_TRACE_SYNC 0x00100000
59 #define PIOS_TRACE_BACKGROUND 0x00200000
60 #define PIOS_TRACE_LOCK 0x00400000
61 #define PIOS_TRACE_MOUNT 0x00800000
63 #define PIOS_TRACE_ERROR 0x40000000
64 #define PIOS_TRACE_BUG 0x80000000
65 #define PIOS_TRACE_ALWAYS 0xf0000000
68 #ifdef PIOS_TRACE
69 #define pios_trace(msk, fmt, ...) \
70 do { \
71 if (pios_trace_mask & (msk)) { \
72 printf("pios_trace: " fmt "\n",##__VA_ARGS__); } \
73 } \
74 while (0)
75 #else
76 #define pios_trace(msk, fmt, ...)
77 #endif
79 /* Trace control functions */
80 unsigned pios_set_trace(unsigned tm);
81 unsigned pios_get_trace(void);
84 #endif // ifndef PIOS_TRACE_H