Closed Bug 769989 Opened 13 years ago Closed 13 years ago

Store time information in each sample

Categories

(Core :: Gecko Profiler, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: BenWa, Assigned: BenWa)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Storing the time information for each sample will let us know put an accurate timeline and detect 'time breaks' for the profiler was not able to keep the sampling rate. It will also be interesting to have the UI use this data to tell you how accurate the timings are.
Attachment #638172 - Flags: review?(jmuizelaar)
I added 'Real Interval: 1.18 ms +-1.14' to the info bar. From a few quick profiles we always run longer then the target which is expected since we don't account for the time to record a sample. We're more precise then I expected with +- 1
Comment on attachment 638172 [details] [diff] [review] patch >diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp >--- a/tools/profiler/TableTicker.cpp >+++ b/tools/profiler/TableTicker.cpp >@@ -300,16 +300,23 @@ public: > break; > case 'r': > { > if (sample) { > b.DefineProperty(sample, "responsiveness", entry.mTagFloat); > } > } > break; >+ case 't': >+ { >+ if (sample) { >+ b.DefineProperty(sample, "time", entry.mTagFloat); How about calling this 'timestamp' >+ } >+ } >+ break; > case 'c': > case 'l': > { > if (sample) { > JSObject *frame = b.CreateObject(); > if (entry.mTagName == 'l') { > // Bug 753041 > // We need a double cast here to tell GCC that we don't want to sign >@@ -357,16 +364,17 @@ hasFeature(const char** aFeatures, uint3 > } > > class TableTicker: public Sampler { > public: > TableTicker(int aInterval, int aEntrySize, ProfileStack *aStack, > const char** aFeatures, uint32_t aFeatureCount) > : Sampler(aInterval, true) > , mPrimaryThreadProfile(aEntrySize, aStack) >+ , mStartTime(TimeStamp::Now()) > , mSaveRequested(false) > { > mUseStackWalk = hasFeature(aFeatures, aFeatureCount, "stackwalk"); > > //XXX: It's probably worth splitting the jank profiler out from the regular profiler at some point > mJankOnly = hasFeature(aFeatures, aFeatureCount, "jank"); > mPrimaryThreadProfile.addTag(ProfileEntry('m', "Start")); > } >@@ -396,16 +404,17 @@ class TableTicker: public Sampler { > > private: > // Not implemented on platforms which do not support backtracing > void doBacktrace(ThreadProfile &aProfile, TickSample* aSample); > > private: > // This represent the application's main thread (SAMPLER_INIT) > ThreadProfile mPrimaryThreadProfile; >+ TimeStamp mStartTime; > bool mSaveRequested; > bool mUseStackWalk; > bool mJankOnly; > }; > > std::string GetSharedLibraryInfoString(); > > /** >@@ -761,16 +770,21 @@ void TableTicker::Tick(TickSample* sampl > > if (recordSample) > mPrimaryThreadProfile.flush(); > > if (!mJankOnly && !sLastTracerEvent.IsNull() && sample) { > TimeDuration delta = sample->timestamp - sLastTracerEvent; > mPrimaryThreadProfile.addTag(ProfileEntry('r', delta.ToMilliseconds())); > } >+ >+ if (sample) { >+ TimeDuration delta = sample->timestamp - mStartTime; >+ mPrimaryThreadProfile.addTag(ProfileEntry('t', delta.ToMilliseconds())); >+ } > } I'm not sure we should record this in jank mode.
Attachment #638172 - Flags: review?(jmuizelaar) → review+
Assignee: nobody → bgirard
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla16
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 771608
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: