# Trace events functions

```
// Return the total number of recorded events
long get_tev_qty();

// Return the address of the specified event
//       tev - event number
long get_tev_ea(long tev);

// Return the type of the specified event (TEV_... constants)
//       tev - event number
long get_tev_type(long tev);

#define TEV_NONE  0 // no event
#define TEV_INSN  1 // an instruction trace
#define TEV_CALL  2 // a function call trace
#define TEV_RET   3 // a function return trace
#define TEV_BPT   4 // write, read/write, execution trace
#define TEV_MEM   5 // memory layout changed
#define TEV_EVENT 6 // debug event

// Return the thread id of the specified event
//       tev - event number
long get_tev_tid(long tev);

// Return the register value for the specified event
//       tev - event number
//       reg - register name (like EAX, RBX, ...)
long get_tev_reg(long tev, string reg);

// Return the number of memory addresses recorded for the specified event
//       tev - event number
long get_tev_mem_qty(long tev);

// Return the memory pointed by 'index' for the specified event
//       tev - event number
//       idx - memory address index
string get_tev_mem(long tev, long idx);

// Return the address pointed by 'index' for the specified event
//       tev - event number
//       idx - memory address index
string get_tev_mem_ea(long tev, long idx);

// Return the address of the callee for the specified event
//       tev - event number
long get_call_tev_callee(long tev);

// Return the return address for the specified event
//       tev - event number
long get_ret_tev_return(long tev);

// Return the address of the specified TEV_BPT event
//       tev - event number
long get_bpt_tev_ea(long tev);
```


---

# 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://docs.hex-rays.com/9.0sp1/developer-guide/idc/idc-api-reference/alphabetical-list-of-idc-functions/1651.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.
