1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:15:08 +00:00

Add "times scheduled" field to /proc/summary

This commit is contained in:
Andreas Kling 2018-10-23 15:59:38 +02:00
parent 44045b258c
commit e4bfcd2346
2 changed files with 4 additions and 7 deletions

View file

@ -24,13 +24,14 @@ bool ProcFileSystem::initialize()
auto stringImpl = StringImpl::createUninitialized(tasks.size() * 128, buffer);
memset(buffer, 0, stringImpl->length());
char* ptr = buffer;
ptr += ksprintf(ptr, "PID OWNER STATE NAME\n");
ptr += ksprintf(ptr, "PID OWNER STATE NSCHED NAME\n");
for (auto* task : tasks) {
ptr += ksprintf(ptr, "%w %w:%w %b %s\n",
ptr += ksprintf(ptr, "%w %w:%w %b %w %s\n",
task->pid(),
task->uid(),
task->gid(),
task->state(),
task->timesScheduled(),
task->name().characters());
}
ptr += ksprintf(ptr, "kmalloc: alloc: %u / free: %u\n", sum_alloc, sum_free);