brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.3 KiB · 995241f Raw
236 lines · c
1#if USE_DEBUGGER2/*3 * kmp_omp.h -- OpenMP definition for kmp_omp_struct_info_t.4 *              This is for information about runtime library structures.5 */6 7//===----------------------------------------------------------------------===//8//9// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.10// See https://llvm.org/LICENSE.txt for license information.11// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception12//13//===----------------------------------------------------------------------===//14 15/* THIS FILE SHOULD NOT BE MODIFIED IN IDB INTERFACE LIBRARY CODE16   It should instead be modified in the OpenMP runtime and copied to the17   interface library code.  This way we can minimize the problems that this is18   sure to cause having two copies of the same file.19 20   Files live in libomp and libomp_db/src/include  */21 22/* CHANGE THIS WHEN STRUCTURES BELOW CHANGE23   Before we release this to a customer, please don't change this value.  After24   it is released and stable, then any new updates to the structures or data25   structure traversal algorithms need to change this value. */26#define KMP_OMP_VERSION 927 28typedef struct {29  kmp_int32 offset;30  kmp_int32 size;31} offset_and_size_t;32 33typedef struct {34  kmp_uint64 addr;35  kmp_int32 size;36  kmp_int32 padding;37} addr_and_size_t;38 39typedef struct {40  kmp_uint64 flags; // Flags for future extensions.41  kmp_uint6442      file; // Pointer to name of source file where the parallel region is.43  kmp_uint64 func; // Pointer to name of routine where the parallel region is.44  kmp_int32 begin; // Beginning of source line range.45  kmp_int32 end; // End of source line range.46  kmp_int32 num_threads; // Specified number of threads.47} kmp_omp_nthr_item_t;48 49typedef struct {50  kmp_int32 num; // Number of items in the array.51  kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t.52} kmp_omp_nthr_info_t;53 54/* This structure is known to the idb interface library */55typedef struct {56 57  /* Change this only if you make a fundamental data structure change here */58  kmp_int32 lib_version;59 60  /* sanity check.  Only should be checked if versions are identical61   * This is also used for backward compatibility to get the runtime62   * structure size if it the runtime is older than the interface */63  kmp_int32 sizeof_this_structure;64 65  /* OpenMP RTL version info. */66  addr_and_size_t major;67  addr_and_size_t minor;68  addr_and_size_t build;69  addr_and_size_t openmp_version;70  addr_and_size_t banner;71 72  /* Various globals. */73  addr_and_size_t threads; // Pointer to __kmp_threads.74  addr_and_size_t roots; // Pointer to __kmp_root.75  addr_and_size_t capacity; // Pointer to __kmp_threads_capacity.76#if KMP_USE_MONITOR77  addr_and_size_t monitor; // Pointer to __kmp_monitor.78#endif79#if !KMP_USE_DYNAMIC_LOCK80  addr_and_size_t lock_table; // Pointer to __kmp_lock_table.81#endif82  addr_and_size_t func_microtask;83  addr_and_size_t func_fork;84  addr_and_size_t func_fork_teams;85  addr_and_size_t team_counter;86  addr_and_size_t task_counter;87  addr_and_size_t nthr_info;88  kmp_int32 address_width;89  kmp_int32 indexed_locks;90  kmp_int32 last_barrier; // The end in enum barrier_type91  kmp_int32 deque_size; // TASK_DEQUE_SIZE92 93  /* thread structure information. */94  kmp_int32 th_sizeof_struct;95  offset_and_size_t th_info; // descriptor for thread96  offset_and_size_t th_team; // team for this thread97  offset_and_size_t th_root; // root for this thread98  offset_and_size_t th_serial_team; // serial team under this thread99  offset_and_size_t th_ident; // location for this thread (if available)100  offset_and_size_t th_spin_here; // is thread waiting for lock (if available)101  offset_and_size_t102      th_next_waiting; // next thread waiting for lock (if available)103  offset_and_size_t th_task_team; // task team struct104  offset_and_size_t th_current_task; // innermost task being executed105  offset_and_size_t106      th_task_state; // alternating 0/1 for task team identification107  offset_and_size_t th_bar;108  offset_and_size_t th_b_worker_arrived; // the worker increases it by 1 when it109  // arrives to the barrier110 111  /* teams information */112  offset_and_size_t th_teams_microtask; // entry address for teams construct113  offset_and_size_t th_teams_level; // initial level of teams construct114  offset_and_size_t th_teams_nteams; // number of teams in a league115  offset_and_size_t116      th_teams_nth; // number of threads in each team of the league117 118  /* kmp_desc structure (for info field above) */119  kmp_int32 ds_sizeof_struct;120  offset_and_size_t ds_tid; // team thread id121  offset_and_size_t ds_gtid; // global thread id122  offset_and_size_t ds_thread; // native thread id123 124  /* team structure information */125  kmp_int32 t_sizeof_struct;126  offset_and_size_t t_master_tid; // tid of primary thread in parent team127  offset_and_size_t t_ident; // location of parallel region128  offset_and_size_t t_parent; // parent team129  offset_and_size_t t_nproc; // # team threads130  offset_and_size_t t_threads; // array of threads131  offset_and_size_t t_serialized; // # levels of serialized teams132  offset_and_size_t t_id; // unique team id133  offset_and_size_t t_pkfn;134  offset_and_size_t t_task_team; // task team structure135  offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task136  offset_and_size_t t_cancel_request;137  offset_and_size_t t_bar;138  offset_and_size_t139      t_b_master_arrived; // incremented when primary thread reaches barrier140  offset_and_size_t141      t_b_team_arrived; // increased by one when all the threads arrived142 143  /* root structure information */144  kmp_int32 r_sizeof_struct;145  offset_and_size_t r_root_team; // team at root146  offset_and_size_t r_hot_team; // hot team for this root147  offset_and_size_t r_uber_thread; // root thread148  offset_and_size_t r_root_id; // unique root id (if available)149 150  /* ident structure information */151  kmp_int32 id_sizeof_struct;152  offset_and_size_t153      id_psource; /* address of string ";file;func;line1;line2;;". */154  offset_and_size_t id_flags;155 156  /* lock structure information */157  kmp_int32 lk_sizeof_struct;158  offset_and_size_t lk_initialized;159  offset_and_size_t lk_location;160  offset_and_size_t lk_tail_id;161  offset_and_size_t lk_head_id;162  offset_and_size_t lk_next_ticket;163  offset_and_size_t lk_now_serving;164  offset_and_size_t lk_owner_id;165  offset_and_size_t lk_depth_locked;166  offset_and_size_t lk_lock_flags;167 168#if !KMP_USE_DYNAMIC_LOCK169  /* lock_table_t */170  kmp_int32 lt_size_of_struct; /* Size and layout of kmp_lock_table_t. */171  offset_and_size_t lt_used;172  offset_and_size_t lt_allocated;173  offset_and_size_t lt_table;174#endif175 176  /* task_team_t */177  kmp_int32 tt_sizeof_struct;178  offset_and_size_t tt_threads_data;179  offset_and_size_t tt_found_tasks;180  offset_and_size_t tt_nproc;181  offset_and_size_t tt_unfinished_threads;182  offset_and_size_t tt_active;183 184  /* kmp_taskdata_t */185  kmp_int32 td_sizeof_struct;186  offset_and_size_t td_task_id; // task id187  offset_and_size_t td_flags; // task flags188  offset_and_size_t td_team; // team for this task189  offset_and_size_t td_parent; // parent task190  offset_and_size_t td_level; // task testing level191  offset_and_size_t td_ident; // task identifier192  offset_and_size_t td_allocated_child_tasks; // child tasks (+ current task)193  // not yet deallocated194  offset_and_size_t td_incomplete_child_tasks; // child tasks not yet complete195 196  /* Taskwait */197  offset_and_size_t td_taskwait_ident;198  offset_and_size_t td_taskwait_counter;199  offset_and_size_t200      td_taskwait_thread; // gtid + 1 of thread encountered taskwait201 202  /* Taskgroup */203  offset_and_size_t td_taskgroup; // pointer to the current taskgroup204  offset_and_size_t205      td_task_count; // number of allocated and not yet complete tasks206  offset_and_size_t td_cancel; // request for cancellation of this taskgroup207 208  /* Task dependency */209  offset_and_size_t210      td_depnode; // pointer to graph node if the task has dependencies211  offset_and_size_t dn_node;212  offset_and_size_t dn_next;213  offset_and_size_t dn_successors;214  offset_and_size_t dn_task;215  offset_and_size_t dn_npredecessors;216  offset_and_size_t dn_nrefs;217  offset_and_size_t dn_routine;218 219  /* kmp_thread_data_t */220  kmp_int32 hd_sizeof_struct;221  offset_and_size_t hd_deque;222  offset_and_size_t hd_deque_size;223  offset_and_size_t hd_deque_head;224  offset_and_size_t hd_deque_tail;225  offset_and_size_t hd_deque_ntasks;226  offset_and_size_t hd_deque_last_stolen;227 228  // The last field of stable version.229  kmp_uint64 last_field;230 231} kmp_omp_struct_info_t;232 233#endif /* USE_DEBUGGER */234 235/* end of file */236