mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1145306 - Expose circular buffer status from profiler. r=mstange
This commit is contained in:
parent
8b8cefca95
commit
4f249d633d
@ -170,6 +170,22 @@ static inline void profiler_save_profile_to_file(char* aFilename) { }
|
||||
// Returns a null terminated char* array.
|
||||
static inline char** profiler_get_features() { return nullptr; }
|
||||
|
||||
// Get information about the current buffer status.
|
||||
// Retursn (using outparams) the current write position in the buffer,
|
||||
// the total size of the buffer, and the generation of the buffer.
|
||||
// This information may be useful to a user-interface displaying the
|
||||
// current status of the profiler, allowing the user to get a sense
|
||||
// for how fast the buffer is being written to, and how much
|
||||
// data is visible.
|
||||
static inline void profiler_get_buffer_info(uint32_t *aCurrentPosition,
|
||||
uint32_t *aTotalSize,
|
||||
uint32_t *aGeneration)
|
||||
{
|
||||
*aCurrentPosition = 0;
|
||||
*aTotalSize = 0;
|
||||
*aGeneration = 0;
|
||||
}
|
||||
|
||||
// Discard the profile, throw away the profile and notify 'profiler-locked'.
|
||||
// This function is to be used when entering private browsing to prevent
|
||||
// the profiler from collecting sensitive data.
|
||||
|
@ -65,6 +65,9 @@ extern "C" {
|
||||
|
||||
const char** mozilla_sampler_get_features();
|
||||
|
||||
void mozilla_sampler_get_buffer_info(uint32_t *aCurrentPosition, uint32_t *aTotalSize,
|
||||
uint32_t *aGeneration);
|
||||
|
||||
void mozilla_sampler_init(void* stackTop);
|
||||
|
||||
void mozilla_sampler_shutdown();
|
||||
|
@ -167,6 +167,13 @@ const char** profiler_get_features()
|
||||
return mozilla_sampler_get_features();
|
||||
}
|
||||
|
||||
static inline
|
||||
void profiler_get_buffer_info(uint32_t *aCurrentPosition, uint32_t *aTotalSize,
|
||||
uint32_t *aGeneration)
|
||||
{
|
||||
return mozilla_sampler_get_buffer_info(aCurrentPosition, aTotalSize, aGeneration);
|
||||
}
|
||||
|
||||
static inline
|
||||
void profiler_lock()
|
||||
{
|
||||
|
@ -1079,3 +1079,11 @@ SyncProfile* TableTicker::GetBacktrace()
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
void
|
||||
TableTicker::GetBufferInfo(uint32_t *aCurrentPosition, uint32_t *aTotalSize, uint32_t *aGeneration)
|
||||
{
|
||||
*aCurrentPosition = mBuffer->mWritePos;
|
||||
*aTotalSize = mBuffer->mEntrySize;
|
||||
*aGeneration = mBuffer->mGeneration;
|
||||
}
|
||||
|
@ -210,6 +210,8 @@ class TableTicker: public Sampler {
|
||||
bool DisplayListDump() const { return mDisplayListDump; }
|
||||
bool ProfileRestyle() const { return mProfileRestyle; }
|
||||
|
||||
void GetBufferInfo(uint32_t *aCurrentPosition, uint32_t *aTotalSize, uint32_t *aGeneration);
|
||||
|
||||
protected:
|
||||
// Called within a signal. This function must be reentrant
|
||||
virtual void InplaceTick(TickSample* sample);
|
||||
|
@ -12,7 +12,7 @@ class nsCString;
|
||||
|
||||
[ref] native StringArrayRef(const nsTArray<nsCString>);
|
||||
|
||||
[scriptable, uuid(42d1e0e3-303a-424f-89ea-4f15c699d767)]
|
||||
[scriptable, uuid(edd65f3f-c2a2-4217-a2e2-40347ba4a2b3)]
|
||||
interface nsIProfiler : nsISupports
|
||||
{
|
||||
void StartProfiler(in uint32_t aEntries, in double aInterval,
|
||||
@ -31,6 +31,9 @@ interface nsIProfiler : nsISupports
|
||||
boolean IsActive();
|
||||
void GetFeatures(out uint32_t aCount, [retval, array, size_is(aCount)] out string aFeatures);
|
||||
|
||||
void GetBufferInfo(out uint32_t aCurrentPosition, out uint32_t aTotalSize,
|
||||
out uint32_t aGeneration);
|
||||
|
||||
/**
|
||||
* Returns a JSON string of an array of shared library objects.
|
||||
* Every object has three properties: start, end, and name.
|
||||
|
@ -248,3 +248,13 @@ nsProfiler::GetFeatures(uint32_t *aCount, char ***aFeatures)
|
||||
*aCount = len;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProfiler::GetBufferInfo(uint32_t *aCurrentPosition, uint32_t *aTotalSize, uint32_t *aGeneration)
|
||||
{
|
||||
MOZ_ASSERT(aCurrentPosition);
|
||||
MOZ_ASSERT(aTotalSize);
|
||||
MOZ_ASSERT(aGeneration);
|
||||
profiler_get_buffer_info(aCurrentPosition, aTotalSize, aGeneration);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -650,6 +650,23 @@ const char** mozilla_sampler_get_features()
|
||||
return features;
|
||||
}
|
||||
|
||||
void mozilla_sampler_get_buffer_info(uint32_t *aCurrentPosition, uint32_t *aTotalSize,
|
||||
uint32_t *aGeneration)
|
||||
{
|
||||
*aCurrentPosition = 0;
|
||||
*aTotalSize = 0;
|
||||
*aGeneration = 0;
|
||||
|
||||
if (!stack_key_initialized)
|
||||
return;
|
||||
|
||||
TableTicker *t = tlsTicker.get();
|
||||
if (!t)
|
||||
return;
|
||||
|
||||
t->GetBufferInfo(aCurrentPosition, aTotalSize, aGeneration);
|
||||
}
|
||||
|
||||
// Values are only honored on the first start
|
||||
void mozilla_sampler_start(int aProfileEntries, double aInterval,
|
||||
const char** aFeatures, uint32_t aFeatureCount,
|
||||
|
Loading…
Reference in New Issue
Block a user