/* Copyright (C) 2021 Free Software Foundation, Inc. Contributed by Oracle. This file is part of GNU Binutils. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _DBE_H_ #define _DBE_H_ #include #include "enums.h" class MetricList; template class Vector; typedef long long Obj; Vector *dbeGetInitMessages (void); Vector *dbeGetExpPreview (int dbevindex, char *exp_name); char *dbeGetExpParams (int dbevindex, char *exp_name); char *dbeCreateDirectories (const char *dirname); char *dbeDeleteFile (const char *pathname); Vector *dbeReadFile (const char *pathname); int dbeWriteFile (const char *pathname, const char *contents); char *dbeGetFileAttributes (const char *filename, const char *format); char *dbeGetFiles (const char *dirname, const char *format); char *dbeGetRunningProcesses (const char *format); char *dbeOpenExperimentList (int dbevindex, Vector*> *groups, bool sessionRestart); char *dbeReadRCFile (int dbevindex, char* path); char *dbeSetExperimentsGroups (Vector*> *groups); Vector*> *dbeGetExperimensGroups (); char *dbeDropExperiment (int dbevindex, Vector *drop_index); Vector *dbeGetExpsProperty (const char *prop_name); Vector *dbeGetExpName (int dbevindex); Vector *dbeGetExpState (int dbevindex); Vector *dbeGetExpEnable (int dbevindex); bool dbeSetExpEnable (int dbevindex, Vector *enable); Vector *dbeGetExpInfo (int dbevindex); bool dbeGetViewModeEnable (); bool dbeGetJavaEnable (); int dbeUpdateNotes (int dbevindex, int exp_id, int type, char* text, bool handle_file); Vector *dbeGetTabListInfo (int dbevindex); Vector *dbeGetTabSelectionState (int dbevindex); void dbeSetTabSelectionState (int dbevindex, Vector *selected); Vector *dbeGetMemTabSelectionState (int dbevindex); void dbeSetMemTabSelectionState (int dbevindex, Vector *selected); Vector *dbeGetIndxTabSelectionState (int dbevindex); void dbeSetIndxTabSelectionState (int dbevindex, Vector *selected); Vector *dbeGetLoadObjectName (int dbevindex); Vector *dbeGetLoadObjectList (int dbevindex); Vector *dbeGetSearchPath (int dbevindex); void dbeSetSearchPath (int dbevindex, Vector *path); Vector *dbeGetPathmaps (int dbevindex); char *dbeSetPathmaps (Vector *from, Vector *to); char *dbeAddPathmap (int dbevindex, char *from, char *to); char *dbeGetMsg (int dbevindex, int type); int dbeInitView (int index, int cloneindex); void dbeDeleteView (int dbevindex); // methods concerning metrics MetricList *dbeGetMetricListV2 (int dbevindex, MetricType mtype, Vector *type, Vector *subtype, Vector *sort, Vector *vis, Vector *aux, Vector *expr_spec, Vector *legends); Vector *dbeGetRefMetricsV2 (); Vector *dbeGetCurMetricsV2 (int dbevindex, MetricType mtype); void dbeSetSort (int dbevindex, int sort_index, MetricType mtype, bool reverse); // methods concerning metrics for Overview Tab Vector *dbeGetRefMetricTree (int dbevindex, bool include_unregistered); Vector *dbeGetRefMetricTreeValues (int dbevindex, Vector *met_cmds, Vector *non_met_cmds); Vector *dbeGetOverviewText (int dbevindex); Vector *dbeGetAnoValue (int dbevindex); void dbeSetAnoValue (int dbevindex, Vector *set); int dbeGetNameFormat (int dbevindex); bool dbeGetSoName (int dbevindex); void dbeSetNameFormat (int dbevindex, int fnames, bool soname); int dbeGetViewMode (int dbevindex); void dbeSetViewMode (int dbevindex, int nmode); Vector *dbeGetTLValue (int dbevindex); void dbeSetTLValue (int dbevindex, const char *tldata_cmd, int entitiy_prop_id, int stackalign, int stackdepth); Vector *dbeGetExpFounderDescendants (); Vector *dbeGetExpSelection (int dbevindex); Vector *dbeGetSampleStatus (int dbevindex, int nselected, Vector *selected); Vector *dbeGetSampleSize (int dbevindex, Vector *selected); char *dbeCheckPattern (int dbevindex, Vector *selected, char *pattern, int type); char *dbeSetFilterStr (int dbevindex, char *filter_str); char *dbeGetFilterStr (int dbevindex); int dbeValidateFilterExpression (char *str_expr); Vector *dbeGetFilterKeywords (int dbevindex); Vector *dbeGetFilters (int dbevindex, int nexp); bool dbeUpdateFilters (int dbevindex, Vector *selected, Vector *pattern_str); char *dbeComposeFilterClause (int dbevindex, int type, int subtype, Vector*selections); Vector *dbeGetLoadObjectState (int dbevindex); void dbeSetLoadObjectState (int dbevindex, Vector *selected); void dbeSetLoadObjectDefaults (int dbevindex); Vector *dbeGetMemObjects (int dbevindex); char *dbeDefineMemObj (char *name, char *index_expr, char *_machmodel, char *sdesc, char *ldesc); char *dbeDeleteMemObj (char *name); Vector *dbeGetCPUVerMachineModel (int dbevindex); char *dbeLoadMachineModel (char *name); char *dbeGetMachineModel (); Vector *dbeListMachineModels (); void dbeDetectLoadMachineModel (int dbevindex); Vector *dbeGetIndxObjDescriptions (int dbevindex); Vector *dbeGetCustomIndxObjects (int dbevindex); char *dbeDefineIndxObj (char *name, char *index_expr, char *sdesc, char *ldesc); void dbeSetSelObj (int dbevindex, Obj sel_obj, int type, int subtype); void dbeSetSelObjV2 (int dbevindex, uint64_t id); Obj dbeGetSelObj (int dbevindex, int type, int subtype); uint64_t dbeGetSelObjV2 (int dbevindex, char *typeStr); int dbeGetSelIndex (int dbevindex, Obj sel_obj, int type, int subtype); Vector *dbeGetSelObjsIO (int dbevindex, Vector *ids, int type); Vector *dbeGetSelObjIO (int dbevindex, uint64_t id, int type); uint64_t dbeGetSelObjHeapTimestamp (int dbevindex, uint64_t id); int dbeGetSelObjHeapUserExpId (int dbevindex, uint64_t id); char *dbeSetPrintLimit (int dbevindex, int limit); int dbeGetPrintLimit (int dbevindex); char *dbeSetPrintMode (int dbevindex, char *printmode); int dbeGetPrintMode (int dbevindex); char *dbeGetPrintModeString (int dbevindex); char dbeGetPrintDelim (int dbevindex); Vector *dbeGetTotals (int dbevindex, int dsptype, int subtype); Vector *dbeGetHotMarks (int dbevindex, int type); Vector *dbeGetHotMarksInc (int dbevindex, int type); Vector *dbeGetSummaryHotMarks (int dbevindex, Vector *sel_objs, int type); Vector *dbeGetFuncId (int dbevindex, int type, int begin, int length); Vector *dbeGetFuncCalleeInfo (int dbevindex, int type, Vector* idxs, int groupId); Vector *dbeGetFuncCallerInfo (int dbevindex, int type, Vector* idxs, int groupId); Vector *dbeGetFuncCalleeInfoById (int dbevindex, int type, int idx); Vector *dbeGetFuncCallerInfoById (int dbevindex, int type, int idx); char *dbePrintData (int dbevindex, int type, int subtype, char *printer, char *fname, FILE *outfile); int dbeSetFuncData (int dbevindex, Obj sel_obj, int type, int subtype); Vector *dbeGetFuncList (int dbevindex, int type, int subtype); Vector *dbeGetFuncListV2 (int dbevindex, int mtype, Obj sel_obj, int type, int subtype); Vector *dbeGetFuncListMini (int dbevindex, int type, int subtype); Vector *dbeGetComparableObjsV2 (int dbevindex, Obj sel_obj, int type); Obj dbeConvertSelObj (Obj obj, int type); Vector *dbeGetGroupIds (int dbevindex); Vector *dbeGetTableDataV2 (int dbevindex, char *mlistStr, char *modeStr, char *typeStr, char *subtypeStr, Vector *ids); int dbeGetCallTreeNumLevels (int dbevindex); Vector *dbeGetCallTreeLevel (int dbevindex, char *mcmd, int level); Vector *dbeGetCallTreeLevels (int dbevindex, char *mcmd); Vector *dbeGetCallTreeChildren (int dbevindex, char *mcmd, Vector*nodes); Vector *dbeGetCallTreeLevelFuncs (int dbevindex, int level_start, int level_end); Vector *dbeGetCallTreeFuncs (int dbevindex); Vector *dbeGetNames (int dbevindex, int type, Obj sel_obj); Vector *dbeGetTotalMax (int dbevindex, int type, int subtype); Vector *dbeGetStatisOverviewList (int dbevindex); Vector *dbeGetStatisList (int dbevindex); Vector *dbeGetSummary (int dbevindex, Vector *objs, int type, int subtype); Vector *dbeGetSummaryV2 (int dbevindex, Vector *objs, int type, int subtype); Vector *dbeGetFounderExpId (Vector *expIds); Vector *dbeGetUserExpId (Vector *expIds); // filter "user visible" experiment id Vector *dbeGetExpGroupId (Vector *expIds); char *dbeGetExpName (int dbevindex, char *dir_name); Vector *dbeGetHwcHelp (int dbevindex, bool forKernel); Vector*> *dbeGetHwcSets (int dbevindex, bool forKernel); Vector *dbeGetHwcsAll (int dbevindex, bool forKernel); Vector *dbeGetHwcAttrList (int dbevindex, bool forKernel); int dbeGetHwcMaxConcurrent (int dbevindex, bool forKernel); int dbeGetHwcMaxReg (int dbevindex); // TBR? Vector *dbeGetIfreqData (int dbevindex); Vector *dbeGetLeakListInfo (int dbevindex, bool leakflag); Vector *dbeMpviewGetTlFuncReps (int dbevindex, int exp_id, long long binSizeTime, long long startTime, long long endTime, long long binSizeRank, long long startRank, long long endRank); Vector *dbeMpviewGetTlMsgReps (int dbevindex, int exp_id, int throttle, long long binSizeTime, long long startTime, long long endTime, long long binSizeRank, long long startRank, long long endRank); Vector *dbeMpviewGetAxisRange (int dbevindex, int exp_id, int chart_type, int axis_type); Vector *dbeMpviewGetAxisDiscreteLabels (int dbevindex, int exp_id, int chart_type, int axis_type); Vector *dbeMpviewGetFuncDetails (int dbevindex, int exp_id, Obj funcId); Vector *dbeMpviewGetMesgDetails (int dbevindex, int exp_id, Obj mesgId); Vector *dbeMpviewGetChartData (int dbevindex, int exp_id, int ctype, int attr1, long long start1, long long end1, int nbins1, int attr2, long long start2, long long end2, int nbins2, int metric, int reduction); void dbeMpviewFilterSet (int dbevindex, int exp_id, Vector *ctid, Vector *axid, Vector *startVal, Vector *endVal); void dbeMpviewLoadStacks (int dbevindex, int exp_id); Obj dbeGetObject (int dbevindex, Obj sel_func, Obj sel_pc); char *dbeGetName (int dbevindex, int exp_id); Vector *dbeGetExpVerboseName (Vector *exp_ids); long long dbeGetStartTime (int dbevindex, int exp_id); long long dbeGetRelativeStartTime (int dbevindex, int exp_id); long long dbeGetEndTime (int dbevindex, int exp_id); int dbeGetClock (int dbevindex, int exp_id); long long dbeGetWallStartSec (int dbevindex, int exp_id); char *dbeGetHostname (int dbevindex, int exp_id); Vector *dbeGetEntityProps (int dbevindex); Vector *dbeGetEntities (int dbevindex, int exp_id, int ekind); Vector *dbeGetEntitiesV2 (int dbevindex, Vector *exp_ids, int ekind); Vector *dbeGetTLDetails (int dbevindex, int exp_id, int data_id, int entity_prop_id, Obj event_id); Vector *dbeGetStackFunctions (int dbevindex, Obj stack); Vector *dbeGetStacksFunctions (int dbevindex, Vector *stacks); Vector *dbeGetStackPCs (int dbevindex, Obj stack); Vector *dbeGetStackNames (int dbevindex, Obj stack); Vector *dbeGetSamples (int dbevindex, int exp_id, int64_t lo, int64_t hi); Vector *dbeGetGCEvents (int dbevindex, int exp_id, int64_t lo, int64_t hi); Vector*>* dbeGetIOStatistics (int dbevindex); Vector*>* dbeGetHeapStatistics (int dbevindex); Vector *dbeGetFuncNames (int dbevindex, Vector *funcs); Vector *dbeGetObjNamesV2 (int dbevindex, Vector *ids); char *dbeGetFuncName (int dbevindex, Obj func); char *dbeGetObjNameV2 (int dbevindex, uint64_t id); Vector *dbeGetFuncIds (int dbevindex, Vector *funcs); uint64_t dbeGetFuncId (int dbevindex, Obj func); char *dbeGetDataspaceTypeDesc (int dbevindex, Obj stack); Vector *dbeGetDataDescriptorsV2 (int exp_id); Vector *dbeGetDataPropertiesV2 (int exp_id, int data_id); Vector *dbeGetExperimentTimeInfo (Vector *exp_ids); Vector *dbeGetExperimentDataDescriptors (Vector *exp_ids); /* New Timeline Interface */ Vector *dbeGetAggregatedValue (int data_id, char *lfilter, char *fexpr, char *pname_ts, hrtime_t start_ts, hrtime_t delta, int num, char *pname_key, char *aggr_func); Vector *dbeGetLineInfo (Obj pc); int dbeSetAlias (char *name, char *uname, char *expr); Vector *dbeGetAlias (char *name); Vector*> *dbeGetXYPlotData (int data_id, char *lfilter, char *arg, char *func1, char *aggr1, char *func2, char *aggr2, char *func3, char *aggr3); Vector *dbeHasTLData (int dbev_index, Vector *exp_ids, Vector *data_ids, // DATA_* Vector *entity_prop_ids, // LWP,CPU,THR, etc Vector *entity_prop_values, Vector *auxs); Vector *dbeGetTLData (int dbevindex, int exp_id, int data_id, int entity_prop_id, int entity_prop_val, int aux, hrtime_t start_ts, hrtime_t delta, int num, bool getRepresentatives, Vector *chartProperties); Vector *dbeGetTLEventCenterTime (int dbevindex, int exp_id, int data_id, int entity_prop_id, int entity_prop_val, int aux, long long event_idx, long long move_count); long long dbeGetTLEventIdxNearTime (int dbevindex, int exp_id, int data_id, int entity_prop_id, int entity_prop_val, int aux, int searchDirection, long long timestamp); /* Interface for use by Collector GUI */ int dbeGetSignalValue (char *); char *dbeSendSignal (pid_t, int); char *dbeGetCollectorControlValue (char *); char *dbeSetCollectorControlValue (char *, char *); char *dbeUnsetCollectorControlValue (char *); char *dbeCheckConnection (char *); void dbe_archive (Vector *ids, Vector *locations); void dbeSetLocation (const char *fname, const char *location); void dbeSetLocations (Vector *fnames, Vector *locations); Vector *dbeResolvedWith_setpath (const char *path); Vector *dbeResolvedWith_pathmap (const char *old_prefix, const char *new_prefix); #endif /* _DBE_H_ */