Bug 1401421 - Remove profiler_get_backtrace_noalloc. r=mstange.

Bug 1385953 removed MemProfiler, which was its only user.

--HG--
extra : rebase_source : 87ecf6aec67f4bf073e08ea5f2b2fa9734451e8c
This commit is contained in:
Nicholas Nethercote 2017-09-20 11:46:26 +10:00
Родитель 37586fa5f5
Коммит c1b8117cfd
2 изменённых файлов: 0 добавлений и 63 удалений

Просмотреть файл

@ -3189,66 +3189,6 @@ ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* aBacktrace)
delete aBacktrace; delete aBacktrace;
} }
// Fill the output buffer with the following pattern:
// "Label 1" "\0" "Label 2" "\0" ... "Label N" "\0" "\0"
// TODO: use the unwinder instead of pseudo stack.
void
profiler_get_backtrace_noalloc(char *output, size_t outputSize)
{
MOZ_RELEASE_ASSERT(CorePS::Exists());
MOZ_ASSERT(outputSize >= 2);
char *bound = output + outputSize - 2;
output[0] = output[1] = '\0';
PSAutoLock lock(gPSMutex);
if (!ActivePS::Exists(lock)) {
return;
}
PseudoStack* pseudoStack = TLSInfo::Stack();
if (!pseudoStack) {
return;
}
bool includeDynamicString = !ActivePS::FeaturePrivacy(lock);
js::ProfileEntry* pseudoEntries = pseudoStack->entries;
uint32_t pseudoCount = pseudoStack->stackSize();
for (uint32_t i = 0; i < pseudoCount; i++) {
const char* label = pseudoEntries[i].label();
const char* dynamicString =
includeDynamicString ? pseudoEntries[i].dynamicString() : nullptr;
size_t labelLength = strlen(label);
if (dynamicString) {
// Put the label, maybe a space, and the dynamic string into output.
size_t spaceLength = label[0] == '\0' ? 0 : 1;
size_t dynamicStringLength = strlen(dynamicString);
if (output + labelLength + spaceLength + dynamicStringLength >= bound) {
break;
}
strcpy(output, label);
output += labelLength;
if (spaceLength != 0) {
*output++ = ' ';
}
strcpy(output, dynamicString);
output += dynamicStringLength;
} else {
// Only put the label into output.
if (output + labelLength >= bound) {
break;
}
strcpy(output, label);
output += labelLength;
}
*output++ = '\0';
*output = '\0';
}
}
static void static void
racy_profiler_add_marker(const char* aMarkerName, racy_profiler_add_marker(const char* aMarkerName,
UniquePtr<ProfilerMarkerPayload> aPayload) UniquePtr<ProfilerMarkerPayload> aPayload)

Просмотреть файл

@ -319,9 +319,6 @@ using UniqueProfilerBacktrace =
// if the profiler is inactive or in privacy mode. // if the profiler is inactive or in privacy mode.
PROFILER_FUNC(UniqueProfilerBacktrace profiler_get_backtrace(), nullptr) PROFILER_FUNC(UniqueProfilerBacktrace profiler_get_backtrace(), nullptr)
PROFILER_FUNC_VOID(profiler_get_backtrace_noalloc(char* aOutput,
size_t aOutputSize))
// Get information about the current buffer status. A no-op when the profiler // Get information about the current buffer status. A no-op when the profiler
// is inactive. Do not call this function; call profiler_get_buffer_info() // is inactive. Do not call this function; call profiler_get_buffer_info()
// instead. // instead.