-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Backtracing] Add JSON backtrace output #79009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(The very first commit is being dealt with separately in #79007. But we need it for the JSON changes, because when in JSON mode we change the filename for the former feature.) |
@swift-ci Please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - caught one typo, and I have one question: should the JSON output be minified (at least have an option to do so?).
Some logging systems require that each JSON object is completely on a single line, so this prettified version might not work with them.
Even if you change to minified JSON, anyone at desk can run this through jq for reading, if needed.
The JSON isn't strictly minified, since there is some whitespace, but there are (by design) no newlines. The tests are slightly misleading perhaps because they run the JSON through a JSON linter/prettifier, which means everything ends up on separate lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few suggestions, nothing I'd insist on strongly.
While reading the JSON output format, it occurs to me that it doesn't have the VM region info that we get in Mac crash logs. That can be really useful sometimes and it might be nice to add it here. That doesn't belong in this PR, but I thought I'd put that out there.
Yeah, that's not a bad idea. Not in this PR though, as you say. |
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
Also made it so the `sanitize` option causes the crash logs to not include memory dumps. Fixes swiftlang#71057 rdar://121430255
A couple of commas were in the wrong place.
The JSON output should include platform and architecture data. rdar://121430255
Added documentation for the JSON output. rdar://121430255
…ads. I'd omitted the key from the dictionary by mistake. rdar://121430255
Check that we generate valid JSON crash reports. rdar://121430255
Fix a typo. Co-authored-by: Honza Dvorsky <[email protected]>
Always put `registers` in the thread record, and always use the `threads` top level key, even if we ask for only the crashed thread. Also add an `omittedThreads` key. rdar://121430255
We know we need at least as much space as the number of UTF-8 characters. rdar://121430255
rdar://121430255
8e59e7e
to
06e0dbb
Compare
@swift-ci Please smoke test |
Linux gives the main thread a name based on the process name, and also we need to tolerate an extra slash on the `<compiler-generated>` filename for some reason. rdar://121430255
06e0dbb
to
6138992
Compare
@swift-ci Please smoke test |
Linux timed-out during an unrelated test. |
@swift-ci Please smoke test Linux platform |
Add an option to use JSON for the crash log output; this makes it easy to ingest crash logs using tools like Splunk or Elastic, which is extremely useful in server environments.
rdar://121430255