mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
ProcessManager+top: Rename "linear" size to "virtual" size.
I originally called it "linear" because that's how the Intel manual names virtual addresses in many cases. I'm ready to accept that most people know this as "virtual" so let's just call it that.
This commit is contained in:
parent
54448b5d24
commit
0ed89440f1
Notes:
sideshowbarker
2024-07-19 13:41:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0ed89440f14
5 changed files with 27 additions and 27 deletions
|
@ -52,8 +52,8 @@ String ProcessModel::column_name(int column) const
|
|||
return "User";
|
||||
case Column::Priority:
|
||||
return "Pr";
|
||||
case Column::Linear:
|
||||
return "Linear";
|
||||
case Column::Virtual:
|
||||
return "Virtual";
|
||||
case Column::Physical:
|
||||
return "Physical";
|
||||
case Column::CPU:
|
||||
|
@ -80,7 +80,7 @@ GModel::ColumnMetadata ProcessModel::column_metadata(int column) const
|
|||
return { 16, TextAlignment::CenterLeft };
|
||||
case Column::User:
|
||||
return { 50, TextAlignment::CenterLeft };
|
||||
case Column::Linear:
|
||||
case Column::Virtual:
|
||||
return { 65, TextAlignment::CenterRight };
|
||||
case Column::Physical:
|
||||
return { 65, TextAlignment::CenterRight };
|
||||
|
@ -128,10 +128,10 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const
|
|||
return 3;
|
||||
ASSERT_NOT_REACHED();
|
||||
return 3;
|
||||
case Column::Linear:
|
||||
return (int)process.current_state.linear;
|
||||
case Column::Virtual:
|
||||
return (int)process.current_state.virtual_size;
|
||||
case Column::Physical:
|
||||
return (int)process.current_state.physical;
|
||||
return (int)process.current_state.physical_size;
|
||||
case Column::CPU:
|
||||
return process.current_state.cpu_percent;
|
||||
case Column::Name:
|
||||
|
@ -164,10 +164,10 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const
|
|||
if (process.current_state.priority == "Normal")
|
||||
return *m_normal_priority_icon;
|
||||
return process.current_state.priority;
|
||||
case Column::Linear:
|
||||
return pretty_byte_size(process.current_state.linear);
|
||||
case Column::Virtual:
|
||||
return pretty_byte_size(process.current_state.virtual_size);
|
||||
case Column::Physical:
|
||||
return pretty_byte_size(process.current_state.physical);
|
||||
return pretty_byte_size(process.current_state.physical_size);
|
||||
case Column::CPU:
|
||||
return process.current_state.cpu_percent;
|
||||
case Column::Name:
|
||||
|
@ -221,9 +221,9 @@ void ProcessModel::update()
|
|||
ASSERT(ok);
|
||||
state.state = parts[7];
|
||||
state.name = parts[11];
|
||||
state.linear = parts[12].to_uint(ok);
|
||||
state.virtual_size = parts[12].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
state.physical = parts[13].to_uint(ok);
|
||||
state.physical_size = parts[13].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
sum_nsched += nsched;
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
Priority,
|
||||
User,
|
||||
PID,
|
||||
Linear,
|
||||
Virtual,
|
||||
Physical,
|
||||
Syscalls,
|
||||
__Count
|
||||
|
@ -48,8 +48,8 @@ private:
|
|||
String state;
|
||||
String user;
|
||||
String priority;
|
||||
size_t linear;
|
||||
size_t physical;
|
||||
size_t virtual_size;
|
||||
size_t physical_size;
|
||||
unsigned syscalls;
|
||||
float cpu_percent;
|
||||
};
|
||||
|
|
|
@ -74,13 +74,13 @@ void CProcessStatisticsReader::update_map(HashMap<pid_t, CProcessStatistics>& ma
|
|||
process.state = parts[7];
|
||||
|
||||
process.name = parts[11];
|
||||
process.linear = parts[12].to_uint(ok);
|
||||
process.virtual_size = parts[12].to_uint(ok);
|
||||
if (!ok) {
|
||||
fprintf(stderr, "CProcessHelper : couldn't convert %s to a valid amount of linear address space used\n", parts[12].characters());
|
||||
fprintf(stderr, "CProcessHelper : couldn't convert %s to a valid amount of virtual address space used\n", parts[12].characters());
|
||||
return;
|
||||
}
|
||||
|
||||
process.physical = parts[13].to_uint(ok);
|
||||
process.physical_size = parts[13].to_uint(ok);
|
||||
if (!ok) {
|
||||
fprintf(stderr, "CProcessHelper : couldn't convert %s to a valid amount of physical address space used\n", parts[13].characters());
|
||||
return;
|
||||
|
|
|
@ -11,8 +11,8 @@ struct CProcessStatistics {
|
|||
String username;
|
||||
uid_t uid;
|
||||
String priority;
|
||||
size_t linear;
|
||||
size_t physical;
|
||||
size_t virtual_size;
|
||||
size_t physical_size;
|
||||
unsigned syscalls;
|
||||
};
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ struct Process {
|
|||
String state;
|
||||
String user;
|
||||
String priority;
|
||||
unsigned linear;
|
||||
unsigned committed;
|
||||
unsigned virtual_size;
|
||||
unsigned physical_size;
|
||||
unsigned nsched_since_prev;
|
||||
unsigned cpu_percent;
|
||||
unsigned cpu_percent_decimal;
|
||||
|
@ -61,9 +61,9 @@ static Snapshot get_snapshot()
|
|||
process.priority = parts[16];
|
||||
process.state = parts[7];
|
||||
process.name = parts[11];
|
||||
process.linear = parts[12].to_uint(ok);
|
||||
process.virtual_size = parts[12].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
process.committed = parts[13].to_uint(ok);
|
||||
process.physical_size = parts[13].to_uint(ok);
|
||||
ASSERT(ok);
|
||||
snapshot.map.set(pid, move(process));
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ int main(int, char**)
|
|||
"PRI",
|
||||
"USER",
|
||||
"STATE",
|
||||
"LINEAR",
|
||||
"COMMIT",
|
||||
"VIRT",
|
||||
"PHYS",
|
||||
"%CPU",
|
||||
"NAME");
|
||||
for (auto& it : current.map) {
|
||||
|
@ -123,8 +123,8 @@ int main(int, char**)
|
|||
process->priority[0],
|
||||
process->user.characters(),
|
||||
process->state.characters(),
|
||||
process->linear / 1024,
|
||||
process->committed / 1024,
|
||||
process->virtual_size / 1024,
|
||||
process->physical_size / 1024,
|
||||
process->cpu_percent,
|
||||
process->cpu_percent_decimal,
|
||||
process->name.characters());
|
||||
|
|
Loading…
Reference in a new issue