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
39typedef union {
40 struct {
41 uint8_t flags;
42 uintptr_t function;
43 uintptr_t caller;
44 uint16_t magic;
45 } data;
46
47 uint8_t buffer[sizeof(data)];
49
59 struct {
66 uint32_t function;
67 } data;
68
69 uint8_t buffer[sizeof(data)];
70
72 typedef uintptr_t lite;
74
75#endif // KERNEL_INSTRUMENT_H
uintptr_t lite
For SFINAE expansion in data processing.
Definition instrument.h:72