#include <PerfUtils.h>
|
static int | getMem () |
|
static void | getCpu (int &uTime, int &sTime) |
|
Definition at line 15 of file PerfUtils.h.
◆ getCpu()
void PerfUtils::getCpu |
( |
int & |
uTime, |
|
|
int & |
sTime |
|
) |
| |
|
static |
Definition at line 39 of file PerfUtils.cxx.
42 std::ostringstream procstream;
43 procstream <<
"/proc/" <<
pid <<
"/stat";
44 std::ifstream memfile(procstream.str());
45 std::string longString;
46 memfile >> longString;
53 while ((memfile >>
line)) {
57 std::istringstream istream(
line);
61 std::istringstream istream1(
line);
◆ getMem()
int PerfUtils::getMem |
( |
| ) |
|
|
static |
Definition at line 17 of file PerfUtils.cxx.
20 std::ostringstream procstream;
21 procstream <<
"/proc/" <<
pid <<
"/status";
22 std::ifstream memfile(procstream.str());
24 if (memfile.is_open()) {
25 while (std::getline(memfile,
line)) {
26 std::size_t
pos =
line.find(
"VmSize:");
27 if (
pos != std::string::npos) {
28 std::string myStr =
line.substr(
pos + 7);
29 myStr.erase(
std::remove(myStr.begin(), myStr.end(),
' '), myStr.end());
30 myStr.erase(
std::remove(myStr.begin(), myStr.end(),
'\t'), myStr.end());
The documentation for this class was generated from the following files: