summaryrefslogtreecommitdiff
path: root/rts/ProfilerReportJson.c
Commit message (Collapse)AuthorAgeFilesLines
* rts: Introduce getNumCapabilitiesBen Gamari2022-12-161-1/+1
| | | | | | And ensure accesses to n_capabilities are atomic (although with relaxed ordering). This is necessary as RTS API callers may concurrently call into the RTS without holding a capability.
* Make `PosixSource.h` installed and under `rts/`John Ericson2021-08-091-1/+1
| | | | | | is used outside of the rts so we do this rather than just fish it out of the repo in ad-hoc way, in order to make packages in this repo more self-contained.
* Escape backslashes in json profiling reports properly.Andreas Klebinger2020-07-141-19/+45
| | | | | | | I also took the liberty to do away the fixed buffer size for escaping. Using a fixed size here can only lead to issues down the line. Fixes #18438.
* rts/ProfilerReportJson: Fix format stringBen Gamari2019-02-081-1/+1
| | | | This was warning on i386.
* 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