Skip to content
Merged
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
64 changes: 30 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

- [What is AppleTrace?](#-what-is-appletrace)
- [Key Features](#-key-features)
- [How It Works](#-how-it-works)
- [Quick Start](#-quick-start)
- [How It Works](#-how-it-works)
- [Installation](#-installation)
- [Usage](#-usage)
- [Processing & Visualizing Traces](#-processing--visualizing-traces)
Expand Down Expand Up @@ -89,29 +89,6 @@ to explore the call timeline, durations, threads, and counters.

---

## 🔧 How It Works

```
Your app (instrumented) Host tooling Browser
┌───────────────────────────┐ ┌──────────────────────┐ ┌────────────────┐
│ APTBeginSection / APTEnd… │ │ merge.py / │ │ │
│ APTInstant / APTCounter │ ───► │ appletrace_cli.py │ ───► │ ui.perfetto.dev│
│ APTAsyncBegin / … │ │ │ │ │
│ objc_msgSend auto-hook │ │ fragments → trace.json│ │ drag & drop │
└───────────────────────────┘ └──────────────────────┘ └────────────────┘
per-thread batched writes X-complete collapse
→ <sandbox>/Library/appletracedata → single JSON array
```

1. **Instrument** — add manual markers, or install the `objc_msgSend` hook.
2. **Capture** — events accumulate in per-thread buffers and flush in bulk to
trace fragments under `<app sandbox>/Library/appletracedata`.
3. **Merge** — pull the folder and run `merge.py`; begin/end pairs collapse into
Perfetto `X` complete events.
4. **Visualize** — drag `trace.json` into Perfetto.

---

## ⚡ Quick Start

```bash
Expand Down Expand Up @@ -166,6 +143,29 @@ Open [ui.perfetto.dev](https://ui.perfetto.dev) and drag in `trace.json` (or use

---

## 🔧 How It Works

```
Your app (instrumented) Host tooling Browser
┌───────────────────────────┐ ┌──────────────────────┐ ┌────────────────┐
│ APTBeginSection / APTEnd… │ │ merge.py / │ │ │
│ APTInstant / APTCounter │ ───► │ appletrace_cli.py │ ───► │ ui.perfetto.dev│
│ APTAsyncBegin / … │ │ │ │ │
│ objc_msgSend auto-hook │ │ fragments → trace.json│ │ drag & drop │
└───────────────────────────┘ └──────────────────────┘ └────────────────┘
per-thread batched writes X-complete collapse
→ <sandbox>/Library/appletracedata → single JSON array
```

1. **Instrument** — add manual markers, or install the `objc_msgSend` hook.
2. **Capture** — events accumulate in per-thread buffers and flush in bulk to
trace fragments under `<app sandbox>/Library/appletracedata`.
3. **Merge** — pull the folder and run `merge.py`; begin/end pairs collapse into
Perfetto `X` complete events.
4. **Visualize** — drag `trace.json` into Perfetto.

---

## 📦 Installation

### Requirements
Expand Down Expand Up @@ -438,12 +438,6 @@ and the [Agent Guide](AGENT.md) for repository conventions.

---

## 📜 License

AppleTrace is released under the MIT License. See [LICENSE](LICENSE) for details.

---

## 🙏 Acknowledgements

Inspired by Facebook's [fbtrace](https://github.com/facebookarchive/fbtrace), and
Expand All @@ -452,6 +446,12 @@ built around Google's [Perfetto](https://perfetto.dev) and the

---

## 📜 License

AppleTrace is released under the MIT License. See [LICENSE](LICENSE) for details.

---

## 📞 Support

<div align="center">
Expand All @@ -466,10 +466,6 @@ built around Google's [Perfetto](https://perfetto.dev) and the
<img src="https://img.shields.io/badge/Docs-中文教程-45B7D1?style=for-the-badge&logo=readthedocs" />
</a>

**中文交流:** 欢迎关注微信订阅号

<img src="image/wechat.png" alt="WeChat" width="150"/>

**Made with ❤️ by [Everett](https://github.com/everettjf)**

</div>
Expand Down
Loading