The Pedigree Project  0.1
instrument.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef KERNEL_INSTRUMENT_H
21 #define KERNEL_INSTRUMENT_H
22 
23 #include "pedigree/kernel/processor/types.h"
24 
25 // Global flags are held within the first byte written to the instrumentation
26 // stream, and control things like which data types to use.
27 #define INSTRUMENT_GLOBAL_LITE (1 << 0)
28 
29 // Record flags define how to interpret the specific records.
30 #define INSTRUMENT_RECORD_ENTRY (1 << 0)
31 #define INSTRUMENT_RECORD_SHORTPTR (1 << 4)
32 
33 #define INSTRUMENT_MAGIC 0x1090U
34 
39 typedef union
40 {
41  struct
42  {
43  uint8_t flags;
44  uintptr_t function;
45  uintptr_t caller;
46  uint16_t magic;
47  } data;
48 
49  uint8_t buffer[sizeof(data)];
51 
60 typedef union
61 {
62  struct
63  {
70  uint32_t function;
71  } data;
72 
73  uint8_t buffer[sizeof(data)];
74 
76  typedef uintptr_t lite;
78 
79 #endif // KERNEL_INSTRUMENT_H
uintptr_t lite
For SFINAE expansion in data processing.
Definition: instrument.h:76