Update year range in gprofng copyright notices
[binutils-gdb.git] / gprofng / src / Dbe.h
blob212e329c7fe31ce1a8b6a0a8e2d29b56c8843637
1 /* Copyright (C) 2021-2023 Free Software Foundation, Inc.
2 Contributed by Oracle.
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)
9 any later version.
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_H_
22 #define _DBE_H_
24 #include <stdio.h>
25 #include "enums.h"
27 class MetricList;
28 template <class ITEM> class Vector;
29 typedef long long Obj;
31 Vector<char*> *dbeGetInitMessages (void);
32 Vector<char*> *dbeGetExpPreview (int dbevindex, char *exp_name);
33 char *dbeGetExpParams (int dbevindex, char *exp_name);
34 char *dbeCreateDirectories (const char *dirname);
35 char *dbeDeleteFile (const char *pathname);
36 Vector<char*> *dbeReadFile (const char *pathname);
37 int dbeWriteFile (const char *pathname, const char *contents);
38 char *dbeGetFileAttributes (const char *filename, const char *format);
39 char *dbeGetFiles (const char *dirname, const char *format);
40 char *dbeGetRunningProcesses (const char *format);
41 char *dbeOpenExperimentList (int dbevindex, Vector<Vector<char*>*> *groups,
42 bool sessionRestart);
43 char *dbeReadRCFile (int dbevindex, char* path);
44 char *dbeSetExperimentsGroups (Vector<Vector<char*>*> *groups);
45 Vector<Vector<char*>*> *dbeGetExperimensGroups ();
46 char *dbeDropExperiment (int dbevindex, Vector<int> *drop_index);
47 Vector<char*> *dbeGetExpsProperty (const char *prop_name);
48 Vector<char*> *dbeGetExpName (int dbevindex);
49 Vector<int> *dbeGetExpState (int dbevindex);
50 Vector<bool> *dbeGetExpEnable (int dbevindex);
51 bool dbeSetExpEnable (int dbevindex, Vector<bool> *enable);
52 Vector<char*> *dbeGetExpInfo (int dbevindex);
53 bool dbeGetViewModeEnable ();
54 bool dbeGetJavaEnable ();
55 int dbeUpdateNotes (int dbevindex, int exp_id, int type, char* text,
56 bool handle_file);
57 Vector<void*> *dbeGetTabListInfo (int dbevindex);
58 Vector<bool> *dbeGetTabSelectionState (int dbevindex);
59 void dbeSetTabSelectionState (int dbevindex, Vector<bool> *selected);
60 Vector<bool> *dbeGetMemTabSelectionState (int dbevindex);
61 void dbeSetMemTabSelectionState (int dbevindex, Vector<bool> *selected);
62 Vector<bool> *dbeGetIndxTabSelectionState (int dbevindex);
63 void dbeSetIndxTabSelectionState (int dbevindex, Vector<bool> *selected);
64 Vector<char*> *dbeGetLoadObjectName (int dbevindex);
65 Vector<void *> *dbeGetLoadObjectList (int dbevindex);
66 Vector<char*> *dbeGetSearchPath (int dbevindex);
67 void dbeSetSearchPath (int dbevindex, Vector<char*> *path);
68 Vector<void*> *dbeGetPathmaps (int dbevindex);
69 char *dbeSetPathmaps (Vector<char*> *from, Vector<char*> *to);
70 char *dbeAddPathmap (int dbevindex, char *from, char *to);
71 char *dbeGetMsg (int dbevindex, int type);
72 int dbeInitView (int index, int cloneindex);
73 void dbeDeleteView (int dbevindex);
75 // methods concerning metrics
76 MetricList *dbeGetMetricListV2 (int dbevindex, MetricType mtype,
77 Vector<int> *type, Vector<int> *subtype,
78 Vector<bool> *sort, Vector<int> *vis,
79 Vector<char*> *aux, Vector<char*> *expr_spec,
80 Vector<char*> *legends);
81 Vector<void*> *dbeGetRefMetricsV2 ();
82 Vector<void*> *dbeGetCurMetricsV2 (int dbevindex, MetricType mtype);
83 void dbeSetSort (int dbevindex, int sort_index, MetricType mtype, bool reverse);
85 // methods concerning metrics for Overview Tab
86 Vector<void*> *dbeGetRefMetricTree (int dbevindex, bool include_unregistered);
87 Vector<void*> *dbeGetRefMetricTreeValues (int dbevindex, Vector<char *> *met_cmds,
88 Vector<char *> *non_met_cmds);
89 Vector<char*> *dbeGetOverviewText (int dbevindex);
90 Vector<int> *dbeGetAnoValue (int dbevindex);
91 void dbeSetAnoValue (int dbevindex, Vector<int> *set);
92 int dbeGetNameFormat (int dbevindex);
93 bool dbeGetSoName (int dbevindex);
94 void dbeSetNameFormat (int dbevindex, int fnames, bool soname);
95 int dbeGetViewMode (int dbevindex);
96 void dbeSetViewMode (int dbevindex, int nmode);
97 Vector<void*> *dbeGetTLValue (int dbevindex);
98 void dbeSetTLValue (int dbevindex, const char *tldata_cmd,
99 int entitiy_prop_id, int stackalign, int stackdepth);
100 Vector<void*> *dbeGetExpFounderDescendants ();
101 Vector<void*> *dbeGetExpSelection (int dbevindex);
102 Vector<void*> *dbeGetSampleStatus (int dbevindex, int nselected,
103 Vector<bool> *selected);
104 Vector<unsigned> *dbeGetSampleSize (int dbevindex, Vector<bool> *selected);
105 char *dbeCheckPattern (int dbevindex, Vector<bool> *selected, char *pattern,
106 int type);
107 char *dbeSetFilterStr (int dbevindex, char *filter_str);
108 char *dbeGetFilterStr (int dbevindex);
109 int dbeValidateFilterExpression (char *str_expr);
110 Vector<void*> *dbeGetFilterKeywords (int dbevindex);
111 Vector<void*> *dbeGetFilters (int dbevindex, int nexp);
112 bool dbeUpdateFilters (int dbevindex, Vector<bool> *selected,
113 Vector<char*> *pattern_str);
114 char *dbeComposeFilterClause (int dbevindex, int type, int subtype,
115 Vector<int>*selections);
116 Vector<int> *dbeGetLoadObjectState (int dbevindex);
117 void dbeSetLoadObjectState (int dbevindex, Vector<int> *selected);
118 void dbeSetLoadObjectDefaults (int dbevindex);
119 Vector<void*> *dbeGetMemObjects (int dbevindex);
120 char *dbeDefineMemObj (char *name, char *index_expr, char *_machmodel,
121 char *sdesc, char *ldesc);
122 char *dbeDeleteMemObj (char *name);
123 Vector<char*> *dbeGetCPUVerMachineModel (int dbevindex);
124 char *dbeLoadMachineModel (char *name);
125 char *dbeGetMachineModel ();
126 Vector<char*> *dbeListMachineModels ();
127 void dbeDetectLoadMachineModel (int dbevindex);
128 Vector<void*> *dbeGetIndxObjDescriptions (int dbevindex);
129 Vector<void*> *dbeGetCustomIndxObjects (int dbevindex);
130 char *dbeDefineIndxObj (char *name, char *index_expr, char *sdesc, char *ldesc);
131 void dbeSetSelObj (int dbevindex, Obj sel_obj, int type, int subtype);
132 void dbeSetSelObjV2 (int dbevindex, uint64_t id);
133 Obj dbeGetSelObj (int dbevindex, int type, int subtype);
134 uint64_t dbeGetSelObjV2 (int dbevindex, char *typeStr);
135 int dbeGetSelIndex (int dbevindex, Obj sel_obj, int type, int subtype);
136 Vector<uint64_t> *dbeGetSelObjsIO (int dbevindex, Vector<uint64_t> *ids, int type);
137 Vector<uint64_t> *dbeGetSelObjIO (int dbevindex, uint64_t id, int type);
138 uint64_t dbeGetSelObjHeapTimestamp (int dbevindex, uint64_t id);
139 int dbeGetSelObjHeapUserExpId (int dbevindex, uint64_t id);
140 char *dbeSetPrintLimit (int dbevindex, int limit);
141 int dbeGetPrintLimit (int dbevindex);
142 char *dbeSetPrintMode (int dbevindex, char *printmode);
143 int dbeGetPrintMode (int dbevindex);
144 char *dbeGetPrintModeString (int dbevindex);
145 char dbeGetPrintDelim (int dbevindex);
146 Vector<void*> *dbeGetTotals (int dbevindex, int dsptype, int subtype);
147 Vector<void*> *dbeGetHotMarks (int dbevindex, int type);
148 Vector<void*> *dbeGetHotMarksInc (int dbevindex, int type);
149 Vector<void*> *dbeGetSummaryHotMarks (int dbevindex, Vector<Obj> *sel_objs, int type);
150 Vector<uint64_t> *dbeGetFuncId (int dbevindex, int type, int begin, int length);
151 Vector<void*> *dbeGetFuncCalleeInfo (int dbevindex, int type, Vector<int>* idxs, int groupId);
152 Vector<void*> *dbeGetFuncCallerInfo (int dbevindex, int type, Vector<int>* idxs, int groupId);
153 Vector<void*> *dbeGetFuncCalleeInfoById (int dbevindex, int type, int idx);
154 Vector<void*> *dbeGetFuncCallerInfoById (int dbevindex, int type, int idx);
155 char *dbePrintData (int dbevindex, int type, int subtype, char *printer,
156 char *fname, FILE *outfile);
157 int dbeSetFuncData (int dbevindex, Obj sel_obj, int type, int subtype);
158 Vector<void*> *dbeGetFuncList (int dbevindex, int type, int subtype);
159 Vector<void*> *dbeGetFuncListV2 (int dbevindex, int mtype, Obj sel_obj, int type, int subtype);
160 Vector<void*> *dbeGetFuncListMini (int dbevindex, int type, int subtype);
161 Vector<Obj> *dbeGetComparableObjsV2 (int dbevindex, Obj sel_obj, int type);
162 Obj dbeConvertSelObj (Obj obj, int type);
163 Vector<int> *dbeGetGroupIds (int dbevindex);
164 Vector<void*> *dbeGetTableDataV2 (int dbevindex, char *mlistStr, char *modeStr,
165 char *typeStr, char *subtypeStr, Vector<uint64_t> *ids);
167 int dbeGetCallTreeNumLevels (int dbevindex);
168 Vector<void*> *dbeGetCallTreeLevel (int dbevindex, char *mcmd, int level);
169 Vector<void*> *dbeGetCallTreeLevels (int dbevindex, char *mcmd);
170 Vector<void*> *dbeGetCallTreeChildren (int dbevindex, char *mcmd, Vector<int /*NodeIdx*/>*nodes);
171 Vector<void*> *dbeGetCallTreeLevelFuncs (int dbevindex, int level_start, int level_end);
172 Vector<void*> *dbeGetCallTreeFuncs (int dbevindex);
173 Vector<char*> *dbeGetNames (int dbevindex, int type, Obj sel_obj);
174 Vector<void*> *dbeGetTotalMax (int dbevindex, int type, int subtype);
175 Vector<void*> *dbeGetStatisOverviewList (int dbevindex);
176 Vector<void*> *dbeGetStatisList (int dbevindex);
177 Vector<void*> *dbeGetSummary (int dbevindex, Vector<Obj> *objs, int type, int subtype);
178 Vector<void*> *dbeGetSummaryV2 (int dbevindex, Vector<Obj> *objs, int type, int subtype);
179 Vector<int> *dbeGetFounderExpId (Vector<int> *expIds);
180 Vector<int> *dbeGetUserExpId (Vector<int> *expIds); // filter "user visible" experiment id
181 Vector<int> *dbeGetExpGroupId (Vector<int> *expIds);
182 char *dbeGetExpName (int dbevindex, char *dir_name);
183 Vector<char*> *dbeGetHwcHelp (int dbevindex, bool forKernel);
184 Vector<Vector<char*>*> *dbeGetHwcSets (int dbevindex, bool forKernel);
185 Vector<void*> *dbeGetHwcsAll (int dbevindex, bool forKernel);
186 Vector<char*> *dbeGetHwcAttrList (int dbevindex, bool forKernel);
187 int dbeGetHwcMaxConcurrent (int dbevindex, bool forKernel);
188 int dbeGetHwcMaxReg (int dbevindex); // TBR?
190 Vector<char*> *dbeGetIfreqData (int dbevindex);
191 Vector<void*> *dbeGetLeakListInfo (int dbevindex, bool leakflag);
192 Vector<void*> *dbeMpviewGetTlFuncReps (int dbevindex, int exp_id,
193 long long binSizeTime, long long startTime, long long endTime,
194 long long binSizeRank, long long startRank, long long endRank);
195 Vector<void*> *dbeMpviewGetTlMsgReps (int dbevindex, int exp_id, int throttle,
196 long long binSizeTime, long long startTime, long long endTime,
197 long long binSizeRank, long long startRank, long long endRank);
198 Vector<long long> *dbeMpviewGetAxisRange (int dbevindex, int exp_id,
199 int chart_type, int axis_type);
200 Vector<char*> *dbeMpviewGetAxisDiscreteLabels (int dbevindex, int exp_id,
201 int chart_type, int axis_type);
202 Vector<void*> *dbeMpviewGetFuncDetails (int dbevindex, int exp_id, Obj funcId);
203 Vector<void*> *dbeMpviewGetMesgDetails (int dbevindex, int exp_id, Obj mesgId);
204 Vector<long long> *dbeMpviewGetChartData (int dbevindex, int exp_id, int ctype,
205 int attr1, long long start1,
206 long long end1, int nbins1,
207 int attr2, long long start2,
208 long long end2, int nbins2,
209 int metric, int reduction);
210 void dbeMpviewFilterSet (int dbevindex, int exp_id, Vector<int> *ctid,
211 Vector<int > *axid, Vector<long long> *startVal,
212 Vector<long long> *endVal);
213 void dbeMpviewLoadStacks (int dbevindex, int exp_id);
216 Obj dbeGetObject (int dbevindex, Obj sel_func, Obj sel_pc);
217 char *dbeGetName (int dbevindex, int exp_id);
218 Vector<char*> *dbeGetExpVerboseName (Vector<int> *exp_ids);
219 long long dbeGetStartTime (int dbevindex, int exp_id);
220 long long dbeGetRelativeStartTime (int dbevindex, int exp_id);
221 long long dbeGetEndTime (int dbevindex, int exp_id);
222 int dbeGetClock (int dbevindex, int exp_id);
223 long long dbeGetWallStartSec (int dbevindex, int exp_id);
224 char *dbeGetHostname (int dbevindex, int exp_id);
225 Vector<void*> *dbeGetEntityProps (int dbevindex);
226 Vector<void*> *dbeGetEntities (int dbevindex, int exp_id, int ekind);
227 Vector<void*> *dbeGetEntitiesV2 (int dbevindex, Vector<int> *exp_ids, int ekind);
228 Vector<void*> *dbeGetTLDetails (int dbevindex, int exp_id, int data_id,
229 int entity_prop_id, Obj event_id);
230 Vector<Obj> *dbeGetStackFunctions (int dbevindex, Obj stack);
231 Vector<void*> *dbeGetStacksFunctions (int dbevindex, Vector<Obj> *stacks);
232 Vector<Obj> *dbeGetStackPCs (int dbevindex, Obj stack);
233 Vector<char*> *dbeGetStackNames (int dbevindex, Obj stack);
234 Vector<void*> *dbeGetSamples (int dbevindex, int exp_id, int64_t lo, int64_t hi);
235 Vector<void*> *dbeGetGCEvents (int dbevindex, int exp_id, int64_t lo, int64_t hi);
236 Vector<Vector<char*>*>* dbeGetIOStatistics (int dbevindex);
237 Vector<Vector<char*>*>* dbeGetHeapStatistics (int dbevindex);
238 Vector<char*> *dbeGetFuncNames (int dbevindex, Vector<Obj> *funcs);
239 Vector<char*> *dbeGetObjNamesV2 (int dbevindex, Vector<uint64_t> *ids);
240 char *dbeGetFuncName (int dbevindex, Obj func);
241 char *dbeGetObjNameV2 (int dbevindex, uint64_t id);
242 Vector<uint64_t> *dbeGetFuncIds (int dbevindex, Vector<Obj> *funcs);
243 uint64_t dbeGetFuncId (int dbevindex, Obj func);
244 char *dbeGetDataspaceTypeDesc (int dbevindex, Obj stack);
245 Vector<void*> *dbeGetDataDescriptorsV2 (int exp_id);
246 Vector<void*> *dbeGetDataPropertiesV2 (int exp_id, int data_id);
247 Vector<void*> *dbeGetExperimentTimeInfo (Vector<int> *exp_ids);
248 Vector<void*> *dbeGetExperimentDataDescriptors (Vector<int> *exp_ids);
250 /* New Timeline Interface */
251 Vector<long long> *dbeGetAggregatedValue (int data_id, char *lfilter, char *fexpr,
252 char *pname_ts, hrtime_t start_ts,
253 hrtime_t delta, int num,
254 char *pname_key, char *aggr_func);
255 Vector<char*> *dbeGetLineInfo (Obj pc);
256 int dbeSetAlias (char *name, char *uname, char *expr);
257 Vector<char*> *dbeGetAlias (char *name);
258 Vector<Vector<long long>*> *dbeGetXYPlotData (int data_id, char *lfilter,
259 char *arg, char *func1, char *aggr1,
260 char *func2, char *aggr2,
261 char *func3, char *aggr3);
262 Vector<bool> *dbeHasTLData (int dbev_index, Vector<int> *exp_ids,
263 Vector<int> *data_ids, // DATA_*
264 Vector<int> *entity_prop_ids, // LWP,CPU,THR, etc
265 Vector<int> *entity_prop_values,
266 Vector<int> *auxs);
267 Vector<void*> *dbeGetTLData (int dbevindex, int exp_id, int data_id,
268 int entity_prop_id, int entity_prop_val, int aux,
269 hrtime_t start_ts, hrtime_t delta, int num,
270 bool getRepresentatives, Vector<char*> *chartProperties);
271 Vector<long long> *dbeGetTLEventCenterTime (int dbevindex, int exp_id,
272 int data_id, int entity_prop_id,
273 int entity_prop_val, int aux,
274 long long event_idx, long long move_count);
275 long long dbeGetTLEventIdxNearTime (int dbevindex, int exp_id,
276 int data_id,
277 int entity_prop_id, int entity_prop_val, int aux,
278 int searchDirection,
279 long long timestamp);
281 /* Interface for use by Collector GUI */
282 int dbeGetSignalValue (char *);
283 char *dbeSendSignal (pid_t, int);
284 char *dbeGetCollectorControlValue (char *);
285 char *dbeSetCollectorControlValue (char *, char *);
286 char *dbeUnsetCollectorControlValue (char *);
287 char *dbeCheckConnection (char *);
288 void dbe_archive (Vector<long long> *ids, Vector<const char *> *locations);
289 void dbeSetLocation (const char *fname, const char *location);
290 void dbeSetLocations (Vector<const char *> *fnames, Vector<const char *> *locations);
291 Vector<void*> *dbeResolvedWith_setpath (const char *path);
292 Vector<void*> *dbeResolvedWith_pathmap (const char *old_prefix, const char *new_prefix);
294 #endif /* _DBE_H_ */