зеркало из https://github.com/mozilla/gecko-dev.git
Bug 698002 - Initialize pthread keys on sps startup. r=jrmuizel
--HG-- extra : rebase_source : 226f0ec8cd0c79ebaa1f00eba643ad0e28f240e5
This commit is contained in:
Родитель
58cbcf2f52
Коммит
139318225c
|
@ -292,11 +292,6 @@ void ProfileEntry::WriteTag(Profile *profile, FILE *stream)
|
||||||
#define PROFILE_DEFAULT_ENTRY 100000
|
#define PROFILE_DEFAULT_ENTRY 100000
|
||||||
void mozilla_sampler_init()
|
void mozilla_sampler_init()
|
||||||
{
|
{
|
||||||
const char *val = PR_GetEnv("MOZ_PROFILER_SPS");
|
|
||||||
if (!val || !*val) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO linux port: Use TLS with ifdefs
|
// TODO linux port: Use TLS with ifdefs
|
||||||
// TODO window port: See bug 683229 comment 15
|
// TODO window port: See bug 683229 comment 15
|
||||||
// profiler uses getspecific because TLS is not supported on android.
|
// profiler uses getspecific because TLS is not supported on android.
|
||||||
|
@ -308,6 +303,11 @@ void mozilla_sampler_init()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *val = PR_GetEnv("MOZ_PROFILER_SPS");
|
||||||
|
if (!val || !*val) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TableTicker *t = new TableTicker(PROFILE_DEFAULT_ENTRY, 10);
|
TableTicker *t = new TableTicker(PROFILE_DEFAULT_ENTRY, 10);
|
||||||
pthread_setspecific(pkey_ticker, t);
|
pthread_setspecific(pkey_ticker, t);
|
||||||
pthread_setspecific(pkey_stack, t->GetStack());
|
pthread_setspecific(pkey_stack, t->GetStack());
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
// TODO Merge into Sampler.h
|
// TODO Merge into Sampler.h
|
||||||
|
|
||||||
extern pthread_key_t pkey_stack;
|
extern pthread_key_t pkey_stack;
|
||||||
extern pthread_key_t pkey_ticker;
|
|
||||||
|
|
||||||
#define SAMPLER_INIT() mozilla_sampler_init();
|
#define SAMPLER_INIT() mozilla_sampler_init();
|
||||||
#define SAMPLER_DEINIT() mozilla_sampler_deinit();
|
#define SAMPLER_DEINIT() mozilla_sampler_deinit();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче