Name Date Size #Lines LOC

..--

core/H25-Apr-2025-6,0193,810

internal/H25-Apr-2025-5,1783,730

ipc/H25-Apr-2025-4,4503,090

service/H25-Apr-2025-17,72212,735

test/H25-Apr-2025-10,5447,896

BUILD.gnH A D25-Apr-20257.2 KiB245229

OWNERSH A D25-Apr-2025149 75

README.mdH A D25-Apr-20252.4 KiB5745

api_benchmark.ccH A D25-Apr-20255.8 KiB179131

console_interceptor.ccH A D25-Apr-202515.7 KiB470372

data_source.ccH A D25-Apr-20253.8 KiB9463

debug_annotation.ccH A D25-Apr-2025982 319

event_context.ccH A D25-Apr-20253.1 KiB9157

interceptor.ccH A D25-Apr-20251.3 KiB3815

platform.ccH A D25-Apr-20251.2 KiB4216

platform_fake.ccH A D25-Apr-2025912 306

platform_posix.ccH A D25-Apr-20254.3 KiB13582

platform_windows.ccH A D25-Apr-20255.3 KiB17694

trace_writer_base.ccH A D25-Apr-20251 KiB294

traced_proto_unittest.ccH A D25-Apr-202516.2 KiB449353

traced_value.ccH A D25-Apr-20256 KiB185130

traced_value_unittest.ccH A D25-Apr-202525.2 KiB744606

tracing.ccH A D25-Apr-20256.3 KiB217155

tracing_policy.ccH A D25-Apr-2025758 244

track.ccH A D25-Apr-20258.3 KiB257185

track_event_category_registry.ccH A D25-Apr-20252.1 KiB6638

track_event_legacy.ccH A D25-Apr-20252.3 KiB7746

track_event_state_tracker.ccH A D25-Apr-202510.8 KiB290239

virtual_destructors.ccH A D25-Apr-20252.2 KiB5313

README.md

1How to use this library
2-----------------------
3There are three options to use this library:
4
5## Option 1) Fully in-process
6In this mode Producer, Consumers and the Service are hosted in the same process.
7This is not too interesting other than tests and particular cases of nesting
8tracing instances coming from different libraries within the same process
9(concrete example v8, skia and webrtc in Chrome).
10In this configuration, the client is expected to at least:
11- Create a TracingService instance via TracingService::CreateInstance
12  (see `core/tracing_service.h`)
13- Subclass Producer (`core/producer.h`) and connect it to the service.
14- Provide a TaskRunner implementation (see `test/test_task_runner.h`)
15- Provide a trivial SharedMemory implementation (`core/shared_memory.h`) which
16  is simply backed by a malloc() buffer.
17
18## Option 2) Using the provided UNIX RPC transport
19The `include/unix_rpc` provides the building blocks necessary to implement a RPC
20mechanism that allows Producer(s), Consumer(s) and Service to be hosted on
21different processes on the same machine and talk over a UNIX domain socket.
22- Producer(s) are expected to get a service proxy via
23`UnixServiceConnection::ConnectAsProducer()`.
24- The `Service` must be instantiated via `UnixServiceHost::CreateInstance()`. The
25returned instance encapsulates the `Service` and exposes two UNIX sockets (one
26for Producer(s), one for Consumer(s)) on the current process.
27
28## Option 3) Providing a custom RPC transport
29Similar to Option 2, but the client creates its own transport mechanism,
30defining how methods are proxies between instances and providing a SharedMemory
31implementation that can be transferred through RPC. Concrete example of this is
32Chrome implementing this library over a Mojo transport.
33
34
35Directory layout
36----------------
37
38`include/`
39Is the public API that clients of this library are allowed to depend on.
40Headers inside include/ cannot depend on anything else.
41
42`src/`
43Is the actual implementation that clients can link but not expected to access
44at a source-code level.
45
46
47**Both have the following sub-structure**:
48
49`{include,src}/core/`
50"Core" is the pure c++17 tracing machinery that deals with bookkeeping,
51ring-buffering, partitioning and multiplexing but knows nothing about
52platform-specific things like implementation of shared memory and RPC mechanism.
53
54`{include,src}/unix_rpc/`
55A concrete implementation of the transport layer based on UNIX domain sockets
56and posix shared memory.
57