Skip to content

Commit

Permalink
[programs/cludio] Make 'memory' display global memory stats in KiB
Browse files Browse the repository at this point in the history
Previously, the total memory was display in KiB but global memory in
_bytes_, which makes no sense whatsoever.

Ideally, I'd like to do something like `du -h` does it, and display in
whatever format is most appropriate - GiB, MiB or KiB. But, this is more
work and this is a side-track to what I'm _really_ working on so leaving
that for now.
  • Loading branch information
perlun committed Jul 5, 2019
1 parent 6be2a60 commit 283f940
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions programs/cluido/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,9 @@ void command_memory(int number_of_arguments UNUSED, char **argument UNUSED)
memory_info.total_memory / 1024, memory_info.free_memory / 1024,
(memory_info.total_memory - memory_info.free_memory) / 1024);
console_print_formatted(&console_structure,
"Global memory: %lu total, %lu free, %lu used\n",
memory_info.total_global_memory, memory_info.free_global_memory,
memory_info.total_global_memory - memory_info.free_global_memory);
"Global memory: %luK total, %luK free, %luK used\n",
memory_info.total_global_memory / 1024, memory_info.free_global_memory / 1024,
(memory_info.total_global_memory - memory_info.free_global_memory) / 1024);
}

// Get information about installed PCI devices.
Expand Down

0 comments on commit 283f940

Please sign in to comment.