mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
feat: Add SLAB allocator, Ramdisk, Kernel Namespaces, Event Tracing, NetFilter Firewall, 8-Bit Melodies, and Shell Scripting (sh)
This commit is contained in:
1 parent
9f9a19bab0
commit
2f1f785cee
17 files changed
+1021
-115
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#ifndef _KERNEL_TRACE_H
|
||||
#define _KERNEL_TRACE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define TRACE_BUFFER_SIZE 256
|
||||
#define TRACE_MSG_LEN 96
|
||||
|
||||
typedef enum {
|
||||
TRACE_CAT_SYS = 0,
|
||||
TRACE_CAT_IRQ,
|
||||
TRACE_CAT_SCHED,
|
||||
TRACE_CAT_MM,
|
||||
TRACE_CAT_NET,
|
||||
TRACE_CAT_FS,
|
||||
TRACE_CAT_MAX
|
||||
} trace_category_t;
|
||||
|
||||
typedef struct trace_entry {
|
||||
uint64_t timestamp;
|
||||
uint32_t cpu_id;
|
||||
uint32_t pid;
|
||||
trace_category_t category;
|
||||
char message[TRACE_MSG_LEN];
|
||||
} trace_entry_t;
|
||||
|
||||
void trace_init(void);
|
||||
void trace_record(trace_category_t cat, const char* msg);
|
||||
void trace_enable(bool enable);
|
||||
bool trace_is_enabled(void);
|
||||
void trace_clear(void);
|
||||
size_t trace_get_count(void);
|
||||
const trace_entry_t* trace_get_entry(size_t index);
|
||||
|
||||
#endif // _KERNEL_TRACE_H
|
||||
Reference in new issue
Block a user