Commit 390a9737 authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

browser: Add Get{Vm,ArcSystem}ProcessList traces

While profiling Chrome on CrOS, we noticed a significant amount of time is
spent in Get{Vm,ArcSystem}ProcessList even if the task manager is not
running.

On a nocturne m3 we observed 2% total of the CPU used is spent in these
two functions.
This CL adds traces for those two functions.
Capturing a trace confirms that we call those two functions every few seconds
and they take about 80ms of CPU time each.

Bug: b/154362057
Change-Id: Ie851643dc1093e400282aeb976c880b9901f3138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153827Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760949}
parent 555ea082
...@@ -68,8 +68,8 @@ base::ProcessId GetArcInitProcessId( ...@@ -68,8 +68,8 @@ base::ProcessId GetArcInitProcessId(
} }
std::vector<ArcProcess> GetArcSystemProcessList() { std::vector<ArcProcess> GetArcSystemProcessList() {
TRACE_EVENT0("browser", "GetArcSystemProcessList");
std::vector<ArcProcess> ret_processes; std::vector<ArcProcess> ret_processes;
if (arc::IsArcVmEnabled()) { if (arc::IsArcVmEnabled()) {
// TODO(b/122992194): Fix this for ARCVM. // TODO(b/122992194): Fix this for ARCVM.
return ret_processes; return ret_processes;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/task/task_traits.h" #include "base/task/task_traits.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/task_manager/providers/vm/crostini_process_task.h" #include "chrome/browser/task_manager/providers/vm/crostini_process_task.h"
...@@ -220,6 +221,7 @@ void VmProcessTaskProvider::StopUpdating() { ...@@ -220,6 +221,7 @@ void VmProcessTaskProvider::StopUpdating() {
} }
std::vector<VmProcessData> GetVmProcessList() { std::vector<VmProcessData> GetVmProcessList() {
TRACE_EVENT0("browser", "GetVmProcessList");
std::vector<VmProcessData> ret_processes; std::vector<VmProcessData> ret_processes;
const base::ProcessIterator::ProcessEntries& entry_list = const base::ProcessIterator::ProcessEntries& entry_list =
base::ProcessIterator(nullptr).Snapshot(); base::ProcessIterator(nullptr).Snapshot();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment