OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ | 5 #ifndef CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ |
6 #define CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ | 6 #define CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 uid_t uid; | 50 uid_t uid; |
51 uid_t euid; | 51 uid_t euid; |
52 // Explicitly use uint64_t instead of size_t in case this code is running | 52 // Explicitly use uint64_t instead of size_t in case this code is running |
53 // in a 32 bit process and the target process is 64 bit. | 53 // in a 32 bit process and the target process is 64 bit. |
54 uint64_t rss; | 54 uint64_t rss; |
55 uint64_t rshrd; | 55 uint64_t rshrd; |
56 uint64_t rprvt; | 56 uint64_t rprvt; |
57 uint64_t vsize; | 57 uint64_t vsize; |
58 std::string command; | 58 std::string command; |
59 | 59 |
60 ProcInfoEntry() | 60 ProcInfoEntry(); |
61 : pid(0), | |
62 ppid(0), | |
63 uid(0), | |
64 euid(0), | |
65 rss(0), | |
66 rshrd(0), | |
67 rprvt(0), | |
68 vsize(0) { | |
69 } | |
70 }; | 61 }; |
71 | 62 |
72 // Get process information for a given PID. | 63 // Get process information for a given PID. |
73 // |pid| - self-explanatory. | 64 // |pid| - self-explanatory. |
74 // |proc_info| - place to put the process information. | 65 // |proc_info| - place to put the process information. |
75 // returns - |true| if okay, |false| on error (including PID not found). | 66 // returns - |true| if okay, |false| on error (including PID not found). |
76 bool GetProcInfo(int pid, | 67 bool GetProcInfo(int pid, |
77 ProcInfoEntry* proc_info) const; | 68 ProcInfoEntry* proc_info) const; |
78 | 69 |
79 // Fills a |CommittedKBytes| with both resident and paged memory usage, as per | 70 // Fills a |CommittedKBytes| with both resident and paged memory usage, as per |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // size_t GetWorkingSetSizeOfPID(int pid) const; | 103 // size_t GetWorkingSetSizeOfPID(int pid) const; |
113 // size_t GetPeakWorkingSetSizeOfPID(int pid) const; | 104 // size_t GetPeakWorkingSetSizeOfPID(int pid) const; |
114 // size_t GetPrivateBytesOfPID(int pid) const; | 105 // size_t GetPrivateBytesOfPID(int pid) const; |
115 | 106 |
116 private: | 107 private: |
117 // map from |int| (PID) to |ProcInfoEntry| | 108 // map from |int| (PID) to |ProcInfoEntry| |
118 std::map<int,ProcInfoEntry> proc_info_entries_; | 109 std::map<int,ProcInfoEntry> proc_info_entries_; |
119 }; | 110 }; |
120 | 111 |
121 #endif // CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ | 112 #endif // CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ |
OLD | NEW |