Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/reference/tracebox.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ The following applets are available:
`traced_probes`
: Probes for system-wide tracing (ftrace, /proc pollers).

`traced_relay`
: Relays trace data to a remote tracing service.

`traced_perf`
: Perf-based CPU profiling data source.

Expand Down
1 change: 1 addition & 0 deletions src/tracebox/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ executable("tracebox") {
"../perfetto_cmd",
"../perfetto_cmd:trigger_perfetto_cmd",
"../traced/service",
"../traced_relay:lib",
"../websocket_bridge:lib",
]
if (enable_perfetto_traced_probes) {
Expand Down
1 change: 1 addition & 0 deletions src/tracebox/tracebox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct Applet {
const Applet g_applets[]{
{"traced", ServiceMain},
{"traced_probes", ProbesMain},
{"traced_relay", RelayServiceMain},
#if PERFETTO_BUILDFLAG(PERFETTO_TRACED_PERF)
{"traced_perf", TracedPerfMain},
#endif
Expand Down
10 changes: 10 additions & 0 deletions src/traced_relay/relay_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@ int PERFETTO_EXPORT_ENTRYPOINT RelayServiceMain(int argc, char** argv) {
svc->Start(listen_socket, GetRelaySocket());
}

// If the TRACED_RELAY_NOTIFY_FD env var is set, write 1 and close the FD.
// This is so tools can synchronize with the point where the IPC socket
// has been opened, without having to poll.
const char* env_notif = getenv("TRACED_RELAY_NOTIFY_FD");
if (env_notif) {
int notif_fd = atoi(env_notif);
PERFETTO_CHECK(base::WriteAll(notif_fd, "1", 1) == 1);
PERFETTO_CHECK(base::CloseFile(notif_fd) == 0);
}

// Set the CPU limit and start the watchdog running. The memory limit will
// be set inside the service code as it relies on the size of buffers.
// The CPU limit is the generic one defined in watchdog.h.
Expand Down