Go to the source code of this file.
|
static int | udebug_remote_get_handle (struct udebug *ctx) |
|
struct udebug_remote_buf * | udebug_remote_buf_get (struct udebug *ctx, uint32_t id) |
|
int | udebug_remote_buf_map (struct udebug *ctx, struct udebug_remote_buf *rb, uint32_t id) |
|
void | udebug_remote_buf_unmap (struct udebug *ctx, struct udebug_remote_buf *rb) |
|
int | udebug_remote_buf_set_poll (struct udebug *ctx, struct udebug_remote_buf *rb, bool val) |
|
static void | rbuf_advance_read_head (struct udebug_remote_buf *rb, uint32_t head, uint32_t *data_start) |
|
void | udebug_remote_buf_set_start_time (struct udebug_remote_buf *rb, uint64_t ts) |
|
void | udebug_remote_buf_set_start_offset (struct udebug_remote_buf *rb, uint32_t idx) |
|
void | udebug_remote_buf_set_flags (struct udebug_remote_buf *rb, uint64_t mask, uint64_t set) |
|
struct udebug_snapshot * | udebug_remote_buf_snapshot (struct udebug_remote_buf *rb) |
|
bool | udebug_snapshot_get_entry (struct udebug_snapshot *s, struct udebug_iter *it, unsigned int entry) |
|
void | udebug_iter_start (struct udebug_iter *it, struct udebug_snapshot **s, size_t n) |
|
bool | udebug_iter_next (struct udebug_iter *it) |
|
◆ rbuf_advance_read_head()
static void rbuf_advance_read_head |
( |
struct udebug_remote_buf * |
rb, |
|
|
uint32_t |
head, |
|
|
uint32_t * |
data_start |
|
) |
| |
|
static |
Definition at line 112 of file udebug-remote.c.
135 __sync_synchronize();
static uint32_t u32_get(void *ptr)
static int32_t u32_sub(uint32_t a, uint32_t b)
static struct udebug_ptr * udebug_ring_ptr(struct udebug_hdr *hdr, uint32_t idx)
◆ udebug_iter_next()
Definition at line 325 of file udebug-remote.c.
332 for (
size_t i = 0; i < it->
n; i++) {
struct udebug_snapshot ** list
struct udebug_ptr * entries
bool udebug_snapshot_get_entry(struct udebug_snapshot *s, struct udebug_iter *it, unsigned int entry)
◆ udebug_iter_start()
Definition at line 314 of file udebug-remote.c.
316 memset(it, 0,
sizeof(*it));
321 for (
size_t i = 0; i < it->
n; i++)
◆ udebug_remote_buf_get()
Definition at line 39 of file udebug-remote.c.
42 void *key = (
void *)(uintptr_t)
id;
#define avl_find_element(tree, key, element, node_element)
struct avl_tree remote_rings
◆ udebug_remote_buf_map()
Definition at line 47 of file udebug-remote.c.
49 void *key = (
void *)(uintptr_t)
id;
int avl_insert(struct avl_tree *tree, struct avl_node *new)
struct udebug_client_msg * msg
struct udebug_client_msg * udebug_send_and_wait(struct udebug *ctx, struct udebug_client_msg *msg, int *rfd)
int udebug_buf_open(struct udebug_buf *buf, int fd, uint32_t ring_size, uint32_t data_size)
static bool udebug_is_connected(struct udebug *ctx)
◆ udebug_remote_buf_set_flags()
void udebug_remote_buf_set_flags |
( |
struct udebug_remote_buf * |
rb, |
|
|
uint64_t |
mask, |
|
|
uint64_t |
set |
|
) |
| |
Definition at line 181 of file udebug-remote.c.
189 __atomic_and_fetch(&hdr->
flags[0], (uintptr_t)~mask, __ATOMIC_RELAXED);
191 __atomic_or_fetch(&hdr->
flags[0], (uintptr_t)set, __ATOMIC_RELAXED);
193 if (
sizeof(mask) ==
sizeof(
unsigned long))
198 __atomic_and_fetch(&hdr->
flags[1], (uintptr_t)~mask, __ATOMIC_RELAXED);
200 __atomic_or_fetch(&hdr->
flags[1], (uintptr_t)set, __ATOMIC_RELAXED);
uintptr_t flags[8/sizeof(uintptr_t)]
◆ udebug_remote_buf_set_poll()
Definition at line 89 of file udebug-remote.c.
107 __atomic_fetch_or(&rb->
buf.
hdr->
notify, 1UL << handle, __ATOMIC_RELAXED);
static int udebug_remote_get_handle(struct udebug *ctx)
◆ udebug_remote_buf_set_start_offset()
void udebug_remote_buf_set_start_offset |
( |
struct udebug_remote_buf * |
rb, |
|
|
uint32_t |
idx |
|
) |
| |
◆ udebug_remote_buf_set_start_time()
Definition at line 148 of file udebug-remote.c.
152 uint32_t start = rb->
head, end =
head;
159 while ((diff =
u32_sub(end, start)) > 0) {
160 uint32_t cur = start + diff / 2;
static void rbuf_advance_read_head(struct udebug_remote_buf *rb, uint32_t head, uint32_t *data_start)
◆ udebug_remote_buf_snapshot()
Definition at line 204 of file udebug-remote.c.
208 uint32_t data_start, data_end, data_used;
212 uint32_t head, first_idx;
213 uint32_t prev_read_head = rb->
head;
221 if (rb->
head == head)
224 first_idx = rb->
head;
227 data_end = last_ptr->
start + last_ptr->
len;
230 ptr_size = head - rb->
head;
237 &ptr_buf, ptr_size *
sizeof(*ptr_buf),
245 if (first_ptr > last_ptr) {
248 uint32_t size = end_ptr - first_ptr;
250 memcpy(s->
entries + size, start_ptr, (last_ptr + 1 - start_ptr) *
sizeof(*s->
entries));
252 memcpy(s->
entries, first_ptr, (last_ptr + 1 - first_ptr) *
sizeof(*s->
entries));
257 __sync_synchronize();
278 for (
size_t i = 0; i < s->
n_entries; i++)
enum udebug_format format
int uint32_t uint32_t data_size
static void * udebug_buf_ptr(struct udebug_buf *buf, uint32_t ofs)
#define calloc_a(len,...)
◆ udebug_remote_buf_unmap()
Definition at line 77 of file udebug-remote.c.
void avl_delete(struct avl_tree *tree, struct avl_node *node)
void udebug_buf_free(struct udebug_buf *buf)
◆ udebug_remote_get_handle()
static int udebug_remote_get_handle |
( |
struct udebug * |
ctx | ) |
|
|
static |
◆ udebug_snapshot_get_entry()