lbr_stitch
struct lbr_stitch *lbr_stitch = thread__lbr_stitch(thread);
if (!lbr_stitch)
lbr_stitch->prev_lbr_cursor[idx].valid = false;
map_symbol__exit(&lbr_stitch->prev_lbr_cursor[idx].ms);
memcpy(&lbr_stitch->prev_lbr_cursor[idx], cursor->curr,
lbr_stitch->prev_lbr_cursor[idx].ms.thread = thread__get(cursor->curr->ms.thread);
lbr_stitch->prev_lbr_cursor[idx].ms.map = map__get(cursor->curr->ms.map);
lbr_stitch->prev_lbr_cursor[idx].valid = true;
struct lbr_stitch *lbr_stitch = thread__lbr_stitch(thread);
list_for_each_entry(stitch_node, &lbr_stitch->lists, node) {
struct lbr_stitch *lbr_stitch = thread__lbr_stitch(thread);
if (!list_empty(&lbr_stitch->free_lists)) {
stitch_node = list_first_entry(&lbr_stitch->free_lists,
struct lbr_stitch *lbr_stitch = thread__lbr_stitch(thread);
if (!lbr_stitch->prev_lbr_cursor[i].valid)
memcpy(&stitch_node->cursor, &lbr_stitch->prev_lbr_cursor[i],
thread__get(lbr_stitch->prev_lbr_cursor[i].ms.thread);
stitch_node->cursor.ms.map = map__get(lbr_stitch->prev_lbr_cursor[i].ms.map);
list_add(&stitch_node->node, &lbr_stitch->lists);
list_add_tail(&stitch_node->node, &lbr_stitch->lists);
thread__set_lbr_stitch(thread, zalloc(sizeof(struct lbr_stitch)));
struct lbr_stitch *lbr_stitch;
lbr_stitch = thread__lbr_stitch(thread);
&lbr_stitch->prev_sample,
if (!stitched_lbr && !list_empty(&lbr_stitch->lists)) {
list_for_each_entry(stitch_node, &lbr_stitch->lists, node)
list_splice_init(&lbr_stitch->lists, &lbr_stitch->free_lists);
memcpy(&lbr_stitch->prev_sample, sample, sizeof(*sample));
struct lbr_stitch *lbr_stitch = thread__lbr_stitch(thread);
if (!lbr_stitch)
list_for_each_entry_safe(pos, tmp, &lbr_stitch->lists, node) {
list_for_each_entry_safe(pos, tmp, &lbr_stitch->free_lists, node) {
for (unsigned int i = 0 ; i < lbr_stitch->prev_lbr_cursor_size; i++)
map_symbol__exit(&lbr_stitch->prev_lbr_cursor[i].ms);
zfree(&lbr_stitch->prev_lbr_cursor);
static inline struct lbr_stitch *thread__lbr_stitch(struct thread *thread)
return RC_CHK_ACCESS(thread)->lbr_stitch;
static inline void thread__set_lbr_stitch(struct thread *thread, struct lbr_stitch *lbrs)
RC_CHK_ACCESS(thread)->lbr_stitch = lbrs;
struct lbr_stitch *lbr_stitch;