From 82d5d49ba3107686c88537dcae98e5de46411005 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Wed, 14 Jan 2015 19:05:32 -0500 Subject: [PATCH] Bug 1121591 - Add nsIProfiler.dumpProfileToFile. r=BenWa --- tools/profiler/nsIProfiler.idl | 7 ++++++- tools/profiler/nsProfiler.cpp | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/profiler/nsIProfiler.idl b/tools/profiler/nsIProfiler.idl index f6abd555e746..87f58accc475 100644 --- a/tools/profiler/nsIProfiler.idl +++ b/tools/profiler/nsIProfiler.idl @@ -12,7 +12,7 @@ class nsCString; [ref] native StringArrayRef(const nsTArray); -[scriptable, uuid(f7f3709c-04a9-45c6-8e34-40f762654a78)] +[scriptable, uuid(42d1e0e3-303a-424f-89ea-4f15c699d767)] interface nsIProfiler : nsISupports { void StartProfiler(in uint32_t aEntries, in double aInterval, @@ -42,6 +42,11 @@ interface nsIProfiler : nsISupports * shared library versions for stack symbolication. */ AString getSharedLibraryInformation(); + + /** + * Dump the collected profile to a file. + */ + void dumpProfileToFile(in string aFilename); }; /** diff --git a/tools/profiler/nsProfiler.cpp b/tools/profiler/nsProfiler.cpp index e92bc0dca65f..694d3f0e395b 100644 --- a/tools/profiler/nsProfiler.cpp +++ b/tools/profiler/nsProfiler.cpp @@ -194,6 +194,13 @@ nsProfiler::GetSharedLibraryInformation(nsAString& aOutString) return NS_OK; } +NS_IMETHODIMP +nsProfiler::DumpProfileToFile(const char* aFilename) +{ + profiler_save_profile_to_file(aFilename); + return NS_OK; +} + NS_IMETHODIMP nsProfiler::GetProfileData(JSContext* aCx, JS::MutableHandle aResult) {