tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 93e210ba11011cbc6f156d82c2d81b9ea8f1b453
parent 240ee770dafdaea2db16fc1313d8837da0b6e02f
Author: Bas Schouten <bschouten@mozilla.com>
Date:   Wed,  8 Oct 2025 15:12:46 +0000

Bug 1988716 - Part 1: Make inference process distinguishable in our power usage data. r=florian,chutten,toolkit-telemetry-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D264933

Diffstat:
Mtoolkit/components/glean/ipc/FOGIPC.cpp | 12++++++++++++
Mtoolkit/components/processtools/metrics.yaml | 4++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/toolkit/components/glean/ipc/FOGIPC.cpp b/toolkit/components/glean/ipc/FOGIPC.cpp @@ -114,6 +114,7 @@ enum ProcessType { eContentForeground, eContentBackground, eGpuProcess, + eInferenceProcess, eUnknown, }; @@ -187,6 +188,10 @@ void RecordThreadCpuUse(const nsACString& aThreadName, uint64_t aCpuTimeMs, power_cpu_ms_per_thread::gpu_process.Get(threadName) .Add(int32_t(aCpuTimeMs)); break; + case eInferenceProcess: + power_cpu_ms_per_thread::inference_process.Get(threadName) + .Add(int32_t(aCpuTimeMs)); + break; case eUnknown: // Nothing to do. break; @@ -216,6 +221,10 @@ void RecordThreadCpuUse(const nsACString& aThreadName, uint64_t aCpuTimeMs, power_wakeups_per_thread::gpu_process.Get(threadName) .Add(int32_t(aWakeCount)); break; + case eInferenceProcess: + power_wakeups_per_thread::inference_process.Get(threadName) + .Add(int32_t(aWakeCount)); + break; case eUnknown: // Nothing to do. break; @@ -348,6 +357,9 @@ void RecordPowerMetrics() { MOZ_ASSERT_UNREACHABLE("Unsuppored process type for cpu time"); break; } + } else if (type == INFERENCE_REMOTE_TYPE) { + type.AssignLiteral("inference"); + gThisProcessType = ProcessType::eInferenceProcess; } GetTrackerType(trackerType); } else { diff --git a/toolkit/components/processtools/metrics.yaml b/toolkit/components/processtools/metrics.yaml @@ -57,6 +57,7 @@ power: - gpu - gmplugin - utility + - inference telemetry_mirror: POWER_CPU_TIME_PER_PROCESS_TYPE_MS cpu_time_per_tracker_type_ms: @@ -270,6 +271,7 @@ power.wakeups_per_thread: - mozstorage - mtransport - netlink_monitor + - onnx_worker - pacerthread - permission - playeventsound @@ -319,6 +321,7 @@ power.wakeups_per_thread: content_foreground: *per_thread_wakeups content_background: *per_thread_wakeups gpu_process: *per_thread_wakeups + inference_process: *per_thread_wakeups power.cpu_ms_per_thread: parent_active: &per_thread_cpu_ms @@ -342,6 +345,7 @@ power.cpu_ms_per_thread: content_foreground: *per_thread_cpu_ms content_background: *per_thread_cpu_ms gpu_process: *per_thread_cpu_ms + inference_process: *per_thread_cpu_ms power.battery: percentage_when_user_active: