2012-05-29 15:52:43 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
2011-11-04 21:07:50 +00:00
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2014-11-18 17:50:25 +00:00
|
|
|
%{C++
|
|
|
|
template<class T> class nsTArray;
|
|
|
|
class nsCString;
|
|
|
|
%}
|
|
|
|
|
|
|
|
[ref] native StringArrayRef(const nsTArray<nsCString>);
|
|
|
|
|
2015-06-17 02:28:00 +00:00
|
|
|
[scriptable, uuid(921e1223-b1ea-4906-bb26-a846e6b6835b)]
|
2011-11-04 21:07:50 +00:00
|
|
|
interface nsIProfiler : nsISupports
|
|
|
|
{
|
2013-03-26 16:34:27 +00:00
|
|
|
void StartProfiler(in uint32_t aEntries, in double aInterval,
|
2012-01-12 18:33:32 +00:00
|
|
|
[array, size_is(aFeatureCount)] in string aFeatures,
|
2013-05-16 20:31:50 +00:00
|
|
|
in uint32_t aFeatureCount,
|
|
|
|
[array, size_is(aFilterCount), optional] in string aThreadNameFilters,
|
|
|
|
[optional] in uint32_t aFilterCount);
|
2011-11-04 21:07:50 +00:00
|
|
|
void StopProfiler();
|
2014-02-28 20:16:38 +00:00
|
|
|
boolean IsPaused();
|
|
|
|
void PauseSampling();
|
|
|
|
void ResumeSampling();
|
2012-09-05 13:45:28 +00:00
|
|
|
void AddMarker(in string aMarker);
|
2015-04-25 22:56:03 +00:00
|
|
|
/*
|
|
|
|
* Returns the JSON string of the profile. If aSinceTime is passed, only
|
|
|
|
* report samples taken at >= aSinceTime.
|
|
|
|
*/
|
2015-06-17 02:28:00 +00:00
|
|
|
string GetProfile([optional] in double aSinceTime);
|
2015-04-25 22:56:03 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns a JS object of the profile. If aSinceTime is passed, only report
|
|
|
|
* samples taken at >= aSinceTime.
|
|
|
|
*/
|
2012-02-02 21:57:20 +00:00
|
|
|
[implicit_jscontext]
|
2015-06-17 02:28:00 +00:00
|
|
|
jsval getProfileData([optional] in double aSinceTime);
|
2015-04-25 22:56:03 +00:00
|
|
|
|
2015-06-10 21:58:30 +00:00
|
|
|
[implicit_jscontext]
|
2015-06-17 02:28:00 +00:00
|
|
|
nsISupports getProfileDataAsync([optional] in double aSinceTime);
|
2015-06-10 21:58:30 +00:00
|
|
|
|
2011-12-07 19:48:15 +00:00
|
|
|
boolean IsActive();
|
2012-08-22 15:56:38 +00:00
|
|
|
void GetFeatures(out uint32_t aCount, [retval, array, size_is(aCount)] out string aFeatures);
|
2012-03-09 15:20:00 +00:00
|
|
|
|
2015-04-22 19:36:43 +00:00
|
|
|
void GetBufferInfo(out uint32_t aCurrentPosition, out uint32_t aTotalSize,
|
|
|
|
out uint32_t aGeneration);
|
|
|
|
|
2015-04-25 22:55:56 +00:00
|
|
|
/**
|
2015-06-17 02:28:00 +00:00
|
|
|
* Returns the elapsed time, in milliseconds, since the profiler's epoch.
|
|
|
|
* The epoch is guaranteed to be constant for the duration of the
|
|
|
|
* process, but is otherwise arbitrary.
|
2015-04-25 22:55:56 +00:00
|
|
|
*/
|
2015-06-17 02:28:00 +00:00
|
|
|
double getElapsedTime();
|
2015-04-25 22:55:56 +00:00
|
|
|
|
2012-03-09 15:20:00 +00:00
|
|
|
/**
|
|
|
|
* Returns a JSON string of an array of shared library objects.
|
|
|
|
* Every object has three properties: start, end, and name.
|
|
|
|
* start and end are integers describing the address range that the library
|
|
|
|
* occupies in memory. name is the path of the library as a string.
|
2012-03-12 11:07:05 +00:00
|
|
|
*
|
|
|
|
* On Windows profiling builds, the shared library objects will have
|
|
|
|
* additional pdbSignature and pdbAge properties for uniquely identifying
|
|
|
|
* shared library versions for stack symbolication.
|
2012-03-09 15:20:00 +00:00
|
|
|
*/
|
|
|
|
AString getSharedLibraryInformation();
|
2015-01-15 00:05:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dump the collected profile to a file.
|
|
|
|
*/
|
|
|
|
void dumpProfileToFile(in string aFilename);
|
2011-11-04 21:07:50 +00:00
|
|
|
};
|
|
|
|
|
2014-11-18 17:50:25 +00:00
|
|
|
/**
|
|
|
|
* Start-up parameters for subprocesses are passed through nsIObserverService,
|
|
|
|
* which, unfortunately, means we need to implement nsISupports in order to
|
|
|
|
* go through it.
|
|
|
|
*/
|
|
|
|
[uuid(0a175ba7-8fcf-4ce9-9c4b-ccc6272f4425)]
|
|
|
|
interface nsIProfilerStartParams : nsISupports
|
|
|
|
{
|
|
|
|
attribute uint32_t entries;
|
|
|
|
attribute double interval;
|
|
|
|
|
|
|
|
[noscript, notxpcom, nostdcall] StringArrayRef getFeatures();
|
|
|
|
[noscript, notxpcom, nostdcall] StringArrayRef getThreadFilterNames();
|
|
|
|
};
|