Jonathan Peyton | 8fbb49a | 2015-07-09 18:16:58 +0000 | [diff] [blame] | 1 | #if USE_DEBUGGER |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 2 | /* |
| 3 | * kmp_omp.h -- OpenMP definition for kmp_omp_struct_info_t. |
| 4 | * This is for information about runtime library structures. |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 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-exception |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 15 | /* THIS FILE SHOULD NOT BE MODIFIED IN IDB INTERFACE LIBRARY CODE |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 16 | It should instead be modified in the OpenMP runtime and copied to the |
| 17 | interface library code. This way we can minimize the problems that this is |
| 18 | sure to cause having two copies of the same file. |
| 19 | |
| 20 | Files live in libomp and libomp_db/src/include */ |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 21 | |
| 22 | /* CHANGE THIS WHEN STRUCTURES BELOW CHANGE |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 23 | Before we release this to a customer, please don't change this value. After |
| 24 | it is released and stable, then any new updates to the structures or data |
| 25 | structure traversal algorithms need to change this value. */ |
Andrey Churbanov | 440af7e | 2015-02-10 19:53:13 +0000 | [diff] [blame] | 26 | #define KMP_OMP_VERSION 9 |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 27 | |
| 28 | typedef struct { |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 29 | kmp_int32 offset; |
| 30 | kmp_int32 size; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 31 | } offset_and_size_t; |
| 32 | |
| 33 | typedef struct { |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 34 | kmp_uint64 addr; |
| 35 | kmp_int32 size; |
| 36 | kmp_int32 padding; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 37 | } addr_and_size_t; |
| 38 | |
| 39 | typedef struct { |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 40 | kmp_uint64 flags; // Flags for future extensions. |
| 41 | kmp_uint64 |
| 42 | 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. |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 47 | } kmp_omp_nthr_item_t; |
| 48 | |
| 49 | typedef struct { |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 50 | kmp_int32 num; // Number of items in the arrray. |
| 51 | kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t. |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 52 | } kmp_omp_nthr_info_t; |
| 53 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 54 | /* This structure is known to the idb interface library */ |
| 55 | typedef struct { |
| 56 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 57 | /* Change this only if you make a fundamental data structure change here */ |
| 58 | kmp_int32 lib_version; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 59 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 60 | /* sanity check. Only should be checked if versions are identical |
| 61 | * This is also used for backward compatibility to get the runtime |
| 62 | * structure size if it the runtime is older than the interface */ |
| 63 | kmp_int32 sizeof_this_structure; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 64 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 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; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 71 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 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. |
Jonathan Peyton | 37e2ef5 | 2018-07-09 17:36:22 +0000 | [diff] [blame] | 76 | #if KMP_USE_MONITOR |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 77 | addr_and_size_t monitor; // Pointer to __kmp_monitor. |
Jonathan Peyton | 37e2ef5 | 2018-07-09 17:36:22 +0000 | [diff] [blame] | 78 | #endif |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 79 | #if !KMP_USE_DYNAMIC_LOCK |
| 80 | addr_and_size_t lock_table; // Pointer to __kmp_lock_table. |
Andrey Churbanov | 5c56fb5 | 2015-02-20 18:05:17 +0000 | [diff] [blame] | 81 | #endif |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 82 | 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_type |
| 91 | kmp_int32 deque_size; // TASK_DEQUE_SIZE |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 92 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 93 | /* thread structure information. */ |
| 94 | kmp_int32 th_sizeof_struct; |
| 95 | offset_and_size_t th_info; // descriptor for thread |
| 96 | offset_and_size_t th_team; // team for this thread |
| 97 | offset_and_size_t th_root; // root for this thread |
| 98 | offset_and_size_t th_serial_team; // serial team under this thread |
| 99 | 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_t |
| 102 | th_next_waiting; // next thread waiting for lock (if available) |
| 103 | offset_and_size_t th_task_team; // task team struct |
| 104 | offset_and_size_t th_current_task; // innermost task being executed |
| 105 | offset_and_size_t |
| 106 | th_task_state; // alternating 0/1 for task team identification |
| 107 | offset_and_size_t th_bar; |
| 108 | offset_and_size_t th_b_worker_arrived; // the worker increases it by 1 when it |
| 109 | // arrives to the barrier |
Andrey Churbanov | 440af7e | 2015-02-10 19:53:13 +0000 | [diff] [blame] | 110 | |
Jonathan Peyton | 441f337 | 2015-09-21 17:24:46 +0000 | [diff] [blame] | 111 | #if OMP_40_ENABLED |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 112 | /* teams information */ |
| 113 | offset_and_size_t th_teams_microtask; // entry address for teams construct |
| 114 | offset_and_size_t th_teams_level; // initial level of teams construct |
| 115 | offset_and_size_t th_teams_nteams; // number of teams in a league |
| 116 | offset_and_size_t |
| 117 | th_teams_nth; // number of threads in each team of the league |
Jonathan Peyton | 441f337 | 2015-09-21 17:24:46 +0000 | [diff] [blame] | 118 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 119 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 120 | /* kmp_desc structure (for info field above) */ |
| 121 | kmp_int32 ds_sizeof_struct; |
| 122 | offset_and_size_t ds_tid; // team thread id |
| 123 | offset_and_size_t ds_gtid; // global thread id |
| 124 | offset_and_size_t ds_thread; // native thread id |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 125 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 126 | /* team structure information */ |
| 127 | kmp_int32 t_sizeof_struct; |
| 128 | offset_and_size_t t_master_tid; // tid of master in parent team |
| 129 | offset_and_size_t t_ident; // location of parallel region |
| 130 | offset_and_size_t t_parent; // parent team |
| 131 | offset_and_size_t t_nproc; // # team threads |
| 132 | offset_and_size_t t_threads; // array of threads |
| 133 | offset_and_size_t t_serialized; // # levels of serialized teams |
| 134 | offset_and_size_t t_id; // unique team id |
| 135 | offset_and_size_t t_pkfn; |
| 136 | offset_and_size_t t_task_team; // task team structure |
| 137 | offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task |
Jonathan Peyton | 441f337 | 2015-09-21 17:24:46 +0000 | [diff] [blame] | 138 | #if OMP_40_ENABLED |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 139 | offset_and_size_t t_cancel_request; |
Jonathan Peyton | 441f337 | 2015-09-21 17:24:46 +0000 | [diff] [blame] | 140 | #endif |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 141 | offset_and_size_t t_bar; |
| 142 | offset_and_size_t |
| 143 | t_b_master_arrived; // increased by 1 when master arrives to a barrier |
| 144 | offset_and_size_t |
| 145 | t_b_team_arrived; // increased by one when all the threads arrived |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 146 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 147 | /* root structure information */ |
| 148 | kmp_int32 r_sizeof_struct; |
| 149 | offset_and_size_t r_root_team; // team at root |
| 150 | offset_and_size_t r_hot_team; // hot team for this root |
| 151 | offset_and_size_t r_uber_thread; // root thread |
| 152 | offset_and_size_t r_root_id; // unique root id (if available) |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 153 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 154 | /* ident structure information */ |
| 155 | kmp_int32 id_sizeof_struct; |
| 156 | offset_and_size_t |
| 157 | id_psource; /* address of string ";file;func;line1;line2;;". */ |
| 158 | offset_and_size_t id_flags; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 159 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 160 | /* lock structure information */ |
| 161 | kmp_int32 lk_sizeof_struct; |
| 162 | offset_and_size_t lk_initialized; |
| 163 | offset_and_size_t lk_location; |
| 164 | offset_and_size_t lk_tail_id; |
| 165 | offset_and_size_t lk_head_id; |
| 166 | offset_and_size_t lk_next_ticket; |
| 167 | offset_and_size_t lk_now_serving; |
| 168 | offset_and_size_t lk_owner_id; |
| 169 | offset_and_size_t lk_depth_locked; |
| 170 | offset_and_size_t lk_lock_flags; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 171 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 172 | #if !KMP_USE_DYNAMIC_LOCK |
| 173 | /* lock_table_t */ |
| 174 | kmp_int32 lt_size_of_struct; /* Size and layout of kmp_lock_table_t. */ |
| 175 | offset_and_size_t lt_used; |
| 176 | offset_and_size_t lt_allocated; |
| 177 | offset_and_size_t lt_table; |
Andrey Churbanov | 5c56fb5 | 2015-02-20 18:05:17 +0000 | [diff] [blame] | 178 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 179 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 180 | /* task_team_t */ |
| 181 | kmp_int32 tt_sizeof_struct; |
| 182 | offset_and_size_t tt_threads_data; |
| 183 | offset_and_size_t tt_found_tasks; |
| 184 | offset_and_size_t tt_nproc; |
| 185 | offset_and_size_t tt_unfinished_threads; |
| 186 | offset_and_size_t tt_active; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 187 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 188 | /* kmp_taskdata_t */ |
| 189 | kmp_int32 td_sizeof_struct; |
| 190 | offset_and_size_t td_task_id; // task id |
| 191 | offset_and_size_t td_flags; // task flags |
| 192 | offset_and_size_t td_team; // team for this task |
| 193 | offset_and_size_t td_parent; // parent task |
| 194 | offset_and_size_t td_level; // task testing level |
| 195 | offset_and_size_t td_ident; // task identifier |
| 196 | offset_and_size_t td_allocated_child_tasks; // child tasks (+ current task) |
| 197 | // not yet deallocated |
| 198 | offset_and_size_t td_incomplete_child_tasks; // child tasks not yet complete |
Andrey Churbanov | 440af7e | 2015-02-10 19:53:13 +0000 | [diff] [blame] | 199 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 200 | /* Taskwait */ |
| 201 | offset_and_size_t td_taskwait_ident; |
| 202 | offset_and_size_t td_taskwait_counter; |
| 203 | offset_and_size_t |
| 204 | td_taskwait_thread; // gtid + 1 of thread encountered taskwait |
Andrey Churbanov | 440af7e | 2015-02-10 19:53:13 +0000 | [diff] [blame] | 205 | |
Jonathan Peyton | 441f337 | 2015-09-21 17:24:46 +0000 | [diff] [blame] | 206 | #if OMP_40_ENABLED |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 207 | /* Taskgroup */ |
| 208 | offset_and_size_t td_taskgroup; // pointer to the current taskgroup |
| 209 | offset_and_size_t |
| 210 | td_task_count; // number of allocated and not yet complete tasks |
| 211 | offset_and_size_t td_cancel; // request for cancellation of this taskgroup |
Andrey Churbanov | 440af7e | 2015-02-10 19:53:13 +0000 | [diff] [blame] | 212 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 213 | /* Task dependency */ |
| 214 | offset_and_size_t |
| 215 | td_depnode; // pointer to graph node if the task has dependencies |
| 216 | offset_and_size_t dn_node; |
| 217 | offset_and_size_t dn_next; |
| 218 | offset_and_size_t dn_successors; |
| 219 | offset_and_size_t dn_task; |
| 220 | offset_and_size_t dn_npredecessors; |
| 221 | offset_and_size_t dn_nrefs; |
Jonathan Peyton | 441f337 | 2015-09-21 17:24:46 +0000 | [diff] [blame] | 222 | #endif |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 223 | offset_and_size_t dn_routine; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 224 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 225 | /* kmp_thread_data_t */ |
| 226 | kmp_int32 hd_sizeof_struct; |
| 227 | offset_and_size_t hd_deque; |
| 228 | offset_and_size_t hd_deque_size; |
| 229 | offset_and_size_t hd_deque_head; |
| 230 | offset_and_size_t hd_deque_tail; |
| 231 | offset_and_size_t hd_deque_ntasks; |
| 232 | offset_and_size_t hd_deque_last_stolen; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 233 | |
Jonathan Peyton | 3041982 | 2017-05-12 18:01:32 +0000 | [diff] [blame] | 234 | // The last field of stable version. |
| 235 | kmp_uint64 last_field; |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 236 | |
| 237 | } kmp_omp_struct_info_t; |
| 238 | |
Jonathan Peyton | 8fbb49a | 2015-07-09 18:16:58 +0000 | [diff] [blame] | 239 | #endif /* USE_DEBUGGER */ |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 240 | |
| 241 | /* end of file */ |