# scope_profiler.plotting_scripts.perf_events

*module*

Bar charts for built-in Linux perf-event counter totals and ratios.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/perf_events.py#L1-L1)

## scope_profiler.plotting_scripts.perf_events.available_perf_event_metrics

*function*

```python
def available_perf_event_metrics(profiling_data: ProfilingResults | Sequence[ProfilingResults]) -> list[str]
```

List available raw events and valid derived perf-event ratios.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/perf_events.py#L31-L47)

## scope_profiler.plotting_scripts.perf_events.plot_perf_events

*function*

```python
def plot_perf_events(profiling_data: ProfilingResults | Sequence[ProfilingResults], metric: str = 'ipc', ranks: list[int] | int | None = None, include: list[str] | str | None = None, exclude: list[str] | str | None = None, labels: Sequence[str] | None = None, filepath: str | None = None, show: bool = False, verbose: bool = True, cmap: str = DEFAULT_CMAP, backend: str = 'matplotlib') -> None
```

Plot one raw perf event or derived ratio for every region and rank.

``metric`` may be an event name recorded in the run, ``"ipc"``
(instructions/cycle), or ``"cache-misses-per-ki"``. Derived metrics are
calculated from the region's aggregated counters, not averages of call
ratios, which preserves their proper weighting.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/perf_events.py#L62-L149)
