mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 1332577 (part 8) - Rename moz_profiler_*() as profiler_*(). r=mstange.
This makes them consistent with other profiler functions. --HG-- extra : rebase_source : bfdd878f4ca9cab50f0fa769b3cd1a4cdae18575
This commit is contained in:
parent
12647a7223
commit
47ba5aca68
@ -289,14 +289,14 @@ void ProfilerMarker::StreamJSON(SpliceableJSONWriter& aWriter,
|
||||
// Verbosity control for the profiler. The aim is to check env var
|
||||
// MOZ_PROFILER_VERBOSE only once. However, we may need to temporarily
|
||||
// override that so as to print the profiler's help message. That's
|
||||
// what moz_profiler_set_verbosity is for.
|
||||
// what profiler_set_verbosity is for.
|
||||
|
||||
enum class ProfilerVerbosity : int8_t { UNCHECKED, NOTVERBOSE, VERBOSE };
|
||||
|
||||
// Raced on, potentially
|
||||
static ProfilerVerbosity profiler_verbosity = ProfilerVerbosity::UNCHECKED;
|
||||
|
||||
bool moz_profiler_verbose()
|
||||
bool profiler_verbose()
|
||||
{
|
||||
if (profiler_verbosity == ProfilerVerbosity::UNCHECKED) {
|
||||
if (getenv("MOZ_PROFILER_VERBOSE") != nullptr)
|
||||
@ -308,7 +308,7 @@ bool moz_profiler_verbose()
|
||||
return profiler_verbosity == ProfilerVerbosity::VERBOSE;
|
||||
}
|
||||
|
||||
void moz_profiler_set_verbosity(ProfilerVerbosity pv)
|
||||
void profiler_set_verbosity(ProfilerVerbosity pv)
|
||||
{
|
||||
MOZ_ASSERT(pv == ProfilerVerbosity::UNCHECKED ||
|
||||
pv == ProfilerVerbosity::VERBOSE);
|
||||
@ -380,11 +380,11 @@ void read_profiler_env_vars()
|
||||
|
||||
if (getenv(PROFILER_HELP)) {
|
||||
// Enable verbose output
|
||||
moz_profiler_set_verbosity(ProfilerVerbosity::VERBOSE);
|
||||
profiler_set_verbosity(ProfilerVerbosity::VERBOSE);
|
||||
profiler_usage();
|
||||
// Now force the next enquiry of moz_profiler_verbose to re-query
|
||||
// Now force the next enquiry of profiler_verbose to re-query
|
||||
// env var MOZ_PROFILER_VERBOSE.
|
||||
moz_profiler_set_verbosity(ProfilerVerbosity::UNCHECKED);
|
||||
profiler_set_verbosity(ProfilerVerbosity::UNCHECKED);
|
||||
}
|
||||
|
||||
if (!set_profiler_interval(interval) ||
|
||||
|
@ -76,7 +76,7 @@ static inline pid_t gettid()
|
||||
|
||||
#define ASSERT(a) MOZ_ASSERT(a)
|
||||
|
||||
bool moz_profiler_verbose();
|
||||
bool profiler_verbose();
|
||||
|
||||
#ifdef ANDROID
|
||||
# if defined(__arm__) || defined(__thumb__)
|
||||
@ -84,22 +84,22 @@ bool moz_profiler_verbose();
|
||||
# define ENABLE_ARM_LR_SAVING
|
||||
# endif
|
||||
# define LOG(text) \
|
||||
do { if (moz_profiler_verbose()) \
|
||||
do { if (profiler_verbose()) \
|
||||
__android_log_write(ANDROID_LOG_ERROR, "Profiler", text); \
|
||||
} while (0)
|
||||
# define LOGF(format, ...) \
|
||||
do { if (moz_profiler_verbose()) \
|
||||
do { if (profiler_verbose()) \
|
||||
__android_log_print(ANDROID_LOG_ERROR, "Profiler", format, \
|
||||
__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
# define LOG(text) \
|
||||
do { if (moz_profiler_verbose()) fprintf(stderr, "Profiler: %s\n", text); \
|
||||
do { if (profiler_verbose()) fprintf(stderr, "Profiler: %s\n", text); \
|
||||
} while (0)
|
||||
# define LOGF(format, ...) \
|
||||
do { if (moz_profiler_verbose()) fprintf(stderr, "Profiler: " format \
|
||||
"\n", __VA_ARGS__); \
|
||||
do { if (profiler_verbose()) fprintf(stderr, "Profiler: " format "\n", \
|
||||
__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user