Unit tests: Add capability to easily profile a test

RESOLVED FIXED in mozilla1.9.2a1

Status

()

enhancement
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: cjones, Assigned: cjones)

Tracking

Trunk
mozilla1.9.2a1
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

I would like to be able to do something like:

  StartProfiling("MyTestcase");
  RunTestcase();
  StopProfiling();

Initially, I only care about Shark, but it should be easy to add support for other profilers that provide programmatic hooks.
I used this patch to generate the profile in bug 456272.
Attachment #371002 - Flags: review?(benjamin) → review-
Comment on attachment 371002 [details] [diff] [review]
Add StartProfiling() and StopProfiling() to TestHarness.h

I'm a little unhappy about the makefile FLAGS changes, because they are localized to xpcom/tests, when TestHarness.h could/should be used other places. Can we just add those flags globally when shark is enabled?
Posted patch v2Splinter Review
Moved setting of OS X framework flags to config.mk.
Attachment #371002 - Attachment is obsolete: true
Attachment #371949 - Flags: review?(benjamin)
Attachment #371949 - Flags: review?(benjamin) → review+
jsdbgapi.h has the same code... can we share?
Sharing might be hard... they are in different build systems and are very difficult to link back together.
Pushed http://hg.mozilla.org/mozilla-central/rev/7be0087c83ca
Chris Jones - bug 486793: add programmatic control of profiler to xpcom unit tests. r=bsmedberg
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Attachment #426902 - Flags: review?(bugspam.Callek) → review+
Comment on attachment 426902 [details] [diff] [review]
(Bv1-CC) Copy it to comm-central
[Checkin: Comment 9]


http://hg.mozilla.org/comm-central/rev/36643bb71021

I wonder how this patch ended up with "From: Paolo Amadini ..." :-/
Attachment #426902 - Attachment description: (Bv1-CC) Copy it to comm-central → (Bv1-CC) Copy it to comm-central [Checkin: Comment 9]
You need to log in before you can comment on or make changes to this bug.