diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/include/trace.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/include/trace.h')
-rw-r--r-- | roms/skiboot/include/trace.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/roms/skiboot/include/trace.h b/roms/skiboot/include/trace.h new file mode 100644 index 000000000..1b1be249c --- /dev/null +++ b/roms/skiboot/include/trace.h @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +/* Copyright 2013-2019 IBM Corp. */ + +#ifndef __TRACE_H +#define __TRACE_H +#include <ccan/short_types/short_types.h> +#include <stddef.h> +#include <lock.h> +#include <trace_types.h> + + +struct cpu_thread; + +/* Here's one we prepared earlier. */ +void init_boot_tracebuf(struct cpu_thread *boot_cpu); + +struct trace_info { + /* Lock for writers. Exposed to kernel. */ + struct lock lock; + /* Exposed to kernel. */ + struct tracebuf tb; +}; + +#define TBUF_SZ ((1024 * 1024) - sizeof(struct trace_info) - sizeof(union trace)) + +/* Allocate trace buffers once we know memory topology */ +void init_trace_buffers(void); +void trace_add_dt_props(void); + +/* This will fill in timestamp and cpu; you must do type and len. */ +void trace_add(union trace *trace, u8 type, u16 len); + +/* Put trace node into dt. */ +void trace_add_node(void); +#endif /* __TRACE_H */ |