diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-02-23 13:22:48 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-02-23 17:26:44 -0500 |
commit | a20433326eabd759502d9c170c3cc44ce6128a04 (patch) | |
tree | 72ba807d45f05460dcfad02d437d9b79c0518481 /rts/RtsFlags.c | |
parent | 0a77cedb914a67b8bd7c4af1f87714dc497fec3e (diff) | |
download | haskell-a20433326eabd759502d9c170c3cc44ce6128a04.tar.gz |
JSON profiler reports
This introduces a JSON output format for cost-centre profiler reports.
It's not clear whether this is really something we want to introduce
given that we may also move to a more Haskell-driven output pipeline in
the future, but I nevertheless found this helpful, so I thought I would
put it up.
Test Plan: Compile a program with `-prof -fprof-auto`; run with `+RTS
-pj`
Reviewers: austin, erikd, simonmar
Reviewed By: simonmar
Subscribers: duncan, maoe, thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D3132
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r-- | rts/RtsFlags.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index f924432de4..5fd368cb61 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -304,6 +304,7 @@ usage_text[] = { " -P More detailed Time/Allocation profile", " -Pa Give information about *all* cost centres", "", +" -Pj Output cost-center profile in JSON format", " -h<break-down> Heap residency profile (hp2ps) (output file <program>.hp)", " break-down: c = cost centre stack (default)", " m = module", @@ -1059,13 +1060,14 @@ error = true; error = true; } break; + case 'j': + RtsFlags.CcFlags.doCostCentres = COST_CENTRES_JSON; + break; case '\0': if (rts_argv[arg][1] == 'P') { - RtsFlags.CcFlags.doCostCentres = - COST_CENTRES_VERBOSE; + RtsFlags.CcFlags.doCostCentres = COST_CENTRES_VERBOSE; } else { - RtsFlags.CcFlags.doCostCentres = - COST_CENTRES_SUMMARY; + RtsFlags.CcFlags.doCostCentres = COST_CENTRES_SUMMARY; } break; default: |