Backed out changeset ad1034334503 (bug 1347274) for conflict merging m-c to m-i

This commit is contained in:
Carsten "Tomcat" Book 2017-05-31 14:18:56 +02:00
parent 928e14c9f8
commit 220eec16b5
3 changed files with 35 additions and 39 deletions

View File

@ -54,10 +54,10 @@ public:
return n;
}
void AddPendingMarker(const char* aMarkerName,
ProfilerMarkerPayload* aPayload, double aTime)
void AddPendingMarker(const char* aMarkerStr, ProfilerMarkerPayload* aPayload,
double aTime)
{
ProfilerMarker* marker = new ProfilerMarker(aMarkerName, aPayload, aTime);
ProfilerMarker* marker = new ProfilerMarker(aMarkerStr, aPayload, aTime);
mPendingMarkers.insert(marker);
}

View File

@ -2850,7 +2850,7 @@ profiler_get_backtrace_noalloc(char *output, size_t outputSize)
}
static void
locked_profiler_add_marker(PSLockRef aLock, const char* aMarkerName,
locked_profiler_add_marker(PSLockRef aLock, const char* aMarker,
ProfilerMarkerPayload* aPayload)
{
// This function runs both on and off the main thread.
@ -2871,12 +2871,12 @@ locked_profiler_add_marker(PSLockRef aLock, const char* aMarkerName,
? payload->GetStartTime()
: mozilla::TimeStamp::Now();
mozilla::TimeDuration delta = origin - CorePS::ProcessStartTime(aLock);
racyInfo->AddPendingMarker(aMarkerName, payload.release(),
racyInfo->AddPendingMarker(aMarker, payload.release(),
delta.ToMilliseconds());
}
void
profiler_add_marker(const char* aMarkerName, ProfilerMarkerPayload* aPayload)
profiler_add_marker(const char* aMarker, ProfilerMarkerPayload* aPayload)
{
// This function runs both on and off the main thread.
@ -2891,12 +2891,11 @@ profiler_add_marker(const char* aMarkerName, ProfilerMarkerPayload* aPayload)
return;
}
locked_profiler_add_marker(lock, aMarkerName, payload.release());
locked_profiler_add_marker(lock, aMarker, payload.release());
}
void
profiler_tracing(const char* aCategory, const char* aMarkerName,
TracingKind aKind)
profiler_tracing(const char* aCategory, const char* aInfo, TracingKind aKind)
{
// This function runs both on and off the main thread.
@ -2908,12 +2907,12 @@ profiler_tracing(const char* aCategory, const char* aMarkerName,
return;
}
auto payload = new ProfilerMarkerTracing(aCategory, aKind);
locked_profiler_add_marker(lock, aMarkerName, payload);
auto marker = new ProfilerMarkerTracing(aCategory, aKind);
locked_profiler_add_marker(lock, aInfo, marker);
}
void
profiler_tracing(const char* aCategory, const char* aMarkerName,
profiler_tracing(const char* aCategory, const char* aInfo,
UniqueProfilerBacktrace aCause, TracingKind aKind)
{
// This function runs both on and off the main thread.
@ -2926,9 +2925,9 @@ profiler_tracing(const char* aCategory, const char* aMarkerName,
return;
}
auto payload =
auto marker =
new ProfilerMarkerTracing(aCategory, aKind, mozilla::Move(aCause));
locked_profiler_add_marker(lock, aMarkerName, payload);
locked_profiler_add_marker(lock, aInfo, marker);
}
void

View File

@ -104,8 +104,8 @@ using UniqueProfilerBacktrace =
// important happening such as the first paint. Unlike profiler_label that are
// only recorded if a sample is collected while it is active, marker will always
// be collected.
#define PROFILER_MARKER(marker_name) do {} while (0)
#define PROFILER_MARKER_PAYLOAD(marker_name, payload) \
#define PROFILER_MARKER(info) do {} while (0)
#define PROFILER_MARKER_PAYLOAD(info, payload) \
do { \
mozilla::UniquePtr<ProfilerMarkerPayload> payloadDeletor(payload); \
} while (0)
@ -143,9 +143,9 @@ using UniqueProfilerBacktrace =
PROFILER_APPEND_LINE_NUMBER(profiler_raii)(name_space "::" info, category, \
__LINE__, str)
#define PROFILER_MARKER(marker_name) profiler_add_marker(marker_name)
#define PROFILER_MARKER_PAYLOAD(marker_name, payload) \
profiler_add_marker(marker_name, payload)
#define PROFILER_MARKER(info) profiler_add_marker(info)
#define PROFILER_MARKER_PAYLOAD(info, payload) \
profiler_add_marker(info, payload)
#endif // defined(MOZ_GECKO_PROFILER)
@ -211,11 +211,9 @@ struct ProfilerFeature
// Adds a tracing marker to the PseudoStack. A no-op if the profiler is
// inactive or in privacy mode.
PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory,
const char* aMarkerName,
PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
TracingKind aKind = TRACING_EVENT))
PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory,
const char* aMarkerName,
PROFILER_FUNC_VOID(profiler_tracing(const char* aCategory, const char* aInfo,
UniqueProfilerBacktrace aCause,
TracingKind aKind = TRACING_EVENT))
@ -449,8 +447,8 @@ profiler_call_exit(void* aHandle)
// Adds a marker to the PseudoStack. A no-op if the profiler is inactive or in
// privacy mode.
void profiler_add_marker(const char* aMarkerName,
ProfilerMarkerPayload* aPayload = nullptr);
void profiler_add_marker(const char *aMarker,
ProfilerMarkerPayload *aPayload = nullptr);
#define PROFILER_APPEND_LINE_NUMBER_PASTE(id, line) id ## line
#define PROFILER_APPEND_LINE_NUMBER_EXPAND(id, line) \
@ -508,12 +506,12 @@ class MOZ_RAII ProfilerStackFrameRAII {
public:
// We only copy the strings at save time, so to take multiple parameters we'd
// need to copy them then.
ProfilerStackFrameRAII(const char *aLabel,
js::ProfileEntry::Category aCategory, uint32_t aLine
ProfilerStackFrameRAII(const char *aInfo,
js::ProfileEntry::Category aCategory, uint32_t line
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
mHandle = profiler_call_enter(aLabel, aCategory, this, aLine);
mHandle = profiler_call_enter(aInfo, aCategory, this, line);
}
~ProfilerStackFrameRAII() {
profiler_call_exit(mHandle);
@ -525,11 +523,11 @@ private:
class MOZ_RAII ProfilerStackFrameDynamicRAII {
public:
ProfilerStackFrameDynamicRAII(const char* aLabel,
ProfilerStackFrameDynamicRAII(const char* aInfo,
js::ProfileEntry::Category aCategory, uint32_t aLine,
const char* aDynamicString)
{
mHandle = profiler_call_enter(aLabel, aCategory, this, aLine,
mHandle = profiler_call_enter(aInfo, aCategory, this, aLine,
aDynamicString);
}
@ -595,34 +593,33 @@ private:
class MOZ_RAII GeckoProfilerTracingRAII {
public:
GeckoProfilerTracingRAII(const char* aCategory, const char* aMarkerName,
GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo,
UniqueProfilerBacktrace aBacktrace
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mCategory(aCategory)
, mMarkerName(aMarkerName)
, mInfo(aInfo)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
profiler_tracing(mCategory, mMarkerName, Move(aBacktrace),
TRACING_INTERVAL_START);
profiler_tracing(mCategory, mInfo, Move(aBacktrace), TRACING_INTERVAL_START);
}
GeckoProfilerTracingRAII(const char* aCategory, const char* aMarkerName
GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mCategory(aCategory)
, mMarkerName(aMarkerName)
, mInfo(aInfo)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
profiler_tracing(mCategory, mMarkerName, TRACING_INTERVAL_START);
profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_START);
}
~GeckoProfilerTracingRAII() {
profiler_tracing(mCategory, mMarkerName, TRACING_INTERVAL_END);
profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_END);
}
protected:
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
const char* mCategory;
const char* mMarkerName;
const char* mInfo;
};
// Convenience class to register and unregister a thread with the profiler.