HPCToolkit
uw_recipe_map.c File Reference
#include <memory/hpcrun-malloc.h>
#include <main.h>
#include "thread_data.h"
#include "uw_recipe_map.h"
#include "unwind-interval.h"
#include <fnbounds/fnbounds_interface.h>
#include <lib/prof-lean/cskiplist.h>
#include <lib/prof-lean/mcs-lock.h>
#include <lib/prof-lean/binarytree.h>
#include "binarytree_uwi.h"
#include "segv_handler.h"
#include <messages/messages.h>
#include <monitor.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for uw_recipe_map.c:

Go to the source code of this file.

Classes

struct  ilmstat_btuwi_pair_s
 

Macros

#define UW_RECIPE_MAP_DEBUG   0
 
#define UW_RECIPE_MAP_DEBUG_VERBOSE   0
 
#define SKIPLIST_HEIGHT   8
 
#define NUM_NODES   10
 
#define MAX_STAT_STR   14
 
#define LDMOD_NAME_LEN   128
 
#define MAX_ILDMODSTAT_STR   MAX_INTERVAL_STR+LDMOD_NAME_LEN+MAX_STAT_STR
 
#define uw_recipe_map_report(op, start, end)
 
#define uw_recipe_map_report_and_dump(op, start, end)
 

Typedefs

typedef struct ilmstat_btuwi_pair_s ilmstat_btuwi_pair_t
 

Functions

static int ilmstat_btuwi_pair_cmp (void *lhs, void *rhs)
 
static int ilmstat_btuwi_pair_inrange (void *itp, void *address)
 
static ilmstat_btuwi_pair_tilmstat__btuwi_pair_init (ilmstat_btuwi_pair_t *node, tree_stat_t treestat, load_module_t *lm, uintptr_t start, uintptr_t end)
 
static ilmstat_btuwi_pair_tilmstat_btuwi_pair_build (uintptr_t start, uintptr_t end, load_module_t *lm, tree_stat_t treestat, mem_alloc m_alloc)
 
static void push_free_pair (ilmstat_btuwi_pair_t **list, ilmstat_btuwi_pair_t *pair)
 
static ilmstat_btuwi_pair_tpop_free_pair (ilmstat_btuwi_pair_t **list)
 
static ilmstat_btuwi_pair_tilmstat_btuwi_pair_malloc (uintptr_t start, uintptr_t end, load_module_t *lm, tree_stat_t treestat, mem_alloc m_alloc)
 
static void ilmstat_btuwi_pair_free (ilmstat_btuwi_pair_t *pair, unwinder_t uw)
 
static void uw_recipe_map_poison (uintptr_t start, uintptr_t end, unwinder_t uw)
 
static ilmstat_btuwi_pair_tuw_recipe_map_inrange_find (uintptr_t addr, unwinder_t uw)
 
static void cskl_ilmstat_btuwi_free_uw (void *anode, unwinder_t uw)
 
static void cskl_ilmstat_btuwi_free_0 (void *anode)
 
static void cskl_ilmstat_btuwi_free_1 (void *anode)
 
static bool uw_recipe_map_cmp_del_bulk_unsynch (ilmstat_btuwi_pair_t *key, unwinder_t uw)
 
static void uw_recipe_map_unpoison (uintptr_t start, uintptr_t end, unwinder_t uw)
 
static void uw_recipe_map_repoison (uintptr_t start, uintptr_t end, unwinder_t uw)
 
static void uw_recipe_map_notify_map (void *start, void *end)
 
static void uw_recipe_map_notify_unmap (void *start, void *end)
 
static void uw_recipe_map_notify_init ()
 
void uw_recipe_map_init (void)
 
bool uw_recipe_map_lookup (void *addr, unwinder_t uw, unwindr_info_t *unwr_info)
 

Variables

static ilmstat_btuwi_pair_tGF_ilmstat_btuwi = NULL
 
static mcs_lock_t GFL_lock
 
static __thread ilmstat_btuwi_pair_t_lf_ilmstat_btuwi = NULL
 
static cskiplist_taddr2recipe_map [NUM_UNWINDERS]
 
static mem_alloc my_alloc = hpcrun_malloc
 
static void(* cskl_ilmstat_btuwi_free [])(void *anode)
 

Macro Definition Documentation

◆ LDMOD_NAME_LEN

#define LDMOD_NAME_LEN   128

Definition at line 284 of file uw_recipe_map.c.

◆ MAX_ILDMODSTAT_STR

#define MAX_ILDMODSTAT_STR   MAX_INTERVAL_STR+LDMOD_NAME_LEN+MAX_STAT_STR

Definition at line 285 of file uw_recipe_map.c.

◆ MAX_STAT_STR

#define MAX_STAT_STR   14

Definition at line 283 of file uw_recipe_map.c.

◆ NUM_NODES

#define NUM_NODES   10

Definition at line 111 of file uw_recipe_map.c.

◆ SKIPLIST_HEIGHT

#define SKIPLIST_HEIGHT   8

Definition at line 109 of file uw_recipe_map.c.

◆ UW_RECIPE_MAP_DEBUG

#define UW_RECIPE_MAP_DEBUG   0

Definition at line 60 of file uw_recipe_map.c.

◆ UW_RECIPE_MAP_DEBUG_VERBOSE

#define UW_RECIPE_MAP_DEBUG_VERBOSE   0

Definition at line 62 of file uw_recipe_map.c.

◆ uw_recipe_map_report

#define uw_recipe_map_report (   op,
  start,
  end 
)

Definition at line 299 of file uw_recipe_map.c.

◆ uw_recipe_map_report_and_dump

#define uw_recipe_map_report_and_dump (   op,
  start,
  end 
)

Definition at line 440 of file uw_recipe_map.c.

Typedef Documentation

◆ ilmstat_btuwi_pair_t

Function Documentation

◆ cskl_ilmstat_btuwi_free_0()

static void cskl_ilmstat_btuwi_free_0 ( void *  anode)
static

Definition at line 481 of file uw_recipe_map.c.

Here is the call graph for this function:

◆ cskl_ilmstat_btuwi_free_1()

static void cskl_ilmstat_btuwi_free_1 ( void *  anode)
static

Definition at line 488 of file uw_recipe_map.c.

Here is the call graph for this function:

◆ cskl_ilmstat_btuwi_free_uw()

static void cskl_ilmstat_btuwi_free_uw ( void *  anode,
unwinder_t  uw 
)
static

Definition at line 467 of file uw_recipe_map.c.

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

◆ ilmstat__btuwi_pair_init()

static ilmstat_btuwi_pair_t* ilmstat__btuwi_pair_init ( ilmstat_btuwi_pair_t node,
tree_stat_t  treestat,
load_module_t lm,
uintptr_t  start,
uintptr_t  end 
)
inlinestatic

Definition at line 162 of file uw_recipe_map.c.

Here is the caller graph for this function:

◆ ilmstat_btuwi_pair_build()

static ilmstat_btuwi_pair_t* ilmstat_btuwi_pair_build ( uintptr_t  start,
uintptr_t  end,
load_module_t lm,
tree_stat_t  treestat,
mem_alloc  m_alloc 
)
inlinestatic

Definition at line 177 of file uw_recipe_map.c.

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

◆ ilmstat_btuwi_pair_cmp()

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

Definition at line 132 of file uw_recipe_map.c.

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

◆ ilmstat_btuwi_pair_free()

static void ilmstat_btuwi_pair_free ( ilmstat_btuwi_pair_t pair,
unwinder_t  uw 
)
static

Definition at line 255 of file uw_recipe_map.c.

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

◆ ilmstat_btuwi_pair_inrange()

static int ilmstat_btuwi_pair_inrange ( void *  itp,
void *  address 
)
static

Definition at line 146 of file uw_recipe_map.c.

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

◆ ilmstat_btuwi_pair_malloc()

static ilmstat_btuwi_pair_t* ilmstat_btuwi_pair_malloc ( uintptr_t  start,
uintptr_t  end,
load_module_t lm,
tree_stat_t  treestat,
mem_alloc  m_alloc 
)
static

Definition at line 200 of file uw_recipe_map.c.

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

◆ pop_free_pair()

static ilmstat_btuwi_pair_t* pop_free_pair ( ilmstat_btuwi_pair_t **  list)
inlinestatic

Definition at line 192 of file uw_recipe_map.c.

Here is the caller graph for this function:

◆ push_free_pair()

static void push_free_pair ( ilmstat_btuwi_pair_t **  list,
ilmstat_btuwi_pair_t pair 
)
inlinestatic

Definition at line 185 of file uw_recipe_map.c.

Here is the caller graph for this function:

◆ uw_recipe_map_cmp_del_bulk_unsynch()

static bool uw_recipe_map_cmp_del_bulk_unsynch ( ilmstat_btuwi_pair_t key,
unwinder_t  uw 
)
static

Definition at line 497 of file uw_recipe_map.c.

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

◆ uw_recipe_map_init()

void uw_recipe_map_init ( void  )

Definition at line 602 of file uw_recipe_map.c.

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

◆ uw_recipe_map_inrange_find()

static ilmstat_btuwi_pair_t* uw_recipe_map_inrange_find ( uintptr_t  addr,
unwinder_t  uw 
)
static

Definition at line 461 of file uw_recipe_map.c.

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

◆ uw_recipe_map_lookup()

bool uw_recipe_map_lookup ( void *  addr,
unwinder_t  uw,
unwindr_info_t unwr_info 
)

Definition at line 639 of file uw_recipe_map.c.

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

◆ uw_recipe_map_notify_init()

static void uw_recipe_map_notify_init ( )
static

Definition at line 586 of file uw_recipe_map.c.

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

◆ uw_recipe_map_notify_map()

static void uw_recipe_map_notify_map ( void *  start,
void *  end 
)
static

Definition at line 555 of file uw_recipe_map.c.

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

◆ uw_recipe_map_notify_unmap()

static void uw_recipe_map_notify_unmap ( void *  start,
void *  end 
)
static

Definition at line 568 of file uw_recipe_map.c.

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

◆ uw_recipe_map_poison()

static void uw_recipe_map_poison ( uintptr_t  start,
uintptr_t  end,
unwinder_t  uw 
)
static

Definition at line 444 of file uw_recipe_map.c.

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

◆ uw_recipe_map_repoison()

static void uw_recipe_map_repoison ( uintptr_t  start,
uintptr_t  end,
unwinder_t  uw 
)
static

Definition at line 527 of file uw_recipe_map.c.

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

◆ uw_recipe_map_unpoison()

static void uw_recipe_map_unpoison ( uintptr_t  start,
uintptr_t  end,
unwinder_t  uw 
)
static

Definition at line 505 of file uw_recipe_map.c.

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

Variable Documentation

◆ _lf_ilmstat_btuwi

__thread ilmstat_btuwi_pair_t* _lf_ilmstat_btuwi = NULL
static

Definition at line 154 of file uw_recipe_map.c.

◆ addr2recipe_map

cskiplist_t* addr2recipe_map[NUM_UNWINDERS]
static

Definition at line 272 of file uw_recipe_map.c.

◆ cskl_ilmstat_btuwi_free

void(* cskl_ilmstat_btuwi_free[])(void *anode)
static
Initial value:
=
static void cskl_ilmstat_btuwi_free_0(void *anode)
static void cskl_ilmstat_btuwi_free_1(void *anode)

Definition at line 493 of file uw_recipe_map.c.

◆ GF_ilmstat_btuwi

ilmstat_btuwi_pair_t* GF_ilmstat_btuwi = NULL
static

Definition at line 152 of file uw_recipe_map.c.

◆ GFL_lock

mcs_lock_t GFL_lock
static

Definition at line 153 of file uw_recipe_map.c.

◆ my_alloc

mem_alloc my_alloc = hpcrun_malloc
static

Definition at line 276 of file uw_recipe_map.c.