Skip to content

Commit

Permalink
Bug 1460973 - Set the thread register time of the Java thread to the …
Browse files Browse the repository at this point in the history
…process creation time. r=gregtatum

MozReview-Commit-ID: KcuFPACYRHZ

--HG--
extra : rebase_source : 98cd39fee422dedf25a47e431ad5750dc97c4c8b
  • Loading branch information
mstange committed May 25, 2018
1 parent 3006bdf commit 5b54089
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tools/profiler/core/ThreadInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class ThreadInfo final
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ThreadInfo)

ThreadInfo(const char* aName, int aThreadId, bool aIsMainThread)
ThreadInfo(const char* aName, int aThreadId, bool aIsMainThread,
const mozilla::TimeStamp& aRegisterTime = mozilla::TimeStamp::Now())
: mName(aName)
, mRegisterTime(TimeStamp::Now())
, mRegisterTime(aRegisterTime)
, mThreadId(aThreadId)
, mIsMainThread(aIsMainThread)
{
Expand Down
2 changes: 1 addition & 1 deletion tools/profiler/core/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ locked_profiler_stream_json_for_this_process(PSLockRef aLock,
// Thread id of java Main thread is 0, if we support profiling of other
// java thread, we have to get thread id and name via JNI.
RefPtr<ThreadInfo> threadInfo =
new ThreadInfo("Java Main Thread", 0, false);
new ThreadInfo("Java Main Thread", 0, false, CorePS::ProcessStartTime());
ProfiledThreadData profiledThreadData(threadInfo, nullptr,
ActivePS::FeatureResponsiveness(aLock));
profiledThreadData.StreamJSON(*javaBuffer.get(), nullptr, aWriter,
Expand Down

0 comments on commit 5b54089

Please sign in to comment.