From aba10db7b6f9f872f97446253a479ba212de4bd3 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 27 May 2021 19:59:31 +0900 Subject: [PATCH] track last core in procfs --- kernel/vfs/procfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/vfs/procfs.c b/kernel/vfs/procfs.c index 1cb9ba6..f41aa19 100644 --- a/kernel/vfs/procfs.c +++ b/kernel/vfs/procfs.c @@ -128,7 +128,7 @@ static uint64_t proc_status_func(fs_node_t *node, uint64_t offset, uint64_t size long shm_usage = mmu_count_shm(proc->thread.page_directory->directory) * 4; long mem_permille = 1000 * (mem_usage + shm_usage) / mmu_total_memory(); - snprintf(buf, 1000, + snprintf(buf, 2000, "Name:\t%s\n" /* name */ "State:\t%c\n" "Tgid:\t%d\n" /* group ? group : pid */ @@ -149,6 +149,7 @@ static uint64_t proc_status_func(fs_node_t *node, uint64_t offset, uint64_t size "VmSize:\t %ld kB\n" "RssShmem:\t %ld kB\n" "MemPermille:\t %ld\n" + "LastCore:\t %d\n" , name, state, @@ -167,7 +168,8 @@ static uint64_t proc_status_func(fs_node_t *node, uint64_t offset, uint64_t size proc->syscall_registers ? arch_syscall_arg4(proc->syscall_registers) : 0, proc->syscall_registers ? arch_stack_pointer(proc->syscall_registers) : 0, proc->cmdline ? proc->cmdline[0] : "(none)", - mem_usage, shm_usage, mem_permille + mem_usage, shm_usage, mem_permille, + proc->owner ); size_t _bsize = strlen(buf);