Skip to content
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

Add Fuchsia Trace Format output to olly #6

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

tomjridge
Copy link
Contributor

FTF is a binary format viewable in Perfetto. FTF is supported by the opam tracing package. This commit is a simple change to add FTF output to olly, following the [trace] code that already outputs Chrome Tracing Format traces.

FTF is a binary format viewable in Perfetto. FTF is supported by the
opam tracing package. This commit is a simple change to add FTF output
to olly, following the [trace] code that already outputs Chrome Tracing
Format traces.
@kayceesrk
Copy link
Collaborator

Thanks. It would be useful to check whether the same traces are produced for json and FTF traces.

If you happen to run a long-running program, could you report the size of the json trace and the FTF trace for the same program?

@tomjridge
Copy link
Contributor Author

tomjridge commented Dec 12, 2022

Some more data after running binarytrees5_multicore.ml from sandmark. The test was run with 3 domains and varying arguments for max_depth. fxt is the binary format; json is the text format. The resulting trace sizes are:

|  n | fxt size (bytes) | json size (bytes) | ratio (json/fxt) |
| 15 |            32768 |            143360 |            4.375 |
| 16 |            61440 |            299008 |      4.866666667 |
| 17 |           106496 |            565248 |      5.307692308 |
| 18 |           233472 |           1294336 |      5.543859649 |
| 19 |           430080 |           2498560 |       5.80952381 |
| 20 |          1003520 |           5783552 |      5.763265306 |
| 21 |          1953792 |          11382784 |      5.825995807 |
| 22 |          4542464 |          26243072 |      5.777276826 |

I think we expected better the binary format to have a better ratio than this as n increases. At the moment, the long binary traces seem to be only about 5.8 times smaller than the json equivalent.

[Update: trying n at 24 and 25, the ratio is still about 5.8; json file size is 232MB for n=25]

@kayceesrk
Copy link
Collaborator

If I am reading the PR right, this introduces a new command olly trace_ftf. This is not desirable given that the existing command trace and trace_ftf are exactly the same except for the trace format.

A better way to do this would be to introduce an option under the existing trace command called --format which can either be json or fuschia (default).

$ olly trace --format json prog.trace prog.exe    # emits the trace in json format
$ olly trace --format fuschia prog.trace prog.exe # emits the trace in fuschia trace format
$ olly trace prog.trace prof.exe                  # emits the trace in fuschia trace format

@tomjridge
Copy link
Contributor Author

tomjridge commented Dec 13, 2022

I've implemented your request - hopefully the command line interface is now a bit more sensible. (I am a cmdliner novice, so let me know if this is still not right.)

@kayceesrk
Copy link
Collaborator

Thanks. I’ll get to this tomorrow.

@kayceesrk kayceesrk self-requested a review December 13, 2022 16:21
@tomjridge tomjridge force-pushed the add-fuchsia-trace-format branch from b9aea54 to 8dd70b2 Compare December 13, 2022 16:37
Trace format can be either "json" (compatible with Chrome tracing) or
"fuchsia" (Fuchsia Trace Format, a binary format that can be used with
Perfetto).
@tomjridge tomjridge force-pushed the add-fuchsia-trace-format branch from 8dd70b2 to 3201e40 Compare December 13, 2022 16:39
@kayceesrk
Copy link
Collaborator

LGTM.

@kayceesrk kayceesrk merged commit 8e2116e into tarides:main Dec 14, 2022
Sudha247 added a commit to Sudha247/opam-repository that referenced this pull request May 31, 2023
CHANGES:

* Fix dependencies (tarides/runtime_events_tools#14, @Sudha247)
* Improve JSON output produced by olly gc-stats (tarides/runtime_events_tools#13, @punchagan)
* Mention Fuchsia format in the README (tarides/runtime_events_tools#11, @Sudha247)
* Gc subcommand (tarides/runtime_events_tools#10, @Sudha247)
* Add Fuchsia Trace Format output to olly (tarides/runtime_events_tools#6, @tomjridge)
* Added --output option to redirect olly printing (tarides/runtime_events_tools#5, @ElectreAAS)
* Added json printing option (tarides/runtime_events_tools#4, @ElectreAAS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants