]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gprofng/src/FileData.h
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. */
28 #include "data_pckts.h"
33 #define VIRTUAL_FD_TOTAL 0
34 #define VIRTUAL_FD_STDIN 1
35 #define VIRTUAL_FD_STDOUT 2
36 #define VIRTUAL_FD_STDERR 3
37 #define VIRTUAL_FD_OTHERIO 4
38 #define VIRTUAL_FD_NONE -1
45 #define OTHERIO_FILENAME "<Other IO activity>"
46 #define STDIN_FILENAME "<stdin>"
47 #define STDOUT_FILENAME "<stdout>"
48 #define STDERR_FILENAME "<stderr>"
49 #define TOTAL_FILENAME NTXT("<Total>")
50 #define UNKNOWNFD_FILENAME "<pipe(), socket(), or other fds>"
58 #define _1000KB 1048576
59 #define _10MB 10485760
60 #define _100MB 104857600
61 #define _1GB 1073741824
62 #define _10GB 10737418240
63 #define _100GB 107374182400
64 #define _1TB 1099511627776
65 #define _10TB 10995116277760
67 class FileData
: public Histable
69 friend class IOActivity
;
71 FileData (const char *fName
);
72 FileData (FileData
*fData
);
75 virtual char *get_name (Histable::NameFormat nfmt
);
76 virtual Histable
*convertto (Histable_type
, Histable
* = NULL
);
78 char *get_raw_name (Histable::NameFormat nfmt
);
79 void setFsType (FileSystem_type fst
);
80 void setFsType (const char* fst
);
109 addReadEvent (hrtime_t rt
, int64_t nb
)
135 addWriteEvent (hrtime_t wt
, int64_t nb
)
161 addOtherEvent (hrtime_t ot
)
180 addErrorEvent (hrtime_t er
)
198 void setFileDesList (int fd
);
218 void setVirtualFds (int64_t vfd
);
233 setVirtualFd (int64_t vFd
)
245 setHistType (Histable::Type hType
)
256 void setWriteStat (hrtime_t wt
, int64_t nb
);
261 return wSlowestBytes
;
267 return wSmallestBytes
;
273 return wLargestBytes
;
297 return w32KB128KBCnt
;
303 return w128KB256KBCnt
;
309 return w256KB512KBCnt
;
313 getW512KB1000KBCnt ()
315 return w512KB1000KBCnt
;
321 return w1000KB10MBCnt
;
327 return w10MB100MBCnt
;
345 return w10GB100GBCnt
;
360 void setReadStat (hrtime_t rt
, int64_t nb
);
365 return rSlowestBytes
;
371 return rSmallestBytes
;
377 return rLargestBytes
;
401 return r32KB128KBCnt
;
407 return r128KB256KBCnt
;
413 return r256KB512KBCnt
;
417 getR512KB1000KBCnt ()
419 return r512KB1000KBCnt
;
425 return r1000KB10MBCnt
;
431 return r10MB100MBCnt
;
449 return r10GB100GBCnt
;
465 char *fileName
; // File name
466 hrtime_t readTime
; // The Total time for read operations;
467 hrtime_t writeTime
; // The Total time for write operations;
468 hrtime_t otherTime
; // The Total time for other IO operations;
469 hrtime_t errorTime
; // The Total time for failed IO operations;
470 int64_t readBytes
; //The total bytes read
471 int64_t writeBytes
; //The total bytes written
472 int32_t readCnt
; // The read count
473 int32_t writeCnt
; // The write count
474 int32_t otherCnt
; // The other IO count
475 int32_t errorCnt
; // The failed IO count
476 Vector
<int> *fileDesList
; // The list of file descriptors
477 Vector
<int64_t> *virtualFds
; // The list of file virtual descriptors
478 char fsType
[FSTYPESZ
]; // The file system type
479 int64_t virtualFd
; // The virtual file descriptor
480 int32_t fileDes
; // The file descriptor
481 Histable::Type histType
; // The Histable type: IOACTFILE, IOACTVFD, ...
484 hrtime_t wSlowestBytes
;
485 int64_t wSmallestBytes
;
486 int64_t wLargestBytes
;
490 int32_t w32KB128KBCnt
;
491 int32_t w128KB256KBCnt
;
492 int32_t w256KB512KBCnt
;
493 int32_t w512KB1000KBCnt
;
494 int32_t w1000KB10MBCnt
;
495 int32_t w10MB100MBCnt
;
496 int32_t w100MB1GBCnt
;
498 int32_t w10GB100GBCnt
;
499 int32_t w100GB1TBCnt
;
503 hrtime_t rSlowestBytes
;
504 int64_t rSmallestBytes
;
505 int64_t rLargestBytes
;
509 int32_t r32KB128KBCnt
;
510 int32_t r128KB256KBCnt
;
511 int32_t r256KB512KBCnt
;
512 int32_t r512KB1000KBCnt
;
513 int32_t r1000KB10MBCnt
;
514 int32_t r10MB100MBCnt
;
515 int32_t r100MB1GBCnt
;
517 int32_t r10GB100GBCnt
;
518 int32_t r100GB1TBCnt
;