Backed out 3 changesets (bug 1790872) for causing linux build timeouts. CLOSED TREE

Backed out changeset e4a4e7668efb (bug 1790872)
Backed out changeset 99c09dfae9a7 (bug 1790872)
Backed out changeset 15a5a67c1cee (bug 1790872)
This commit is contained in:
Cosmin Sabou 2022-11-08 07:34:48 +02:00
parent 4d88a72636
commit 0b1543e85d
15 changed files with 52 additions and 3331 deletions

View file

@ -8,7 +8,6 @@
#include "chrome/common/ipc_message.h"
#include "chrome/common/ipc_message_utils.h"
#include "mojo/core/ports/name.h"
#include "mozilla/FOGIPC.h"
#include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/ipc/ProtocolMessageUtils.h"
#include "mozilla/ipc/ProtocolUtils.h"
@ -211,10 +210,6 @@ void NodeChannel::SendMessage(UniquePtr<IPC::Message> aMessage) {
return;
}
#ifdef NIGHTLY_BUILD
mozilla::glean::RecordIPCSentMessage(aMessage->type());
#endif
// NOTE: As this is not guaranteed to be running on the I/O thread, the
// channel may have become closed since we checked above. IPC::Channel will
// handle that and return `false` here, so we can re-check `mState`.
@ -241,10 +236,6 @@ void NodeChannel::OnMessageReceived(UniquePtr<IPC::Message> aMessage) {
}
#endif
#ifdef NIGHTLY_BUILD
mozilla::glean::RecordIPCReceivedMessage(aMessage->type());
#endif
IPC::MessageReader reader(*aMessage);
switch (aMessage->type()) {
case REQUEST_INTRODUCTION_MESSAGE_TYPE: {

View file

@ -4,7 +4,6 @@
from __future__ import print_function
from io import StringIO
import re
import optparse
import os
import sys
@ -309,88 +308,6 @@ print(
} // namespace IPC
#ifdef NIGHTLY_BUILD
namespace mozilla::glean {
// Used by FOGIPC.cpp
nsLiteralCString GleanKeyFromIPCMessageType(uint32_t aMessageType)
{
switch (aMessageType) {
""",
file=ipc_msgtype_name,
)
def make_glean_key_segment(s):
# handle uppercase sequences after `_`, `.`, or at the start of the string.
s = re.sub("(^|_)[A-Z]+", lambda m: m[0].lower(), s)
# add `_` before remaining uppercase sequences, and lowercase them.
s = re.sub("[A-Z]+", lambda m: "_" + m[0].lower(), s)
# truncate the segment length to 30 characters
if len(s) > 30:
s = s[:30]
return s
for protocol in sorted(allmessages.keys()):
for (msg, num) in allmessages[protocol].idnums:
if num or msg.endswith("End"):
continue
# Shorten the `Msg_` and `Reply_` prefixes.
glean_msg = re.sub("^Reply_", "r_", re.sub("^Msg_", "m_", msg))
print(
"""
case %s__%s:
return "%s.%s"_ns;"""
% (
protocol,
msg,
make_glean_key_segment(protocol),
make_glean_key_segment(glean_msg),
),
file=ipc_msgtype_name,
)
print(
"""
case DATA_PIPE_CLOSED_MESSAGE_TYPE:
return "data_pipe.closed"_ns;
case DATA_PIPE_BYTES_CONSUMED_MESSAGE_TYPE:
return "data_pipe.bytes_consumed"_ns;
case ACCEPT_INVITE_MESSAGE_TYPE:
return "node.accept_invite"_ns;
case REQUEST_INTRODUCTION_MESSAGE_TYPE:
return "node.request_introduction"_ns;
case INTRODUCE_MESSAGE_TYPE:
return "node.introduce"_ns;
case BROADCAST_MESSAGE_TYPE:
return "node.broadcast_message"_ns;
case EVENT_MESSAGE_TYPE:
return "node.event_message"_ns;
case IMPENDING_SHUTDOWN_MESSAGE_TYPE:
return "channel.impending_shutdown"_ns;
case BUILD_IDS_MATCH_MESSAGE_TYPE:
return "channel.build_ids_match"_ns;
case BUILD_ID_MESSAGE_TYPE:
return "channel.build_id"_ns;
case CHANNEL_OPENED_MESSAGE_TYPE:
return "channel.channel_opened"_ns;
case SHMEM_DESTROYED_MESSAGE_TYPE:
return "channel.shmem_destroyed"_ns;
case SHMEM_CREATED_MESSAGE_TYPE:
return "channel.shmem_created"_ns;
case GOODBYE_MESSAGE_TYPE:
return "channel.goodbye"_ns;
case CANCEL_MESSAGE_TYPE:
return "channel.cancel"_ns;
default:
return "unknown"_ns;
}
}
} // namespace mozilla::glean
#endif // defined(NIGHTLY_BUILD)
namespace mozilla {
namespace ipc {

File diff suppressed because it is too large Load diff

View file

@ -10,8 +10,6 @@
#############################################################
# gtests
[PTestGleanMsgTelemetry::HelloSync]
description = Only used by gtests
[PQuotaTest::Try_Success_CustomErr_QmIpcFail]
description = Only used by gtests
[PQuotaTest::Try_Success_CustomErr_IpcFail]

View file

@ -196,12 +196,11 @@ void IPDLUnitTestChild::ActorDestroy(ActorDestroyReason aWhy) {
}
}
void IPDLTestHelper::TestWrapper() {
void IPDLTestHelper::TestWrapper(bool aCrossProcess) {
// Create the host and start the test actor with it.
RefPtr<IPDLUnitTestParent> host =
GetTestMode() == TestMode::CrossProcess
? IPDLUnitTestParent::CreateCrossProcess()
: IPDLUnitTestParent::CreateCrossThread();
aCrossProcess ? IPDLUnitTestParent::CreateCrossProcess()
: IPDLUnitTestParent::CreateCrossThread();
ASSERT_TRUE(host);
if (!host->Start(GetName(), GetActor())) {
FAIL();

View file

@ -21,49 +21,39 @@ const char* RegisterAllocChildActor(
// Internal helper type used to declare IPDL tests.
class IPDLTestHelper {
public:
enum class TestMode {
SameProcess,
CrossProcess,
};
void TestWrapper();
void TestWrapper(bool aCrossProcess);
virtual const char* GetName() = 0;
virtual ipc::IToplevelProtocol* GetActor() = 0;
virtual TestMode GetTestMode() = 0;
virtual void TestBody() = 0;
};
#define IPDL_TEST_CLASS_NAME_(actorname) IPDL_TEST_##actorname
#define IPDL_TEST_HEAD_(actorname) \
class IPDL_TEST_CLASS_NAME_(actorname) \
: public ::mozilla::_ipdltest::IPDLTestHelper { \
public: \
explicit IPDL_TEST_CLASS_NAME_(actorname)(TestMode aTestMode) \
: mTestMode(aTestMode), mActor(new actorname##Parent) {} \
\
private: \
void TestBody() override; \
const char* GetName() override { return sName; } \
actorname##Parent* GetActor() override { return mActor; } \
TestMode GetTestMode() override { return mTestMode; } \
\
const TestMode mTestMode; \
actorname##Parent* mActor; \
static const char* sName; \
}; \
const char* IPDL_TEST_CLASS_NAME_(actorname)::sName = \
::mozilla::_ipdltest::RegisterAllocChildActor( \
#actorname, []() -> ::mozilla::ipc::IToplevelProtocol* { \
return new actorname##Child; \
#define IPDL_TEST_HEAD_(actorname) \
class IPDL_TEST_CLASS_NAME_(actorname) \
: public ::mozilla::_ipdltest::IPDLTestHelper { \
public: \
IPDL_TEST_CLASS_NAME_(actorname)() : mActor(new actorname##Parent) {} \
\
private: \
void TestBody() override; \
const char* GetName() override { return sName; }; \
actorname##Parent* GetActor() override { return mActor; }; \
\
actorname##Parent* mActor; \
static const char* sName; \
}; \
const char* IPDL_TEST_CLASS_NAME_(actorname)::sName = \
::mozilla::_ipdltest::RegisterAllocChildActor( \
#actorname, []() -> ::mozilla::ipc::IToplevelProtocol* { \
return new actorname##Child; \
});
#define IPDL_TEST_DECL_(testgroup, actorname, mode) \
TEST(testgroup, actorname) \
{ \
IPDL_TEST_CLASS_NAME_(actorname){ \
::mozilla::_ipdltest::IPDLTestHelper::TestMode::mode} \
.TestWrapper(); \
#define IPDL_TEST_DECL_(testgroup, actorname, crossprocess) \
TEST(testgroup, actorname) \
{ \
IPDL_TEST_CLASS_NAME_(actorname) test; \
test.TestWrapper(crossprocess); \
}
#define IPDL_TEST_BODY_SEGUE_(actorname) \
@ -78,10 +68,10 @@ class IPDLTestHelper {
//
// GTest assertions fired in the child process will be relayed to the parent
// process, and should generally function correctly.
#define IPDL_TEST(actorname) \
IPDL_TEST_HEAD_(actorname) \
IPDL_TEST_DECL_(IPDLTest_CrossProcess, actorname, CrossProcess) \
IPDL_TEST_DECL_(IPDLTest_CrossThread, actorname, SameProcess) \
#define IPDL_TEST(actorname) \
IPDL_TEST_HEAD_(actorname) \
IPDL_TEST_DECL_(IPDLTest_CrossProcess, actorname, true) \
IPDL_TEST_DECL_(IPDLTest_CrossThread, actorname, false) \
IPDL_TEST_BODY_SEGUE_(actorname)
} // namespace mozilla::_ipdltest

View file

@ -1,17 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace mozilla {
namespace _ipdltest {
sync protocol PTestGleanMsgTelemetry {
child:
async HelloAsync() returns (bool ok);
parent:
sync HelloSync() returns (bool ok);
};
} // namespace _ipdltest
} // namespace mozilla

View file

@ -1,123 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gtest/gtest.h"
#include "mozilla/_ipdltest/IPDLUnitTest.h"
#include "mozilla/_ipdltest/TestGleanMsgTelemetryChild.h"
#include "mozilla/_ipdltest/TestGleanMsgTelemetryParent.h"
#include "mozilla/FOGIPC.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/SpinEventLoopUntil.h"
#include "mozilla/ipc/MessageChannel.h"
#include "nsContentUtils.h"
using namespace mozilla::ipc;
namespace mozilla::_ipdltest {
static int GetSentCount(const nsACString& aLabel) {
#ifdef NIGHTLY_BUILD
auto value = mozilla::glean::ipc_sent_messages::parent_inactive.Get(aLabel)
.TestGetValue();
EXPECT_FALSE(value.isErr());
return value.unwrapOr(Nothing()).valueOr(0);
#else
return 0;
#endif
}
static int GetRecvCount(const nsACString& aLabel) {
#ifdef NIGHTLY_BUILD
auto value =
mozilla::glean::ipc_received_messages::parent_inactive.Get(aLabel)
.TestGetValue();
EXPECT_FALSE(value.isErr());
return value.unwrapOr(Nothing()).valueOr(0);
#else
return 0;
#endif
}
static constexpr nsLiteralCString kHelloAsyncKey =
"ptest_glean_msg_telemetry.m_hello_async"_ns;
static constexpr nsLiteralCString kHelloAsyncReplyKey =
"ptest_glean_msg_telemetry.r_hello_async"_ns;
static constexpr nsLiteralCString kHelloSyncKey =
"ptest_glean_msg_telemetry.m_hello_sync"_ns;
static constexpr nsLiteralCString kHelloSyncReplyKey =
"ptest_glean_msg_telemetry.r_hello_sync"_ns;
IPCResult TestGleanMsgTelemetryChild::RecvHelloAsync(
HelloAsyncResolver&& aResolver) {
EXPECT_TRUE(CanSend());
bool result = false;
EXPECT_TRUE(SendHelloSync(&result));
EXPECT_TRUE(result);
aResolver(result);
EXPECT_TRUE(CanSend());
return IPC_OK();
}
IPCResult TestGleanMsgTelemetryParent::RecvHelloSync(bool* aResult) {
EXPECT_EQ(mInitialHelloAsyncSent + mInc, GetSentCount(kHelloAsyncKey));
EXPECT_EQ(mInitialHelloAsyncReplyRecvd, GetRecvCount(kHelloAsyncReplyKey));
EXPECT_EQ(mInitialHelloSyncRecvd + mInc, GetRecvCount(kHelloSyncKey));
EXPECT_EQ(mInitialHelloSyncReplySent, GetSentCount(kHelloSyncReplyKey));
*aResult = true;
return IPC_OK();
}
IPDL_TEST(TestGleanMsgTelemetry) {
EXPECT_FALSE(nsContentUtils::GetUserIsInteracting())
<< "An earlier test did not reset user interaction status";
mozilla::glean::RecordPowerMetrics();
// Telemetry is only recorded for cross-process messages sent on nightly.
#ifdef NIGHTLY_BUILD
int inc = GetTestMode() == TestMode::SameProcess ? 0 : 1;
#else
int inc = 0;
#endif
// Record initial counts.
mActor->mInc = inc;
mActor->mInitialHelloAsyncSent = GetSentCount(kHelloAsyncKey);
mActor->mInitialHelloAsyncReplyRecvd = GetRecvCount(kHelloAsyncReplyKey);
mActor->mInitialHelloSyncRecvd = GetRecvCount(kHelloSyncKey);
mActor->mInitialHelloSyncReplySent = GetSentCount(kHelloSyncReplyKey);
// Send the initial message, and spin the event loop until we've received the
// final async reply.
bool done = false;
mActor->SendHelloAsync(
[&](bool aOk) {
EXPECT_TRUE(aOk) << "Expected response from AsyncHello";
done = true;
},
[&](mozilla::ipc::ResponseRejectReason aReason) {
EXPECT_TRUE(false) << "Unexpected AsyncHello rejection!";
done = true;
});
mozilla::SpinEventLoopUntil("_ipdltest::TestGleanMsgTelemetry"_ns,
[&] { return done; });
EXPECT_TRUE(done) << "Event loop exited early?";
// Check counts after the test is complete. If we're expecting it to
// increment, every test should increment by 1.
EXPECT_EQ(mActor->mInitialHelloAsyncSent + inc, GetSentCount(kHelloAsyncKey));
EXPECT_EQ(mActor->mInitialHelloAsyncReplyRecvd + inc,
GetRecvCount(kHelloAsyncReplyKey));
EXPECT_EQ(mActor->mInitialHelloSyncRecvd + inc, GetRecvCount(kHelloSyncKey));
EXPECT_EQ(mActor->mInitialHelloSyncReplySent + inc,
GetSentCount(kHelloSyncReplyKey));
mActor->Close();
}
} // namespace mozilla::_ipdltest

View file

@ -1,26 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla__ipdltest_TestGleanMsgTelemetryChild_h
#define mozilla__ipdltest_TestGleanMsgTelemetryChild_h
#include "mozilla/_ipdltest/PTestGleanMsgTelemetryChild.h"
namespace mozilla::_ipdltest {
class TestGleanMsgTelemetryChild : public PTestGleanMsgTelemetryChild {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestGleanMsgTelemetryChild, override)
public:
mozilla::ipc::IPCResult RecvHelloAsync(HelloAsyncResolver&&);
private:
~TestGleanMsgTelemetryChild() = default;
};
} // namespace mozilla::_ipdltest
#endif // mozilla__ipdltest_TestGleanMsgTelemetryChild_h

View file

@ -1,33 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla__ipdltest_TestGleanMsgTelemetryParent_h
#define mozilla__ipdltest_TestGleanMsgTelemetryParent_h
#include "mozilla/_ipdltest/PTestGleanMsgTelemetryParent.h"
namespace mozilla::_ipdltest {
class TestGleanMsgTelemetryParent : public PTestGleanMsgTelemetryParent {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestGleanMsgTelemetryParent, override)
public:
mozilla::ipc::IPCResult RecvHelloSync(bool* aResult);
int mInc = 0;
int mInitialHelloAsyncSent = 0;
int mInitialHelloAsyncReplyRecvd = 0;
int mInitialHelloSyncRecvd = 0;
int mInitialHelloSyncReplySent = 0;
private:
~TestGleanMsgTelemetryParent() = default;
};
} // namespace mozilla::_ipdltest
#endif // mozilla__ipdltest_TestGleanMsgTelemetryParent_h

View file

@ -12,21 +12,17 @@ EXPORTS.mozilla._ipdltest += [
"IPDLUnitTestParent.h",
"TestBasicChild.h",
"TestBasicParent.h",
"TestGleanMsgTelemetryChild.h",
"TestGleanMsgTelemetryParent.h",
]
SOURCES += [
"IPDLUnitTest.cpp",
"TestBasic.cpp",
"TestGleanMsgTelemetry.cpp",
"TestManyHandles.cpp",
]
IPDL_SOURCES += [
"PIPDLUnitTest.ipdl",
"PTestBasic.ipdl",
"PTestGleanMsgTelemetry.ipdl",
"PTestManyHandles.ipdl",
]

View file

@ -72,16 +72,14 @@ struct ProcessingTimeMarker {
namespace mozilla::glean {
#ifdef NIGHTLY_BUILD
// The 3 following static global variables are set within RecordPowerMetrics
// so that RecordThreadCpuUse and RecordIPCSentMessage can avoid computing the
// Glean process type (matching a label of per_process_type_labels).
// The 2 following static global variables are set within RecordPowerMetrics
// so that RecordThreadCpuUse can avoid computing the Glean process type
// (matching a label of per_process_type_labels).
// This is useful because RecordThreadCpuUse will either be called in a loop
// for every thread (recomputing the process type for every thread would be
// expensive), or will be called off main thread when a thread is unregisters
// itself (some APIs needed to compute the process type might not be available
// off main thread).
// RecordIPCSentMessage will also be called off-main-thread when sending an IPC
// message across process boundaries.
// It is fine to call RecordThreadCpuUse during startup before the first
// RecordPowerMetrics call. In that case the parent process will be recorded
// as inactive, and other processes will be ignored (content processes start
@ -89,22 +87,16 @@ namespace mozilla::glean {
using LabeledCounterMetric = const impl::Labeled<impl::CounterMetric>;
static Atomic<LabeledCounterMetric*> gCpuTimePerThreadMetric(nullptr);
static Atomic<LabeledCounterMetric*> gWakeupsPerThreadMetric(nullptr);
static Atomic<LabeledCounterMetric*> gIpcSentMessagesMetric(nullptr);
static Atomic<LabeledCounterMetric*> gIpcReceivedMessagesMetric(nullptr);
// These 2 macros are only meant to reduce code duplication, there is no
// requirement of the 2 variables being set atomically as a single value.
# define SET_PROCESS_TYPE_SPECIFIC_METRICS(aProcessType) \
gCpuTimePerThreadMetric = &power_cpu_ms_per_thread::aProcessType; \
gWakeupsPerThreadMetric = &power_wakeups_per_thread::aProcessType; \
gIpcSentMessagesMetric = &ipc_sent_messages::aProcessType; \
gIpcReceivedMessagesMetric = &ipc_received_messages::aProcessType;
# define SET_PER_THREAD_CPU_METRICS(aProcessType) \
gCpuTimePerThreadMetric = &power_cpu_ms_per_thread::aProcessType; \
gWakeupsPerThreadMetric = &power_wakeups_per_thread::aProcessType;
# define RESET_PROCESS_TYPE_SPECIFIC_METRICS() \
gCpuTimePerThreadMetric = nullptr; \
gWakeupsPerThreadMetric = nullptr; \
gIpcSentMessagesMetric = nullptr; \
gIpcReceivedMessagesMetric = nullptr;
# define RESET_PER_THREAD_CPU_METRICS() \
gCpuTimePerThreadMetric = nullptr; \
gWakeupsPerThreadMetric = nullptr;
void RecordThreadCpuUse(const nsACString& aThreadName, uint64_t aCpuTimeMs,
uint64_t aWakeCount) {
@ -118,7 +110,7 @@ void RecordThreadCpuUse(const nsACString& aThreadName, uint64_t aCpuTimeMs,
if (XRE_IsParentProcess()) {
// The metrics can be null for the parent process during startup,
// and we want to record during that time.
SET_PROCESS_TYPE_SPECIFIC_METRICS(parent_inactive);
SET_PER_THREAD_CPU_METRICS(parent_inactive);
cpuTimeMetric = gCpuTimePerThreadMetric;
wakeupsMetric = gWakeupsPerThreadMetric;
if (!cpuTimeMetric || !wakeupsMetric) {
@ -161,27 +153,9 @@ void RecordThreadCpuUse(const nsACString& aThreadName, uint64_t aCpuTimeMs,
wakeupsMetric->Get(threadName).Add(int32_t(aWakeCount));
}
}
// Implementation is generated by the IPDL compiler.
nsLiteralCString GleanKeyFromIPCMessageType(uint32_t aMessageType);
void RecordIPCSentMessage(uint32_t aMessageType) {
LabeledCounterMetric* metric = gIpcSentMessagesMetric;
if (metric) {
metric->Get(GleanKeyFromIPCMessageType(aMessageType)).Add();
}
}
void RecordIPCReceivedMessage(uint32_t aMessageType) {
LabeledCounterMetric* metric = gIpcReceivedMessagesMetric;
if (metric) {
metric->Get(GleanKeyFromIPCMessageType(aMessageType)).Add();
}
}
#else // ifdef NIGHTLY_BUILD
# define SET_PROCESS_TYPE_SPECIFIC_METRICS(aProcessType)
# define RESET_PROCESS_TYPE_SPECIFIC_METRICS()
# define SET_PER_THREAD_CPU_METRICS(aProcessType)
# define RESET_PER_THREAD_CPU_METRICS()
#endif
void RecordPowerMetrics() {
@ -217,31 +191,31 @@ void RecordPowerMetrics() {
switch (cc->GetProcessPriority()) {
case hal::PROCESS_PRIORITY_BACKGROUND:
type.AppendLiteral(".background");
SET_PROCESS_TYPE_SPECIFIC_METRICS(content_background);
SET_PER_THREAD_CPU_METRICS(content_background);
break;
case hal::PROCESS_PRIORITY_FOREGROUND:
type.AppendLiteral(".foreground");
SET_PROCESS_TYPE_SPECIFIC_METRICS(content_foreground);
SET_PER_THREAD_CPU_METRICS(content_foreground);
break;
case hal::PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE:
type.AppendLiteral(".background-perceivable");
RESET_PROCESS_TYPE_SPECIFIC_METRICS();
RESET_PER_THREAD_CPU_METRICS();
break;
default:
RESET_PROCESS_TYPE_SPECIFIC_METRICS();
RESET_PER_THREAD_CPU_METRICS();
break;
}
}
} else {
RESET_PROCESS_TYPE_SPECIFIC_METRICS();
RESET_PER_THREAD_CPU_METRICS();
}
} else if (XRE_IsParentProcess()) {
if (nsContentUtils::GetUserIsInteracting()) {
type.AssignLiteral("parent.active");
SET_PROCESS_TYPE_SPECIFIC_METRICS(parent_active);
SET_PER_THREAD_CPU_METRICS(parent_active);
} else {
type.AssignLiteral("parent.inactive");
SET_PROCESS_TYPE_SPECIFIC_METRICS(parent_inactive);
SET_PER_THREAD_CPU_METRICS(parent_inactive);
}
hal::WakeLockInformation info;
GetWakeLockInfo(u"video-playing"_ns, &info);
@ -254,9 +228,9 @@ void RecordPowerMetrics() {
}
}
} else if (XRE_IsGPUProcess()) {
SET_PROCESS_TYPE_SPECIFIC_METRICS(gpu_process);
SET_PER_THREAD_CPU_METRICS(gpu_process);
} else {
RESET_PROCESS_TYPE_SPECIFIC_METRICS();
RESET_PER_THREAD_CPU_METRICS();
}
if (newCpuTime) {

View file

@ -92,24 +92,6 @@ void TestTriggerMetrics(uint32_t processType,
*/
void RecordThreadCpuUse(const nsACString& aThreadName, uint64_t aCpuTimeMs,
uint64_t aWakeCount);
/**
* This function records that an IPC message with the given type was sent by
* this process. It is called by the IPC code on the IO thread when an IPC
* message is being sent to another process.
*
* @param aMessageType The type of message which was sent by this process.
*/
void RecordIPCSentMessage(uint32_t aMessageType);
/**
* This function records that an IPC message with the given type was received by
* this process. It is called by the IPC code on the IO thread when an IPC
* message is being received from another process.
*
* @param aMessageType The type of message which was received by this process.
*/
void RecordIPCReceivedMessage(uint32_t aMessageType);
#endif
void RecordPowerMetrics();

View file

@ -19,7 +19,6 @@ gecko_metrics = [
"dom/media/metrics.yaml",
"dom/metrics.yaml",
"gfx/metrics.yaml",
"ipc/ipdl/metrics.yaml",
"netwerk/metrics.yaml",
"netwerk/protocol/http/metrics.yaml",
"toolkit/components/glean/metrics.yaml",

View file

@ -85,9 +85,6 @@ void AvailableMemoryChecker::Shutdown() {
mTimer->Cancel();
}
Preferences::ClearUser("browser.low_commit_space_threshold_percent");
if (nsCOMPtr<nsIObserverService> obsSvc = services::GetObserverService()) {
obsSvc->NotifyObservers(nullptr, "user-interaction-inactive", nullptr);
}
}
// Timer callback to increase the pref threshold.