1 /**
2  * \file
3  * L4 kernel event tracing
4  * \ingroup api_calls
5  */
6 /*
7  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8  *               Björn Döbel <doebel@os.inf.tu-dresden.de>,
9  *               Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
10  *     economic rights: Technische Universität Dresden (Germany)
11  *
12  * This file is part of TUD:OS and distributed under the terms of the
13  * GNU General Public License 2.
14  * Please see the COPYING-GPL-2 file for details.
15  *
16  * As a special exception, you may use this file as part of a free software
17  * library without restriction.  Specifically, if other files instantiate
18  * templates or use macros or inline functions from this file, or you compile
19  * this file and link it with other files to produce an executable, this
20  * file does not by itself cause the resulting executable to be covered by
21  * the GNU General Public License.  This exception does not however
22  * invalidate any other reasons why the executable file might be covered by
23  * the GNU General Public License.
24  */
25 #pragma once
26 
27 #include <l4/sys/types.h>
28 #include <l4/sys/kdebug.h>
29 
30 /*****************************************************************************
31  *** Implementation
32  *****************************************************************************/
33 
34 L4_INLINE l4_umword_t
fiasco_tbuf_log(const char * text)35 fiasco_tbuf_log(const char *text)
36 {
37   enum { TBUF_LOG = 0x201 };
38   return l4_error(__kdebug_text(TBUF_LOG, text, __builtin_strlen(text)));
39 }
40 
41 L4_INLINE l4_umword_t
fiasco_tbuf_log_3val(const char * text,l4_umword_t v1,l4_umword_t v2,l4_umword_t v3)42 fiasco_tbuf_log_3val(const char *text, l4_umword_t v1, l4_umword_t v2,
43                      l4_umword_t v3)
44 {
45   enum { TBUF_LOG_3VAL = 0x204 };
46   return l4_error(__kdebug_3_text(TBUF_LOG_3VAL, text,
47                                   __builtin_strlen(text), v1, v2, v3));
48 }
49 
50 L4_INLINE void
fiasco_tbuf_clear(void)51 fiasco_tbuf_clear(void)
52 {
53   enum { TBUF_CLEAR = 0x202 };
54   __kdebug_op(TBUF_CLEAR);
55 }
56 
57 L4_INLINE void
fiasco_tbuf_dump(void)58 fiasco_tbuf_dump(void)
59 {
60   enum { TBUF_DUMP = 0x203 };
61   __kdebug_op(TBUF_DUMP);
62 }
63 
64 L4_INLINE l4_umword_t
fiasco_tbuf_log_binary(const unsigned char * data)65 fiasco_tbuf_log_binary(const unsigned char *data)
66 {
67   enum { TBUF_LOG_BIN = 0x208 };
68   return l4_error(__kdebug_text(TBUF_LOG_BIN, (const char *)data, 24));
69 }
70 
71