ProcessInfo.h 534 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Types.h>
  8. #if defined(AK_OS_MACH)
  9. # include <LibCore/MachPort.h>
  10. #endif
  11. namespace Core::Platform {
  12. struct ProcessInfo {
  13. explicit ProcessInfo(pid_t pid)
  14. : pid(pid)
  15. {
  16. }
  17. pid_t pid { 0 };
  18. u64 memory_usage_bytes { 0 };
  19. float cpu_percent { 0.0f };
  20. u64 time_spent_in_process { 0 };
  21. #if defined(AK_OS_MACH)
  22. Core::MachPort child_task_port;
  23. #endif
  24. };
  25. }