Skip to content

Commit 64c8533

Browse files
author
Butkovits Atila
committed
Backed out 7 changesets (bug 1746361, bug 1748280, bug 1746347) for causing failures at browser_interaction-between-interfaces.js. CLOSED TREE
Backed out changeset eccba94506f0 (bug 1748280) Backed out changeset baf39ae53772 (bug 1748280) Backed out changeset 775843562f7e (bug 1748280) Backed out changeset 0987c68e9683 (bug 1748280) Backed out changeset 58dd008520da (bug 1746361) Backed out changeset 6f9e800877a6 (bug 1746347) Backed out changeset f78e794a9c2f (bug 1746347)
1 parent 85d7b8b commit 64c8533

File tree

11 files changed

+82
-544
lines changed

11 files changed

+82
-544
lines changed

devtools/client/performance-new/popup/background.jsm.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,35 +180,33 @@ const presets = {
180180
media: {
181181
entries: 128 * 1024 * 1024,
182182
interval: 1,
183-
features: [
184-
"js",
185-
"leaf",
186-
"stackwalk",
187-
"cpu",
188-
"audiocallbacktracing",
189-
"ipcmessages",
190-
],
183+
features: ["js", "leaf", "stackwalk", "cpu", "audiocallbacktracing"],
191184
threads: [
192-
"cubeb",
193-
"audio",
194-
"camera",
195-
"capture",
185+
"AsyncCubebTask",
186+
"AudioEncoderQueue",
187+
"AudioIPC",
188+
"call_worker_queue",
196189
"Compositor",
190+
"DecodingThread",
197191
"GeckoMain",
198-
"gmp",
199-
"graph",
200-
"grph",
192+
"GraphRunner",
193+
"IncomingVideoStream",
201194
"InotifyEventThread",
202-
"IPDL Background",
203-
"media",
195+
"libwebrtcModuleThread",
196+
"MediaDecoderStateMachine",
197+
"MediaPDecoder",
198+
"MediaSupervisor",
199+
"MediaTimer",
204200
"ModuleProcessThread",
201+
"NativeAudioCallback",
205202
"PacerThread",
206203
"RemVidChild",
207204
"RenderBackend",
208205
"Renderer",
209206
"Socket Thread",
210207
"SwComposite",
211-
"webrtc",
208+
"VoiceProcessThread",
209+
"WebrtcWorker",
212210
],
213211
duration: 0,
214212
l10nIds: {

dom/media/webrtc/libwebrtcglue/TaskQueueWrapper.h

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "api/task_queue/task_queue_factory.h"
1010
#include "mozilla/DataMutex.h"
11-
#include "mozilla/ProfilerRunnable.h"
1211
#include "mozilla/TaskQueue.h"
1312
#include "VideoUtils.h"
1413

@@ -26,8 +25,8 @@ namespace mozilla {
2625
*/
2726
class TaskQueueWrapper : public webrtc::TaskQueueBase {
2827
public:
29-
TaskQueueWrapper(RefPtr<TaskQueue> aTaskQueue, nsCString aName)
30-
: mTaskQueue(std::move(aTaskQueue)), mName(std::move(aName)) {}
28+
explicit TaskQueueWrapper(RefPtr<TaskQueue> aTaskQueue)
29+
: mTaskQueue(std::move(aTaskQueue)) {}
3130
~TaskQueueWrapper() = default;
3231

3332
void Delete() override {
@@ -45,22 +44,18 @@ class TaskQueueWrapper : public webrtc::TaskQueueBase {
4544

4645
already_AddRefed<Runnable> CreateTaskRunner(
4746
std::unique_ptr<webrtc::QueuedTask> aTask) {
48-
return NS_NewRunnableFunction(
49-
"TaskQueueWrapper::CreateTaskRunner",
50-
[this, task = std::move(aTask),
51-
name = nsPrintfCString("TQ %s: webrtc::QueuedTask",
52-
mName.get())]() mutable {
53-
CurrentTaskQueueSetter current(this);
54-
auto hasShutdown = mHasShutdown.Lock();
55-
if (*hasShutdown) {
56-
return;
57-
}
58-
AUTO_PROFILE_FOLLOWING_RUNNABLE(name);
59-
bool toDelete = task->Run();
60-
if (!toDelete) {
61-
task.release();
62-
}
63-
});
47+
return NS_NewRunnableFunction("TaskQueueWrapper::CreateTaskRunner",
48+
[this, task = std::move(aTask)]() mutable {
49+
CurrentTaskQueueSetter current(this);
50+
auto hasShutdown = mHasShutdown.Lock();
51+
if (*hasShutdown) {
52+
return;
53+
}
54+
bool toDelete = task->Run();
55+
if (!toDelete) {
56+
task.release();
57+
}
58+
});
6459
}
6560

6661
already_AddRefed<Runnable> CreateTaskRunner(nsCOMPtr<nsIRunnable> aRunnable) {
@@ -72,7 +67,6 @@ class TaskQueueWrapper : public webrtc::TaskQueueBase {
7267
if (*hasShutdown) {
7368
return;
7469
}
75-
AUTO_PROFILE_FOLLOWING_RUNNABLE(runnable);
7670
runnable->Run();
7771
});
7872
}
@@ -94,7 +88,6 @@ class TaskQueueWrapper : public webrtc::TaskQueueBase {
9488
}
9589

9690
const RefPtr<TaskQueue> mTaskQueue;
97-
const nsCString mName;
9891

9992
// This is a recursive mutex because a TaskRunner holding this mutex while
10093
// running its runnable may end up running other - tail dispatched - runnables
@@ -126,7 +119,7 @@ class SharedThreadPoolWebRtcTaskQueueFactory : public webrtc::TaskQueueFactory {
126119
nsCString name(aName.data(), aName.size());
127120
auto taskQueue = MakeRefPtr<TaskQueue>(GetMediaThreadPool(aThreadType),
128121
name.get(), aSupportTailDispatch);
129-
return MakeUnique<TaskQueueWrapper>(std::move(taskQueue), std::move(name));
122+
return MakeUnique<TaskQueueWrapper>(std::move(taskQueue));
130123
}
131124

132125
std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter>

media/webrtc/signaling/gtest/mediapipeline_unittest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ namespace {
5252
class MainAsCurrent : public TaskQueueWrapper {
5353
public:
5454
MainAsCurrent()
55-
: TaskQueueWrapper(
56-
MakeRefPtr<TaskQueue>(do_AddRef(GetMainThreadEventTarget()),
57-
"MainAsCurrentTaskQueue"),
58-
"MainAsCurrent"_ns),
55+
: TaskQueueWrapper(MakeRefPtr<TaskQueue>(
56+
do_AddRef(GetMainThreadEventTarget()), "MainAsCurrentTaskQueue")),
5957
mSetter(this) {
6058
MOZ_RELEASE_ASSERT(NS_IsMainThread());
6159
}

mozglue/baseprofiler/public/ProfileBufferEntrySerialization.h

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -994,22 +994,9 @@ struct ProfileBufferEntryWriter::Serializer<std::tuple<Ts...>> {
994994

995995
template <typename... Ts>
996996
struct ProfileBufferEntryReader::Deserializer<std::tuple<Ts...>> {
997-
template <size_t I>
998-
static void TupleIReadInto(ProfileBufferEntryReader& aER,
999-
std::tuple<Ts...>& aTuple) {
1000-
aER.ReadIntoObject(std::get<I>(aTuple));
1001-
}
1002-
1003-
template <size_t... Is>
1004-
static void TupleReadInto(ProfileBufferEntryReader& aER,
1005-
std::tuple<Ts...>& aTuple,
1006-
std::index_sequence<Is...>) {
1007-
(TupleIReadInto<Is>(aER, aTuple), ...);
1008-
}
1009-
1010997
static void ReadInto(ProfileBufferEntryReader& aER,
1011998
std::tuple<Ts...>& aTuple) {
1012-
TupleReadInto(aER, aTuple, std::index_sequence_for<Ts...>());
999+
aER.ReadBytes(&aTuple, Bytes(aTuple));
10131000
}
10141001

10151002
static std::tuple<Ts...> Read(ProfileBufferEntryReader& aER) {
@@ -1068,20 +1055,8 @@ struct ProfileBufferEntryWriter::Serializer<Tuple<Ts...>> {
10681055

10691056
template <typename... Ts>
10701057
struct ProfileBufferEntryReader::Deserializer<Tuple<Ts...>> {
1071-
template <size_t I>
1072-
static void TupleIReadInto(ProfileBufferEntryReader& aER,
1073-
Tuple<Ts...>& aTuple) {
1074-
aER.ReadIntoObject(Get<I>(aTuple));
1075-
}
1076-
1077-
template <size_t... Is>
1078-
static void TupleReadInto(ProfileBufferEntryReader& aER, Tuple<Ts...>& aTuple,
1079-
std::index_sequence<Is...>) {
1080-
(TupleIReadInto<Is>(aER, aTuple), ...);
1081-
}
1082-
10831058
static void ReadInto(ProfileBufferEntryReader& aER, Tuple<Ts...>& aTuple) {
1084-
TupleReadInto(aER, aTuple, std::index_sequence_for<Ts...>());
1059+
aER.ReadBytes(&aTuple, Bytes(aTuple));
10851060
}
10861061

10871062
static Tuple<Ts...> Read(ProfileBufferEntryReader& aER) {

tools/profiler/core/MicroGeckoProfiler.cpp

Lines changed: 18 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
#include "GeckoProfiler.h"
66

7-
#include "mozilla/Maybe.h"
8-
#include "nsPrintfCString.h"
9-
#include "public/GeckoTraceEvent.h"
10-
117
using namespace mozilla;
12-
using webrtc::trace_event_internal::TraceValueUnion;
138

149
void uprofiler_register_thread(const char* name, void* stacktop) {
1510
#ifdef MOZ_GECKO_PROFILER
@@ -23,177 +18,30 @@ void uprofiler_unregister_thread() {
2318
#endif // MOZ_GECKO_PROFILER
2419
}
2520

21+
// The category string will be handled later in Bug 1715047
22+
void uprofiler_simple_event_marker(const char* name, const char*, char phase) {
2623
#ifdef MOZ_GECKO_PROFILER
27-
namespace {
28-
Maybe<MarkerTiming> ToTiming(char phase) {
2924
switch (phase) {
3025
case 'B':
31-
return Some(MarkerTiming::IntervalStart());
26+
profiler_add_marker(ProfilerString8View::WrapNullTerminatedString(name),
27+
geckoprofiler::category::MEDIA_RT,
28+
{MarkerTiming::IntervalStart()});
29+
break;
3230
case 'E':
33-
return Some(MarkerTiming::IntervalEnd());
31+
profiler_add_marker(ProfilerString8View::WrapNullTerminatedString(name),
32+
geckoprofiler::category::MEDIA_RT,
33+
{MarkerTiming::IntervalEnd()});
34+
break;
3435
case 'I':
35-
return Some(MarkerTiming::InstantNow());
36+
profiler_add_marker(ProfilerString8View::WrapNullTerminatedString(name),
37+
geckoprofiler::category::MEDIA_RT,
38+
{MarkerTiming::InstantNow()});
39+
break;
3640
default:
37-
return Nothing();
38-
}
39-
}
40-
41-
struct TraceOption {
42-
bool mPassed = false;
43-
ProfilerString8View mName;
44-
Variant<int64_t, bool, double, ProfilerString8View> mValue = AsVariant(false);
45-
};
46-
47-
struct TraceMarker {
48-
static constexpr int MAX_NUM_ARGS = 2;
49-
using OptionsType = std::tuple<TraceOption, TraceOption>;
50-
static constexpr mozilla::Span<const char> MarkerTypeName() {
51-
return MakeStringSpan("TraceEvent");
52-
}
53-
static void StreamJSONMarkerData(
54-
mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
55-
const OptionsType& aArgs) {
56-
auto writeValue = [&](const auto& aName, const auto& aVariant) {
57-
aVariant.match(
58-
[&](const int64_t& aValue) { aWriter.IntProperty(aName, aValue); },
59-
[&](const bool& aValue) { aWriter.BoolProperty(aName, aValue); },
60-
[&](const double& aValue) { aWriter.DoubleProperty(aName, aValue); },
61-
[&](const ProfilerString8View& aValue) {
62-
aWriter.StringProperty(aName, aValue);
63-
});
64-
};
65-
if (const auto& arg = std::get<0>(aArgs); arg.mPassed) {
66-
aWriter.StringProperty("name1", arg.mName);
67-
writeValue("val1", arg.mValue);
68-
}
69-
if (const auto& arg = std::get<1>(aArgs); arg.mPassed) {
70-
aWriter.StringProperty("name2", arg.mName);
71-
writeValue("val2", arg.mValue);
72-
}
73-
}
74-
static mozilla::MarkerSchema MarkerTypeDisplay() {
75-
using MS = MarkerSchema;
76-
MS schema{MS::Location::MarkerChart, MS::Location::MarkerTable};
77-
schema.SetChartLabel("{marker.name}");
78-
schema.SetTableLabel(
79-
"{marker.name} {marker.data.name1} {marker.data.val1} "
80-
"{marker.data.name2} {marker.data.val2}");
81-
schema.AddKeyLabelFormat("name1", "Key 1", MS::Format::String);
82-
schema.AddKeyLabelFormat("val1", "Value 1", MS::Format::String);
83-
schema.AddKeyLabelFormat("name2", "Key 2", MS::Format::String);
84-
schema.AddKeyLabelFormat("val2", "Value 2", MS::Format::String);
85-
return schema;
86-
}
87-
};
88-
} // namespace
89-
90-
namespace mozilla {
91-
template <>
92-
struct ProfileBufferEntryWriter::Serializer<TraceOption> {
93-
static Length Bytes(const TraceOption& aOption) {
94-
// 1 byte to store passed flag, then object size if passed.
95-
return aOption.mPassed ? (1 + SumBytes(aOption.mName, aOption.mValue)) : 1;
96-
}
97-
98-
static void Write(ProfileBufferEntryWriter& aEW, const TraceOption& aOption) {
99-
// 'T'/'t' is just an arbitrary 1-byte value to distinguish states.
100-
if (aOption.mPassed) {
101-
aEW.WriteObject<char>('T');
102-
// Use the Serializer for the name/value pair.
103-
aEW.WriteObject(aOption.mName);
104-
aEW.WriteObject(aOption.mValue);
105-
} else {
106-
aEW.WriteObject<char>('t');
107-
}
108-
}
109-
};
110-
111-
template <>
112-
struct ProfileBufferEntryReader::Deserializer<TraceOption> {
113-
static void ReadInto(ProfileBufferEntryReader& aER, TraceOption& aOption) {
114-
char c = aER.ReadObject<char>();
115-
if ((aOption.mPassed = (c == 'T'))) {
116-
aER.ReadIntoObject(aOption.mName);
117-
aER.ReadIntoObject(aOption.mValue);
118-
} else {
119-
MOZ_ASSERT(c == 't');
120-
}
121-
}
122-
123-
static TraceOption Read(ProfileBufferEntryReader& aER) {
124-
TraceOption option;
125-
ReadInto(aER, option);
126-
return option;
127-
}
128-
};
129-
} // namespace mozilla
130-
#endif // MOZ_GECKO_PROFILER
131-
132-
void uprofiler_simple_event_marker(const char* name, char phase, int num_args,
133-
const char** arg_names,
134-
const unsigned char* arg_types,
135-
const unsigned long long* arg_values) {
136-
#ifdef MOZ_GECKO_PROFILER
137-
if (!profiler_thread_is_being_profiled_for_markers()) {
138-
return;
139-
}
140-
Maybe<MarkerTiming> timing = ToTiming(phase);
141-
if (!timing) {
142-
if (getenv("MOZ_LOG_UNKNOWN_TRACE_EVENT_PHASES")) {
143-
fprintf(stderr, "XXX UProfiler: phase not handled: '%c'\n", phase);
144-
}
145-
return;
146-
}
147-
MOZ_ASSERT(num_args <= TraceMarker::MAX_NUM_ARGS);
148-
TraceMarker::OptionsType tuple;
149-
TraceOption* args[2] = {&std::get<0>(tuple), &std::get<1>(tuple)};
150-
for (int i = 0; i < std::min(num_args, TraceMarker::MAX_NUM_ARGS); ++i) {
151-
auto& arg = *args[i];
152-
arg.mPassed = true;
153-
arg.mName = ProfilerString8View::WrapNullTerminatedString(arg_names[i]);
154-
switch (arg_types[i]) {
155-
case TRACE_VALUE_TYPE_UINT:
156-
MOZ_ASSERT(arg_values[i] <= std::numeric_limits<int64_t>::max());
157-
arg.mValue = AsVariant(static_cast<int64_t>(
158-
reinterpret_cast<const TraceValueUnion*>(&arg_values[i])->as_uint));
159-
break;
160-
case TRACE_VALUE_TYPE_INT:
161-
arg.mValue = AsVariant(static_cast<int64_t>(
162-
reinterpret_cast<const TraceValueUnion*>(&arg_values[i])->as_int));
163-
break;
164-
case TRACE_VALUE_TYPE_BOOL:
165-
arg.mValue = AsVariant(
166-
reinterpret_cast<const TraceValueUnion*>(&arg_values[i])->as_bool);
167-
break;
168-
case TRACE_VALUE_TYPE_DOUBLE:
169-
arg.mValue =
170-
AsVariant(reinterpret_cast<const TraceValueUnion*>(&arg_values[i])
171-
->as_double);
172-
break;
173-
case TRACE_VALUE_TYPE_POINTER:
174-
arg.mValue = AsVariant(ProfilerString8View(nsPrintfCString(
175-
"%p", reinterpret_cast<const TraceValueUnion*>(&arg_values[i])
176-
->as_pointer)));
177-
break;
178-
case TRACE_VALUE_TYPE_STRING:
179-
arg.mValue = AsVariant(ProfilerString8View::WrapNullTerminatedString(
180-
reinterpret_cast<const TraceValueUnion*>(&arg_values[i])
181-
->as_string));
182-
break;
183-
case TRACE_VALUE_TYPE_COPY_STRING:
184-
arg.mValue = AsVariant(ProfilerString8View(
185-
nsCString(reinterpret_cast<const TraceValueUnion*>(&arg_values[i])
186-
->as_string)));
187-
break;
188-
default:
189-
MOZ_ASSERT_UNREACHABLE("Unexpected trace value type");
190-
arg.mValue = AsVariant(ProfilerString8View(
191-
nsPrintfCString("Unexpected type: %u", arg_types[i])));
192-
break;
193-
}
41+
if (getenv("MOZ_LOG_UNKNOWN_TRACE_EVENT_PHASES")) {
42+
fprintf(stderr, "XXX UProfiler: phase not handled: '%c'\n", phase);
43+
}
44+
break;
19445
}
195-
profiler_add_marker(ProfilerString8View::WrapNullTerminatedString(name),
196-
geckoprofiler::category::MEDIA_RT, {timing.extract()},
197-
TraceMarker{}, tuple);
19846
#endif // MOZ_GECKO_PROFILER
19947
}

0 commit comments

Comments
 (0)