1 /* Copyright (C) 2021 Free Software Foundation, Inc.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
21 #ifndef _DBE_STRUCTS_H
22 #define _DBE_STRUCTS_H
24 #include "dbe_types.h"
33 Sp_lang_cplusplus = 4,
36 Sp_lang_fortran90 = 7,
40 Sp_lang_KAI_KPTS = 32,
55 unsigned long long ll; // address
59 // sync enum changes with both AnMetric.java and AnVariable.java
74 // Tagged numeric value
78 bool sign; // The print result will always begin with a sign (+ or -).
88 unsigned long long ull;
92 char *to_str (char *str, size_t strsz);
94 void make_delta (TValue *v1, TValue *v2);
95 void make_ratio (TValue *v1, TValue *v2);
96 int compare (TValue *v);
99 // XXX MAX_HWCOUNT may need to be managed dynamically, not #defined
100 #define MAX_HWCOUNT 64
102 // Experiment collection parameters
103 struct Collection_params
105 int profile_mode; // if clock-profiling is on
106 long long ptimer_usec; // Clock profile timer interval (microseconds)
107 int lms_magic_id; // identifies which LMS_* states are live
108 int sync_mode; // if synctrace is on
109 int sync_threshold; // value of synctrace threshold, in microseconds
110 int sync_scope; // value of synctrace scope: Java and/or native
112 int heap_mode; // if heaptrace is on
113 int io_mode; // if iotrace is on
114 int race_mode; // if race-detection is on
115 int race_stack; // setting for stack data collection
116 int deadlock_mode; // if deadlock-detection is on
117 int omp_mode; // if omptrace is on
119 int hw_mode; // if hw-counter profiling is on
120 int xhw_mode; // if extended (true-PC) HW counter profiling for any counter
122 char *hw_aux_name[MAX_HWCOUNT];
123 char *hw_username[MAX_HWCOUNT];
124 int hw_interval[MAX_HWCOUNT]; // nominal interval for count
125 int hw_tpc[MAX_HWCOUNT]; // non-zero, if aggressive TPC/VA requested
126 int hw_metric_tag[MAX_HWCOUNT]; // tag as used for finding metrics
127 int hw_cpu_ver[MAX_HWCOUNT]; // Chip version number for this metric
129 int sample_periodic; // if periodic sampling is on
130 int sample_timer; // Sample timer (sec)
131 int limit; // experiment size limit
132 const char *pause_sig; // Pause/resume signal string
133 const char *sample_sig; // Sampling signal string
134 const char *start_delay; // Data collect start delay string
135 const char *terminate; // Data collection termination time string
139 const hrtime_t ZERO_TIME = (hrtime_t) 0;
140 const hrtime_t MAX_TIME = (hrtime_t) 0x7fffffffffffffffLL;
142 #define PCInvlFlag ((int) 0x8LL)
143 #define PCLineFlag ((int) 0x4LL)
144 #define PCTrgtFlag ((int) 0x2LL)
145 #define MAKE_ADDRESS(idx, off) (((unsigned long long)(idx)<<32) | off)
146 #define ADDRESS_SEG(x) ((unsigned int)(((x)>>32) & 0xffffffff))
147 #define ADDRESS_OFF(x) ((unsigned int)((x) & 0xffffffff))
151 #define AnalyzerInfoVersion 2
155 uint64_t text_labelref;
158 } AnalyzerInfoHdr; // => header from .__analyzer_info
162 uint32_t offset; // offset relative to text_labelref
163 uint32_t id; // profiled instruction identifier
164 uint32_t signature; // signature of profiled instruction
165 uint32_t datatype_id; // referenced datatype identifier
166 } memop_info_t; // => used for table_type=0,1,2
170 uint32_t offset; // offset relative to text_labelref
171 } target_info_t; // => used for table_type=3
180 target_info_t *target;
188 uint32_t datatype_id; // datatype identifier (local)
189 uint32_t memop_refs; // count of referencing memops
190 uint32_t event_data; // count of event data
191 DataObject *dobj; // corresponding dataobject (unique)
196 uint32_t offset; // entry offset in compilation unit
197 uint32_t extent; // sibling offset
198 void *parent; // container symbol
199 void *object; // resolved object
211 enum LibExpand expand;
219 #endif /* _DBE_STRUCTS_H */