L4Re - L4 Runtime Environment
Go to the documentation of this file.
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  * 2015 Adam Lackorzynski <adam@l4re.org>
11  * economic rights: Technische Universität Dresden (Germany)
12  *
13  * This file is part of TUD:OS and distributed under the terms of the
14  * GNU General Public License 2.
15  * Please see the COPYING-GPL-2 file for details.
16  *
17  * As a special exception, you may use this file as part of a free software
18  * library without restriction. Specifically, if other files instantiate
19  * templates or use macros or inline functions from this file, or you compile
20  * this file and link it with other files to produce an executable, this
21  * file does not by itself cause the resulting executable to be covered by
22  * the GNU General Public License. This exception does not however
23  * invalidate any other reasons why the executable file might be covered by
24  * the GNU General Public License.
25  */
26 /*****************************************************************************/
27 #ifndef __L4_KTRACE_H__
28 #define __L4_KTRACE_H__
30 #include <l4/sys/types.h>
31 #include <l4/sys/ktrace_events.h>
37 enum
38 {
45 };
51 // keep in sync with fiasco/src/jabi/jdb_ktrace.cpp
52 typedef struct
53 {
55  l4_tracebuffer_entry_t *tracebuffer;
59  volatile l4_uint64_t version;
66 // keep in sync with fiasco/src/jabi/jdb_ktrace.cpp
67 typedef struct
68 {
71  volatile l4_tracebuffer_entry_t * current_entry;
91  volatile l4_uint32_t cnt_irq;
116 L4_INLINE l4_tracebuffer_status_t *
125 L4_INLINE l4_addr_t
135 L4_INLINE l4_umword_t
136 fiasco_tbuf_log(const char *text);
149 L4_INLINE l4_umword_t
150 fiasco_tbuf_log_3val(const char *text, l4_umword_t v1, l4_umword_t v2, l4_umword_t v3);
159 L4_INLINE l4_umword_t
160 fiasco_tbuf_log_binary(const unsigned char *data);
166 L4_INLINE void
167 fiasco_tbuf_clear(void);
173 L4_INLINE void
174 fiasco_tbuf_dump(void);
176 #include <l4/sys/__ktrace-impl.h>
178 #endif
l4_addr_t fiasco_tbuf_get_status_phys(void)
Return the physical address of the trace-buffer status struct.
Definition: __ktrace-impl.h:42
volatile l4_uint32_t cnt_page_fault
Number of page faults.
Definition: ktrace.h:95
Maximum number of events.
Definition: ktrace.h:44
volatile l4_uint32_t cnt_shortcut_failed
How often was the IPC shortcut taken.
Definition: ktrace.h:87
Trace-buffer status window descriptor.
Definition: ktrace.h:52
volatile l4_uint32_t cnt_io_fault
Number of faults (application runs at IOPL 0 and tries to execute cli, sti, in, or out but does not h...
Definition: ktrace.h:98
Event: context switch.
Definition: ktrace.h:39
volatile l4_uint32_t cnt_addr_space_switch
Number of inter AS context switches.
Definition: ktrace.h:85
Common L4 ABI Data Types.
volatile l4_uint32_t cnt_task_create
Number of tasks created.
Definition: ktrace.h:100
void fiasco_tbuf_clear(void)
Clear trace-buffer.
Definition: __ktrace-impl.h:64
Event: Timer IRQ occurred.
Definition: ktrace.h:42
volatile l4_uint32_t cnt_ipc_long
Number of long IPCs.
Definition: ktrace.h:93
l4_uint32_t scaler_ns_to_tsc
Scaler used for translation of nano seconds to CPU cycles.
Definition: ktrace.h:80
volatile l4_uint32_t cnt_iobmap_tlb_flush
Number of flushes of the I/O bitmap.
Definition: ktrace.h:106
void fiasco_tbuf_dump(void)
Dump trace-buffer to kernel console.
Definition: __ktrace-impl.h:71
volatile l4_uint32_t cnt_shortcut_success
How often was the IPC shortcut not taken.
Definition: ktrace.h:89
l4_umword_t fiasco_tbuf_log_3val(const char *text, l4_umword_t v1, l4_umword_t v2, l4_umword_t v3)
Create new trace-buffer entry with describing <text> and three additional values. ...
Definition: __ktrace-impl.h:55
l4_tracebuffer_status_t * fiasco_tbuf_get_status(void)
Return trace-buffer status.
Definition: __ktrace-impl.h:35
Event: IPC shortcut.
Definition: ktrace.h:40
l4_uint32_t scaler_tsc_to_us
Scaler used for translation of CPU cycles to micro seconds.
Definition: ktrace.h:78
l4_umword_t fiasco_tbuf_log(const char *text)
Create new trace-buffer entry with describing <text>.
Definition: __ktrace-impl.h:48
l4_uint32_t scaler_tsc_to_ns
Scaler used for translation of CPU cycles to nano seconds.
Definition: ktrace.h:76
volatile l4_uint32_t cnt_context_switch
Number of context switches (intra AS or inter AS)
Definition: ktrace.h:83
volatile l4_uint32_t cnt_irq
Number of hardware interrupts (without kernel scheduling interrupt)
Definition: ktrace.h:91
l4_umword_t fiasco_tbuf_log_binary(const unsigned char *data)
Create new trace-buffer entry with binary data.
Definition: __ktrace-impl.h:78
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
l4_tracebuffer_entry_t * tracebuffer
Address of trace-buffer.
Definition: ktrace.h:55
volatile l4_uint32_t cnt_schedule
Number of reschedules.
Definition: ktrace.h:102
Event: IRQ occurred.
Definition: ktrace.h:41
Event: thread_ex_regs.
Definition: ktrace.h:43
Trace-buffer status.
Definition: ktrace.h:67
volatile l4_uint64_t version
Version number of trace-buffer (incremented if trace-buffer overruns)
Definition: ktrace.h:59
volatile l4_tracebuffer_entry_t * current_entry
Address of the most current event in trace-buffer.
Definition: ktrace.h:71
L4 kernel event tracing.
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition: l4int.h:42
unsigned long l4_addr_t
Address type.
Definition: l4int.h:45
l4_umword_t size
Size of trace-buffer.
Definition: ktrace.h:57
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition: l4int.h:40