# Perf

### Call graph&#x20;

{% code title="Record perf data with -g " %}

```bash
perf record -g program options 
```

{% endcode %}

{% code title="Convert the reported data into txt" %}

```bash
perf report  --stdio --header > perf_report.txt 
```

{% endcode %}

### Profile using firefox

Firefox has an inbuilt profile scheme ( <https://profiler.firefox.com/> )

{% code title="Record the program" %}

```bash
perf record -g program options
```

{% endcode %}

{% code title="Convert reported data" %}

```bash
perf script -F +pid > test.perf 
```

{% endcode %}

Upload the above profile data to the  website


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://explore-vineeth.gitbook.io/mywiki/how-to/tracing-+-profiling/perf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
