mirror of https://github.com/dynup/kpatch
35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c
|
|
--- src.orig/fs/proc/cmdline.c 2022-04-29 16:08:21.408780547 -0400
|
|
+++ src/fs/proc/cmdline.c 2022-04-29 16:09:10.382954829 -0400
|
|
@@ -17,3 +17,10 @@ static int __init proc_cmdline_init(void
|
|
return 0;
|
|
}
|
|
fs_initcall(proc_cmdline_init);
|
|
+
|
|
+#include <linux/printk.h>
|
|
+void kpatch_print_message(void)
|
|
+{
|
|
+ if (!jiffies)
|
|
+ printk("hello there!\n");
|
|
+}
|
|
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
|
|
--- src.orig/fs/proc/meminfo.c 2022-04-29 16:08:21.409780550 -0400
|
|
+++ src/fs/proc/meminfo.c 2022-04-29 16:09:10.382954829 -0400
|
|
@@ -21,6 +21,8 @@
|
|
#include <asm/pgtable.h>
|
|
#include "internal.h"
|
|
|
|
+void kpatch_print_message(void);
|
|
+
|
|
void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
|
|
{
|
|
}
|
|
@@ -57,6 +59,7 @@ static int meminfo_proc_show(struct seq_
|
|
sreclaimable = global_node_page_state_pages(NR_SLAB_RECLAIMABLE_B);
|
|
sunreclaim = global_node_page_state_pages(NR_SLAB_UNRECLAIMABLE_B);
|
|
|
|
+ kpatch_print_message();
|
|
show_val_kb(m, "MemTotal: ", i.totalram);
|
|
show_val_kb(m, "MemFree: ", i.freeram);
|
|
show_val_kb(m, "MemAvailable: ", available);
|