Skip to content

Commit d78748e

Browse files
committed
Added more detail to README.md
1 parent f148a81 commit d78748e

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,26 @@
44
### a memory tracking tool
55

66
allocscope is a tool for tracking down where the most egregiously large allocations are occurring
7-
in a C, C++ or Rust codebase.
7+
in a C, C++ or Rust codebase. It is particilarly intendend to be useful for developers who want to
8+
get a handle on excessive allocations and are working in a large codebase with multiple
9+
contributors with allocations occuring in many modules or libraries.
810

911
It is composed of two commands:
1012

1113
`allocscope-trace` attaches to another process as a debugger. By using breakpoints on memory
12-
allocation functions such as `malloc` it tracks allocations made by that process.
14+
allocation functions such as `malloc` it tracks allocations made by that process. During the
15+
trace, the callstack of all allocations are recorded to an `.atrace` file. Tracing programs
16+
which spawn multiple threads and tracing calls through shared libraries are supported. You can
17+
spawn a process to trace by specifying a full commandline to `allocscope-trace`, or you can
18+
attach to an existing running process.
1319

14-
`allocscope-view` reads a trace file produced by `allocscope-trace`. It presents a summary of all
15-
allocations made in a call tree format, which can be sorted by largest concurrent allocation,
16-
total number of blocks, or number of unfreed allocation blocks.
20+
`allocscope-view` reads the `.atrace` file produced by `allocscope-trace`. It presents a summary
21+
of all allocations made in a call tree format, which can be sorted by largest concurrent
22+
allocation, total number of blocks, number of unfreed allocation blocks, or the sequence of
23+
the allocation. The summary can be navigated interactively through a curses-based terminal user
24+
interface, or a text report suitable for non-interactive use can be generated.
1725

18-
# Installing prebuilt binaries
26+
## Installing prebuilt binaries
1927

2028
The easiest way to get started with allocscope is to install prebuilt binaries.
2129

@@ -26,7 +34,18 @@ To install the latest version:
2634
Currently only Linux on x86_64 processors is supported, but I'd like to support more operating systems
2735
and processors in the future.
2836

29-
# Building from source
37+
## Getting started
38+
39+
While it will be likely be most useful to use allocscope on a program with symbols, which you
40+
have compiled yourself, you can verify that it functions correctly by performing a trace on a
41+
standard system command, such as `ls`:
42+
43+
```
44+
allocscope-trace ls -l
45+
allocscope-view ls.atrace
46+
```
47+
48+
## Building from source
3049

3150
On recent Ubuntu releases, allocscope can be built from source with the following sequence
3251
of commands:
@@ -40,12 +59,15 @@ cargo install --path allocscope-trace
4059
cargo install --path allocscope-view
4160
```
4261

43-
# Support development
62+
Statically linked binaries can also be built using the `build-static/build.sh` script, though this requires
63+
Docker installed on the build system.
64+
65+
## Support development
4466

4567
If you find allocscope useful, please consider supporting development.
4668

4769
Visit https://allocscope.com/support
4870

49-
# License
71+
## License
5072

5173
allocscope is licensed GNU General Public License version 3.

0 commit comments

Comments
 (0)