A modification to the Linux 4.14 kernel that adds system calls for controlling and writing to a system-wide process log.
- Retrieves the current process log threshold.
- Allows privileged users to change the system-wide threshold.
- Logs messages at severity levels 0–7 through the Linux kernel.
- Includes the calling process name and PID in each message.
- Limits messages to 128 characters and validates user-space memory.
- Provides a small C library for calling the new system calls from user programs.
| Number | System Call | Purpose |
|---|---|---|
| 548 | get_proc_log_level |
Returns the current logging threshold |
| 549 | set_proc_log_level |
Updates the threshold when called with administrator privileges |
| 550 | proc_log_message |
Sends a process message to the kernel log |
Messages are written only when their severity level is within the active logging threshold.
kernel/process_log.patch— Kernel modificationsprocess_log/process_log.c— User-space library implementationprocess_log/process_log.h— Library interface and system call definitionsprocess_log/Makefile— Builds the process logging library
cd process_log
makePrograms can link against the resulting library with:
gcc -o program program.c -L./process_log -lprocess_logFor C++ programs:
g++ -std=c++17 -o program program.cpp -L./process_log -lprocess_logFrom the root of a clean Linux 4.14 kernel source tree:
patch -p1 < /path/to/process_log.patchRebuild and install the kernel after applying the patch.
This project was developed for the x86-64 Linux 4.14 kernel. It uses system call numbers 548–550 and may require changes for other kernel versions or architectures.