Name Date Size

..19-Aug-20204 KiB

CMakeLists.txtH A D19-Aug-2020324

loop.ccH A D19-Aug-2020883

README.mdH A D19-Aug-20201.4 KiB

solo.ccH A D19-Aug-2020809

sorting_algorithm.ccH A D19-Aug-20202.7 KiB

statistics.ccH A D19-Aug-20202.2 KiB

1# Phosphor Examples
3This directory contains examples of Phosphor being used for tracing. The
4examples in this directory can be built with the rest of the examples by using
5the "-DPHOSPHOR_BUILD_EXAMPLES=1" CMake config flag or running `make all` with
6the top-level-makefile (Which will also build the benchmarks, with coverage and
7run the tests).
9## solo
11The solo executable logs a single 'instant' trace event with zero arguments -
12effectively a 'Hello, World' for tracing.
14## sorting_algorithm
16The sorting algorithm executable contains an implementation of merge sort and
17will print out an array of ints before and after sorting. You can enable tracing
18with Phosphor by using the PHOSPHOR_TRACING_START environment variable. e.g.
20    PHOSPHOR_TRACING_START="buffer-mode:fixed;buffer-size:1241024;save-on-stop:sorting_output.%d.json" build/examples/sorting_algorithm
22Will start tracing when the trace log object is instantiated (Usually at the
23first call site) with a fixed size buffer roughly 1MB in size. It will also
24automaticallted dump a file named along the lines of
25`sorting_output.2016-06-21T08:00:45Z.json` when the trace log is destructed (On
26program exit). This tracing file can be viewed in the Catapult tracing viewer
27which is bundled with Chrome/Chromium (chrome://tracing/).
29## statistics
31The statistics executable dumps a bunch of information regarding the sizes of
32various internal phosphor structures and their relative capacities.