Skip to content

Commit a8cde29

Browse files
committed
remove sudo
1 parent ecf6b72 commit a8cde29

File tree

6 files changed

+110
-126
lines changed

6 files changed

+110
-126
lines changed

docs/getting-started/cpu-profiling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
163163
Assuming the example config above is saved as `/tmp/config.txtpb`, start the
164164
recording.
165165
```bash
166-
sudo ./tracebox ctl start # This will start persistent background tracing services
167-
sudo ./tracebox -c /tmp/config.txtpb --txt -o /tmp/trace.pb
166+
./tracebox ctl start # This will start persistent background tracing services
167+
./tracebox -c /tmp/config.txtpb --txt -o /tmp/trace.pb
168168
```
169169

170170
Open the `/tmp/trace.pb` file in the [Perfetto UI](https://ui.perfetto.dev).
@@ -334,8 +334,8 @@ Assuming the example config above is saved as `/tmp/config.txtpb` (with the
334334
target\_cmdline option changed to a process on your machine), start the
335335
recording.
336336
```bash
337-
sudo ./tracebox ctl start
338-
sudo ./tracebox -c /tmp/config.txtpb --txt -o /tmp/trace.pb
337+
./tracebox ctl start
338+
./tracebox -c /tmp/config.txtpb --txt -o /tmp/trace.pb
339339
```
340340

341341
Once the recording stops, open the `/tmp/trace.pb` file in the [Perfetto

docs/getting-started/ftrace.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ See the [system tracing page](/docs/getting-started/system-tracing.md) in order
285285
to get set up with tracebox. For this example we are going to record a trace
286286
from the command line using the config file we just created:
287287
```bash
288-
sudo ./tracebox ctl start # This will start persistent background tracing services
289-
sudo ./tracebox -c ticker.cfg --txt -o ticker.pftrace
288+
./tracebox ctl start # This will start persistent background tracing services
289+
./tracebox -c ticker.cfg --txt -o ticker.pftrace
290290
```
291291

292292
Alternatively using autodaemonize mode:
293293
```bash
294-
sudo ./tracebox --autodaemonize -c ticker.cfg --txt -o ticker.pftrace
294+
./tracebox --autodaemonize -c ticker.cfg --txt -o ticker.pftrace
295295
```
296296

297297
Note: tracebox will take care of enabling tracing and our ticker events (as we

docs/getting-started/memory-profiling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,22 +174,22 @@ chmod +x tracebox heap_profile
174174

175175
Start the tracing service
176176
```bash
177-
sudo ./tracebox ctl start # This will start persistent background tracing services
177+
./tracebox ctl start # This will start persistent background tracing services
178178
```
179179

180180
Generate the heapprofd config and start the tracing session.
181181
```bash
182182
# Replace trace_processor_shell with with the name of the process you want to
183183
# profile.
184184
./heap_profile -n trace_processor_shell --print-config | \
185-
sudo ./tracebox -c - --txt -o ~/trace_processor_memory.pftrace
185+
./tracebox -c - --txt -o ~/trace_processor_memory.pftrace
186186
```
187187

188188
Alternatively, use the autodaemonize mode (no `ctl start` required):
189189

190190
```bash
191191
./heap_profile -n trace_processor_shell --print-config | \
192-
sudo ./tracebox --autodaemonize -c - --txt -o ~/trace_processor_memory.pftrace
192+
./tracebox --autodaemonize -c - --txt -o ~/trace_processor_memory.pftrace
193193
```
194194

195195
Open another terminal (or tab), start the process you want to profile,
@@ -222,7 +222,7 @@ which you can then open with the Perfetto UI.
222222

223223
Remember also to kill the `tracebox` services once you are done.
224224
```bash
225-
sudo ./tracebox ctl stop
225+
./tracebox ctl stop
226226
```
227227
</tabs?>
228228

docs/getting-started/system-tracing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ chmod +x tracebox
156156
First, start the tracing daemons in background:
157157

158158
```bash
159-
sudo ./tracebox ctl start # This will start persistent background tracing services
159+
./tracebox ctl start # This will start persistent background tracing services
160160
```
161161

162162
Then, to capture a trace you need to pass the config file to the downloaded `tracebox`
@@ -169,14 +169,14 @@ curl -LO https://raw.githubusercontent.com/google/perfetto/refs/heads/main/test/
169169
```
170170
and running the following command:
171171
```bash
172-
sudo ./tracebox -o trace_file.perfetto-trace --txt -c scheduling.cfg
172+
./tracebox -o trace_file.perfetto-trace --txt -c scheduling.cfg
173173
```
174174
The scheduling information is captured using ftrace, so you may need to start
175-
the `tracebox` daemons with root privileges (e.g. `sudo ./tracebox ctl start`).
175+
the `tracebox` daemons with root privileges (e.g. `./tracebox ctl start`).
176176

177177
If you prefer the old behavior where tracebox starts temporary daemons for the duration of the trace, you can use the `--autodaemonize` flag:
178178
```bash
179-
sudo ./tracebox --autodaemonize -o trace_file.perfetto-trace --txt -c scheduling.cfg
179+
./tracebox --autodaemonize -o trace_file.perfetto-trace --txt -c scheduling.cfg
180180
```
181181

182182
</tabs?>

docs/reference/tracebox.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ multiple tracing sessions.
2929
**Commands:**
3030

3131
`tracebox ctl start`
32-
: Starts `traced` and `traced_probes` in the background. On Linux, running
33-
as root (via `sudo`) is highly recommended to place sockets in the standard
34-
`/run/perfetto/` directory.
32+
: Starts `traced` and `traced_probes` in the background.
3533

3634
`tracebox ctl stop`
37-
: Stops daemons started via `ctl start` and cleans up PID files.
35+
: Stops daemons started via `ctl start`.
3836

3937
`tracebox ctl status`
4038
: Checks if daemons are running, accessible, and which sockets they are using.
@@ -43,14 +41,14 @@ multiple tracing sessions.
4341

4442
```bash
4543
# Start services once (as root for full system/SDK support)
46-
sudo ./tracebox ctl start
44+
./tracebox ctl start
4745

4846
# Record multiple traces
49-
sudo ./tracebox -t 10s -o trace1.pftrace sched
50-
sudo ./tracebox -t 10s -o trace2.pftrace sched
47+
./tracebox -t 10s -o trace1.pftrace sched
48+
./tracebox -t 10s -o trace2.pftrace sched
5149

5250
# Stop services when finished
53-
sudo ./tracebox ctl stop
51+
./tracebox ctl stop
5452
```
5553

5654
### 2. Autodaemonize Mode
@@ -65,7 +63,7 @@ Pass the `--autodaemonize` flag before other arguments.
6563

6664
```bash
6765
# Start daemons, record trace, stop daemons
68-
sudo ./tracebox --autodaemonize -t 10s -o trace.pftrace sched
66+
./tracebox --autodaemonize -t 10s -o trace.pftrace sched
6967
```
7068

7169
### 3. Applet Mode
@@ -94,7 +92,7 @@ This is the preferred mode for most workflows.
9492

9593
* **SDK/App Tracing:** If you are tracing applications instrumented with the
9694
Perfetto SDK (using `track_event`), you **must** use Managed Mode (usually
97-
as root). SDK applications only connect to the standard system socket paths
95+
as root). SDK applications connect to the standard system socket paths
9896
(e.g., `/run/perfetto/` on Linux).
9997
* **Repeated Tracing:** If you are recording multiple traces in succession,
10098
Managed Mode avoids the overhead of restarting the services for every trace.
@@ -107,6 +105,3 @@ This is the preferred mode for most workflows.
107105
you want to ensure no leftover processes remain after execution.
108106
* **Debugging:** Quick verification of ftrace events where setting up a full
109107
service is unnecessary.
110-
* **Limitations:** This mode uses private, randomized socket paths (e.g., in
111-
`/tmp/`). Applications using the Perfetto SDK **cannot** connect to these
112-
daemons, so you will not capture userspace instrumentation.

0 commit comments

Comments
 (0)