diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index b3f8a2aa3d61..2ff23bf2e721 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -3189,66 +3189,6 @@ ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* 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 racy_profiler_add_marker(const char* aMarkerName, UniquePtr aPayload) diff --git a/tools/profiler/public/GeckoProfiler.h b/tools/profiler/public/GeckoProfiler.h index c343ca450367..df6a9050641b 100644 --- a/tools/profiler/public/GeckoProfiler.h +++ b/tools/profiler/public/GeckoProfiler.h @@ -319,9 +319,6 @@ using UniqueProfilerBacktrace = // if the profiler is inactive or in privacy mode. 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 // is inactive. Do not call this function; call profiler_get_buffer_info() // instead.