summaryrefslogtreecommitdiff
path: root/rts/ProfilerReportJson.c
Commit message (Collapse)AuthorAgeFilesLines
* ProfilerReportJson.c: fix out-of-bounds accessSergei Trofimovich2017-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by gcc-7.1 which reported build error as: rts/ProfilerReportJson.c:23:16: error: error: comparison between pointer and zero character constant [-Werror=pointer-compare] for (; str != '\0' && len > 0; str++) { ^~ | 23 | for (; str != '\0' && len > 0; str++) { | ^ Unfixed code in context: ```c static void escapeString(char const* str, char *out, int len) { len--; // reserve character in output for terminating NUL for (; str != '\0' && len > 0; str++) { char c = *str; ``` The intent here is to process 'len' (if positive) or '\0'-terminator in 'str' but dereference was missing. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Prefer #if defined to #ifdefBen Gamari2017-04-281-1/+1
| | | | Our new CPP linter enforces this.
* JSON profiler reportsBen Gamari2017-02-231-0/+127
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