mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 02:58:12 +00:00
Kernel: Remove tracking of bitmap memory.
There are no more kernel bitmaps. It's much better this way.
This commit is contained in:
parent
cc9ff96a98
commit
809266a9fb
4 changed files with 5 additions and 22 deletions
|
@ -505,7 +505,7 @@ ByteBuffer procfs$all(InodeIdentifier)
|
|||
auto processes = Process::all_processes();
|
||||
StringBuilder builder;
|
||||
auto build_process_line = [&builder] (Process* process) {
|
||||
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%s,%u,%u,%s,%s,%u,%u,%u,%u,%u,%s\n",
|
||||
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%s,%u,%u,%s,%s,%u,%u,%u,%u,%s\n",
|
||||
process->pid(),
|
||||
process->times_scheduled(),
|
||||
process->tty() ? process->tty()->pgid() : 0,
|
||||
|
@ -521,7 +521,6 @@ ByteBuffer procfs$all(InodeIdentifier)
|
|||
process->amount_virtual(),
|
||||
process->amount_resident(),
|
||||
process->amount_shared(),
|
||||
process->amount_in_bitmaps(),
|
||||
process->ticks(),
|
||||
to_string(process->priority())
|
||||
);
|
||||
|
|
|
@ -2168,16 +2168,6 @@ size_t Process::amount_virtual() const
|
|||
return amount;
|
||||
}
|
||||
|
||||
size_t Process::amount_in_bitmaps() const
|
||||
{
|
||||
size_t amount = 0;
|
||||
for (auto& region : m_regions) {
|
||||
if (region->is_bitmap())
|
||||
amount += region->size();
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
size_t Process::amount_resident() const
|
||||
{
|
||||
// FIXME: This will double count if multiple regions use the same physical page.
|
||||
|
|
|
@ -277,7 +277,6 @@ public:
|
|||
size_t amount_virtual() const;
|
||||
size_t amount_resident() const;
|
||||
size_t amount_shared() const;
|
||||
size_t amount_in_bitmaps() const;
|
||||
|
||||
Process* fork(RegisterDump&);
|
||||
int exec(const String& path, Vector<String>&& arguments, Vector<String>&& environment);
|
||||
|
|
|
@ -18,7 +18,6 @@ struct Process {
|
|||
String priority;
|
||||
unsigned linear;
|
||||
unsigned committed;
|
||||
unsigned in_bitmaps;
|
||||
unsigned nsched_since_prev;
|
||||
unsigned cpu_percent;
|
||||
unsigned cpu_percent_decimal;
|
||||
|
@ -44,7 +43,7 @@ static Snapshot get_snapshot()
|
|||
if (!ptr)
|
||||
break;
|
||||
auto parts = String(buf, Chomp).split(',');
|
||||
if (parts.size() < 18)
|
||||
if (parts.size() < 17)
|
||||
break;
|
||||
bool ok;
|
||||
pid_t pid = parts[0].to_uint(ok);
|
||||
|
@ -58,15 +57,13 @@ static Snapshot get_snapshot()
|
|||
unsigned uid = parts[5].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
process.user = s_usernames->get(uid);
|
||||
process.priority = parts[17];
|
||||
process.priority = parts[16];
|
||||
process.state = parts[7];
|
||||
process.name = parts[11];
|
||||
process.linear = parts[12].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
process.committed = parts[13].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
process.in_bitmaps = parts[15].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
snapshot.map.set(pid, move(process));
|
||||
}
|
||||
int rc = fclose(fp);
|
||||
|
@ -90,14 +87,13 @@ int main(int, char**)
|
|||
auto sum_diff = current.sum_nsched - prev.sum_nsched;
|
||||
|
||||
printf("\033[3J\033[H\033[2J");
|
||||
printf("\033[47;30m%6s %3s % 8s % 8s %6s %6s %6s %4s %s\033[K\033[0m\n",
|
||||
printf("\033[47;30m%6s %3s % 8s % 8s %6s %6s %4s %s\033[K\033[0m\n",
|
||||
"PID",
|
||||
"PRI",
|
||||
"USER",
|
||||
"STATE",
|
||||
"LINEAR",
|
||||
"COMMIT",
|
||||
"BITMAP",
|
||||
"%CPU",
|
||||
"NAME");
|
||||
for (auto& it : current.map) {
|
||||
|
@ -123,14 +119,13 @@ int main(int, char**)
|
|||
});
|
||||
|
||||
for (auto* process : processes) {
|
||||
printf("%6d %c % 8s % 8s %6u %6u %6u %2u.%1u %s\n",
|
||||
printf("%6d %c % 8s % 8s %6u %6u %2u.%1u %s\n",
|
||||
process->pid,
|
||||
process->priority[0],
|
||||
process->user.characters(),
|
||||
process->state.characters(),
|
||||
process->linear / 1024,
|
||||
process->committed / 1024,
|
||||
process->in_bitmaps / 1024,
|
||||
process->cpu_percent,
|
||||
process->cpu_percent_decimal,
|
||||
process->name.characters()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue