MOS Source Code
Loading...
Searching...
No Matches
printk.hpp File Reference
#include "mos/syslog/debug.hpp"
#include "mos/syslog/syslog.hpp"
#include <mos/mos_global.h>
#include <mos/types.hpp>
#include <stdarg.h>
Include dependency graph for printk.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define pr_fmt(fmt)
#define emit_syslog(level, feat, fmt, ...)
#define emit_syslog_nofeat(level, fmt, ...)
#define lprintk_debug_wrapper(feat, level, fmt, ...)
#define pr_dinfo2(feat, fmt, ...)
#define pr_dinfo(feat, fmt, ...)
#define pr_demph(feat, fmt, ...)
#define pr_dwarn(feat, fmt, ...)
#define pr_demerg(feat, fmt, ...)
#define pr_dfatal(feat, fmt, ...)
#define pr_dcont(feat, fmt, ...)
#define pr_info(fmt, ...)
#define pr_info2(fmt, ...)
#define pr_emph(fmt, ...)
#define pr_warn(fmt, ...)
#define pr_emerg(fmt, ...)
#define pr_fatal(fmt, ...)
#define pr_cont(fmt, ...)

Functions

void print_to_console (Console *con, LogLevel loglevel, const char *message, size_t len)
void lvprintk (LogLevel loglevel, const char *fmt, va_list args)
void printk (const char *format,...)
void lprintk (LogLevel loglevel, const char *format,...)
bool printk_unquiet (void)
void printk_set_quiet (bool quiet)

Macro Definition Documentation

◆ pr_fmt

#define pr_fmt ( fmt)
Value:
#define fmt(_fmt,...)
Definition syslog.hpp:161

Definition at line 13 of file printk.hpp.

◆ emit_syslog

#define emit_syslog ( level,
feat,
fmt,
... )
Value:
do_syslog(LogLevel::level, __FILE_NAME__, __func__, __LINE__, &mos_debug_info.feat, fmt, ##__VA_ARGS__)
long do_syslog(LogLevel level, const char *file, const char *func, int line, const debug_info_entry *feat, const char *fmt,...)
Definition syslog.cpp:55

Definition at line 16 of file printk.hpp.

◆ emit_syslog_nofeat

#define emit_syslog_nofeat ( level,
fmt,
... )
Value:
do_syslog(LogLevel::level, __FILE_NAME__, __func__, __LINE__, NULL, fmt, ##__VA_ARGS__)
#define NULL
Definition pb_syshdr.h:46

Definition at line 17 of file printk.hpp.

◆ lprintk_debug_wrapper

#define lprintk_debug_wrapper ( feat,
level,
fmt,
... )
Value:
do \
{ \
if (mos_debug_enabled(feat)) \
emit_syslog(level, feat, fmt, ##__VA_ARGS__); \
} while (0)
#define mos_debug_enabled(name)
Definition debug.hpp:87

Definition at line 19 of file printk.hpp.

◆ pr_dinfo2

#define pr_dinfo2 ( feat,
fmt,
... )
Value:
lprintk_debug_wrapper(feat, INFO2, pr_fmt(fmt), ##__VA_ARGS__)
#define pr_fmt(fmt)
Definition limine.cpp:3
#define lprintk_debug_wrapper(feat, level, fmt,...)
Definition printk.hpp:19

Definition at line 27 of file printk.hpp.

Referenced by __destroy_page_table(), _pmm_ref_phyframes(), _pmm_unref_phyframes(), acpi_find_rsdp(), acpi_parse_rsdt(), add_to_memmap(), blocked_reschedule(), break_the_order(), break_this_pfn(), buddy_alloc_n_exact(), buddy_free_n(), buddy_init(), buddy_reserve_n(), cpio_i_iterate_dir(), cpio_mount(), create_idle_task(), dentry_check_refstat(), dentry_ref(), dentry_ref_up_to(), dentry_unref_one_norelease(), dispatch_syscall(), dmabuf_allocate(), dmabuf_free(), dmabuf_share(), dmabuf_unshare(), do_handle_sdt_header(), do_invoke_setup(), enter_scheduler(), extract_exact_range(), handle_kernel_panic(), inode_try_drop(), ioapic_enable_with_mode(), ioapic_init(), kthread_create_no_sched(), lapic_memory_setup(), lapic_read32(), lapic_read64(), lapic_write32(), lapic_write64(), limine_entry(), madt_parse_table(), mm_clone_vmap_locked(), mm_do_unmap(), mm_flag_pages_locked(), mm_map_kernel_pages(), mm_map_user_pages(), mm_replace_page_locked(), mmap_anonymous(), mos_cmdline_init(), MOS_SETUP(), naive_sched_init(), naive_sched_remove_thread(), naive_sched_select_next(), platform_ap_entry(), platform_arch_syscall(), platform_startup_late(), pmm_allocate_frames(), pmm_find_reserved_region(), pmm_free_frames(), pmm_init(), pmm_reserve_frames(), populate_freelist(), reschedule(), scheduler_wake_thread(), signal_do_ignore(), signal_exit_to_user_prepare(), signal_exit_to_user_prepare(), signal_on_returned(), thread_destroy(), thread_new(), tmpfs_create_inode(), try_merge(), unblock_scheduler(), x86_cpu_setup_xsave_area(), and x86_setup_direct_map().

◆ pr_dinfo

#define pr_dinfo ( feat,
fmt,
... )

◆ pr_demph

#define pr_demph ( feat,
fmt,
... )
Value:
lprintk_debug_wrapper(feat, EMPH, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 29 of file printk.hpp.

◆ pr_dwarn

#define pr_dwarn ( feat,
fmt,
... )
Value:
lprintk_debug_wrapper(feat, WARN, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 30 of file printk.hpp.

Referenced by madt_parse_table(), MOS_SETUP(), scheduler_init(), and try_handle_kernel_panics().

◆ pr_demerg

#define pr_demerg ( feat,
fmt,
... )
Value:
lprintk_debug_wrapper(feat, EMERG, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 31 of file printk.hpp.

◆ pr_dfatal

#define pr_dfatal ( feat,
fmt,
... )
Value:
lprintk_debug_wrapper(feat, FATAL, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 32 of file printk.hpp.

◆ pr_dcont

#define pr_dcont ( feat,
fmt,
... )
Value:
do { if (mos_debug_enabled(feat)) pr_cont(fmt, ##__VA_ARGS__); } while (0)
#define pr_cont(fmt,...)
Definition printk.hpp:41

Definition at line 33 of file printk.hpp.

Referenced by dispatch_syscall(), x86_cpu_setup_xsave_area(), x86_xrstor_thread(), and x86_xsave_thread().

◆ pr_info

◆ pr_info2

◆ pr_emph

◆ pr_warn

◆ pr_emerg

◆ pr_fatal

#define pr_fatal ( fmt,
... )
Value:

Definition at line 40 of file printk.hpp.

Referenced by handle_kernel_panic(), and kthread_create_no_sched().

◆ pr_cont

#define pr_cont ( fmt,
... )
Value:
emit_syslog_nofeat(UNSET, "" fmt, ##__VA_ARGS__)

Definition at line 41 of file printk.hpp.

Referenced by dump_fdt_node(), dump_list(), handle_kernel_panic(), hexdump(), limine_entry(), and print_property_value().

Function Documentation

◆ print_to_console()

void print_to_console ( Console * con,
LogLevel loglevel,
const char * message,
size_t len )

Definition at line 68 of file printk.cpp.

Referenced by lvprintk(), and SyslogStreamWriter::~SyslogStreamWriter().

Here is the call graph for this function:

◆ lvprintk()

void lvprintk ( LogLevel loglevel,
const char * fmt,
va_list args )

Definition at line 78 of file printk.cpp.

Referenced by lprintk(), and printk().

Here is the call graph for this function:

◆ printk()

void printk ( const char * format,
... )

Definition at line 112 of file printk.cpp.

Here is the call graph for this function:

◆ lprintk()

void lprintk ( LogLevel loglevel,
const char * format,
... )

Definition at line 104 of file printk.cpp.

Referenced by do_print_syslog(), mos_kwarn(), and test_engine_warning_handler().

Here is the call graph for this function:

◆ printk_unquiet()

bool printk_unquiet ( void )

Definition at line 92 of file printk.cpp.

Referenced by handle_kernel_panic().

◆ printk_set_quiet()

void printk_set_quiet ( bool quiet)

Definition at line 99 of file printk.cpp.