Class to manage hardware watchpoins.
More...
#include <KittyPerfEvent.hpp>
|
| bool | add (pid_t tid, uintptr_t addr, KT_WATCH_TYPE bp_type, KT_WATCH_LEN bp_len) |
| | Adds a new hardware watchpoint to the watch list.
|
| void | poll (int timeout_ms, const std::function< bool(const KittyPerfSample &)> &cb) |
| | Polls the watch list for new samples.
|
|
void | clear () |
| | Clears all watchpoints from the watch list.
|
|
|
static int | perf_event_open (struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags) |
Class to manage hardware watchpoins.
◆ add()
| bool KittyPerfWatch::add |
( |
pid_t | tid, |
|
|
uintptr_t | addr, |
|
|
KT_WATCH_TYPE | bp_type, |
|
|
KT_WATCH_LEN | bp_len ) |
Adds a new hardware watchpoint to the watch list.
- Parameters
-
| tid | The thread ID to attach the watchpoint to. |
| addr | The address to watch. |
| bp_type | The type of watchpoint (read, write, or read/write). |
| bp_len | The length of the watchpoint in bytes. |
- Returns
- True if the watchpoint was added successfully, false otherwise.
◆ poll()
| void KittyPerfWatch::poll |
( |
int | timeout_ms, |
|
|
const std::function< bool(const KittyPerfSample &)> & | cb ) |
Polls the watch list for new samples.
- Parameters
-
| timeout_ms | The maximum time to wait for new samples in milliseconds. |
| cb | A callback function to process each new sample. |
The documentation for this class was generated from the following file: