custom file for GCTIMER output

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Igor Bukanov, Assigned: Igor Bukanov)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 1 obsolete attachment)

v2
5.32 KB, patch
gwagner
: review+
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
Currently MOZ_GCTIMER always writes the stats into the gcTimer.dat file in the current directory. It would be nice to be to control this via a environment variable. This way it would be harder to accidentally overwrite the collected stats.
(Assignee)

Comment 1

6 years ago
Created attachment 540940 [details] [diff] [review]
v1

With the patch the MOZ_GCTIMER controls the output file. I also removed JS_WANT_GC_SUITE_PRINT support as a similar effect can be archived by setting MOZ_GCTIMER to /proc/self/fd/1 . I have also added a special value "none" to disable the stat collection for convince.
Attachment #540940 - Flags: review?(anygregor)
Comment on attachment 540940 [details] [diff] [review]
v1

>
>
>diff --git a/js/src/jsgcstats.cpp b/js/src/jsgcstats.cpp
>--- a/js/src/jsgcstats.cpp
>+++ b/js/src/jsgcstats.cpp
> #if defined(MOZ_GCTIMER)
>-        if (JS_WANT_GC_SUITE_PRINT) {
>-            fprintf(stderr, "%f %f %f\n",
>-                    TIMEDIFF(enter, end),
>-                    TIMEDIFF(startMark, startSweep),
>-                    TIMEDIFF(startSweep, sweepDestroyEnd));
>-        } else {
>-            static FILE *gcFile;

I am still using JS_WANT_GC_SUITE_PRINT for js/src/metrics/gc/gc-test.py.
There it expects the output in stderr.
(Assignee)

Comment 3

6 years ago
Created attachment 540993 [details] [diff] [review]
v2

The new version interprets stderr/stdout values in MOZ_GCTIMER environment variable as an instruction to print data in the short format. gc-test.py sets the variable accordingly eliminating the need in JS_WANT_GC_SUITE_PRINT.
Attachment #540940 - Attachment is obsolete: true
Attachment #540993 - Flags: review?(anygregor)
Attachment #540940 - Flags: review?(anygregor)
Comment on attachment 540993 [details] [diff] [review]
v2

Thanks!
I was also thinking of making a runtime switch for optimize builds so that you don't have to add it during compilation. Everybody could enable it if wanted.
Attachment #540993 - Flags: review?(anygregor) → review+
(In reply to comment #4)
> I was also thinking of making a runtime switch for optimize builds so that
> you don't have to add it during compilation. Everybody could enable it if
> wanted.

This would be great. All the preprocessor verbiage for GCTIMER and JSGC_TESTPILOT is getting a little heavy. It would be nice if it were always enabled.
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/tracemonkey/rev/6933048a247c
Whiteboard: fixed-in-tracemonkey
cdleary-bot mozilla-central merge info:
http://hg.mozilla.org/mozilla-central/rev/6933048a247c
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.