Update year range in gprofng copyright notices
[binutils-gdb.git] / gprofng / src / IOActivity.h
bloba5dbbc2c849c93b6cbc993d36360288febaa6a19
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 _IOACTIVITY_H
22 #define _IOACTIVITY_H
25 #include <stdio.h>
27 #include "vec.h"
28 #include "Histable.h"
29 #include "Hist_data.h"
30 #include "Metric.h"
31 #include "FileData.h"
32 #include "DefaultMap.h"
33 #include "dbe_types.h"
35 class Experiment;
36 class Expression;
37 class DataView;
38 class DbeView;
40 class IOActivity
42 public:
44 IOActivity (DbeView *_dbev);
45 void reset (void);
46 Hist_data *compute_metrics (MetricList *, Histable::Type, Hist_data::Mode,
47 Histable*);
49 ~IOActivity ()
51 this->reset ();
54 private:
55 void computeData (Histable::Type);
56 void computeCallStack (Histable::Type, VMode viewMode);
57 void createHistItemTotals (Hist_data *, MetricList *, Histable::Type, bool);
58 void computeHistTotals (Hist_data *, MetricList *);
59 void computeHistData (Hist_data *, MetricList *, Hist_data::Mode, Histable *);
61 Vector<FileData*> *fDataObjs;
62 Vector<FileData*> *fDataObjsFile;
63 Vector<FileData*> *fDataObjsVfd;
64 Vector<FileData*> *fDataObjsCallStack;
65 bool hasFile;
66 bool hasVfd;
67 bool hasCallStack;
68 HashMap<char*, FileData*> *fDataHash;
69 FileData *fDataTotal;
71 // list of FileData objects using the stack id as the key
72 DefaultMap<void*, FileData*> *fDataCalStkMap;
74 // list of FileData objects using the VFD as the key
75 DefaultMap<long, FileData*> *fDataVfdMap;
77 // the cached data for mode=Hist_Data::ALL
78 Hist_data *hist_data_file_all;
79 Hist_data *hist_data_vfd_all;
80 Hist_data *hist_data_callstack_all;
81 Hist_data *hist_data_callstack;
83 DbeView *dbev;
86 #endif /* _IOACTIVITY_H */