HPCToolkit
binarytree_uwi.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <lib/prof-lean/mcs-lock.h>
#include <lib/prof-lean/binarytree.h>
#include "binarytree_uwi.h"
Include dependency graph for binarytree_uwi.c:

Go to the source code of this file.

Macros

#define NUM_NODES   10
 
#define MAX_UWI_STR   MAX_INTERVAL_STR+MAX_RECIPE_STR+4
 

Functions

void bitree_uwi_init (mem_alloc m_alloc)
 
bitree_uwi_tbitree_uwi_malloc (unwinder_t uw, size_t recipe_size)
 
void bitree_uwi_free (unwinder_t uw, bitree_uwi_t *tree)
 
uwi_tbitree_uwi_rootval (bitree_uwi_t *tree)
 
bitree_uwi_tbitree_uwi_leftsubtree (bitree_uwi_t *tree)
 
bitree_uwi_tbitree_uwi_rightsubtree (bitree_uwi_t *tree)
 
void bitree_uwi_set_leftsubtree (bitree_uwi_t *tree, bitree_uwi_t *subtree)
 
void bitree_uwi_set_rightsubtree (bitree_uwi_t *tree, bitree_uwi_t *subtree)
 
interval_tbitree_uwi_interval (bitree_uwi_t *tree)
 
uw_recipe_tbitree_uwi_recipe (bitree_uwi_t *tree)
 
bitree_uwi_tbitree_uwi_rebalance (bitree_uwi_t *tree, int count)
 
bitree_uwi_tbitree_uwi_flatten (bitree_uwi_t *tree)
 
static int uwi_t_cmp (void *lhs, void *rhs)
 
bitree_uwi_tbitree_uwi_find (bitree_uwi_t *tree, uwi_t *val)
 
static int uwi_t_inrange (void *lhs, void *address)
 
bitree_uwi_tbitree_uwi_inrange (bitree_uwi_t *tree, uintptr_t address)
 
static void uwi_t_any_tostr (void *uwip, char str[], unwinder_t uw)
 
static void uwi_t_dwarf_tostr (void *uwip, char str[])
 
static void uwi_t_native_tostr (void *uwip, char str[])
 
void bitree_uwi_tostring_indent (bitree_uwi_t *tree, char *indents, char treestr[], unwinder_t uw)
 

Variables

struct {
   bitree_uwi_t *   tree
 
   mcs_lock_t   lock
 
   mem_alloc   alloc
 
GF [NUM_UNWINDERS]
 
static __thread bitree_uwi_t_lf_uwi_tree [NUM_UNWINDERS]
 
static void(* uwi_t_tostr [NUM_UNWINDERS])(void *uwip, char str[])
 

Macro Definition Documentation

◆ MAX_UWI_STR

#define MAX_UWI_STR   MAX_INTERVAL_STR+MAX_RECIPE_STR+4

Definition at line 204 of file binarytree_uwi.c.

◆ NUM_NODES

#define NUM_NODES   10

Definition at line 18 of file binarytree_uwi.c.

Function Documentation

◆ bitree_uwi_find()

bitree_uwi_t* bitree_uwi_find ( bitree_uwi_t tree,
uwi_t val 
)

Definition at line 174 of file binarytree_uwi.c.

Here is the call graph for this function:

◆ bitree_uwi_flatten()

bitree_uwi_t* bitree_uwi_flatten ( bitree_uwi_t tree)

Definition at line 157 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_free()

void bitree_uwi_free ( unwinder_t  uw,
bitree_uwi_t tree 
)

Definition at line 75 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_init()

void bitree_uwi_init ( mem_alloc  m_alloc)

Definition at line 32 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_inrange()

bitree_uwi_t* bitree_uwi_inrange ( bitree_uwi_t tree,
uintptr_t  address 
)

Definition at line 192 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_interval()

interval_t* bitree_uwi_interval ( bitree_uwi_t tree)

Definition at line 129 of file binarytree_uwi.c.

Here is the call graph for this function:

◆ bitree_uwi_leftsubtree()

bitree_uwi_t* bitree_uwi_leftsubtree ( bitree_uwi_t tree)

Definition at line 97 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_malloc()

bitree_uwi_t* bitree_uwi_malloc ( unwinder_t  uw,
size_t  recipe_size 
)

Definition at line 44 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_rebalance()

bitree_uwi_t* bitree_uwi_rebalance ( bitree_uwi_t tree,
int  count 
)

Definition at line 150 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_recipe()

uw_recipe_t* bitree_uwi_recipe ( bitree_uwi_t tree)

Definition at line 140 of file binarytree_uwi.c.

Here is the call graph for this function:

◆ bitree_uwi_rightsubtree()

bitree_uwi_t* bitree_uwi_rightsubtree ( bitree_uwi_t tree)

Definition at line 104 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_rootval()

uwi_t* bitree_uwi_rootval ( bitree_uwi_t tree)

Definition at line 90 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_set_leftsubtree()

void bitree_uwi_set_leftsubtree ( bitree_uwi_t tree,
bitree_uwi_t subtree 
)

Definition at line 110 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_set_rightsubtree()

void bitree_uwi_set_rightsubtree ( bitree_uwi_t tree,
bitree_uwi_t subtree 
)

Definition at line 118 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitree_uwi_tostring_indent()

void bitree_uwi_tostring_indent ( bitree_uwi_t tree,
char *  indents,
char  treestr[],
unwinder_t  uw 
)

Definition at line 236 of file binarytree_uwi.c.

Here is the call graph for this function:

◆ uwi_t_any_tostr()

static void uwi_t_any_tostr ( void *  uwip,
char  str[],
unwinder_t  uw 
)
static

Definition at line 206 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uwi_t_cmp()

static int uwi_t_cmp ( void *  lhs,
void *  rhs 
)
static

Definition at line 164 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uwi_t_dwarf_tostr()

static void uwi_t_dwarf_tostr ( void *  uwip,
char  str[] 
)
static

Definition at line 217 of file binarytree_uwi.c.

Here is the call graph for this function:

◆ uwi_t_inrange()

static int uwi_t_inrange ( void *  lhs,
void *  address 
)
static

Definition at line 185 of file binarytree_uwi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uwi_t_native_tostr()

static void uwi_t_native_tostr ( void *  uwip,
char  str[] 
)
static

Definition at line 223 of file binarytree_uwi.c.

Here is the call graph for this function:

Variable Documentation

◆ _lf_uwi_tree

__thread bitree_uwi_t* _lf_uwi_tree[NUM_UNWINDERS]
static

Definition at line 26 of file binarytree_uwi.c.

◆ alloc

mem_alloc alloc

Definition at line 23 of file binarytree_uwi.c.

◆ GF

struct { ... } GF[NUM_UNWINDERS]

◆ lock

mcs_lock_t lock

Definition at line 22 of file binarytree_uwi.c.

◆ tree

bitree_uwi_t* tree

Definition at line 21 of file binarytree_uwi.c.

◆ uwi_t_tostr

void(* uwi_t_tostr[NUM_UNWINDERS])(void *uwip, char str[])
static
Initial value:
=
{
}
static void uwi_t_native_tostr(void *uwip, char str[])
static void uwi_t_dwarf_tostr(void *uwip, char str[])

Definition at line 229 of file binarytree_uwi.c.