Commit c2720771 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

play around with /proc/status. closes #1239

git-svn-id: file:///svn/toku/tokudb.1195@7682 c7de825b-a66e-492c-adef-691d508d4ae1
parent c96e94ee
...@@ -254,26 +254,19 @@ int main (int argc, const char *argv[]) { ...@@ -254,26 +254,19 @@ int main (int argc, const char *argv[]) {
extern void toku_print_trace_mem(); extern void toku_print_trace_mem();
toku_print_trace_mem(); toku_print_trace_mem();
} }
#if 0 #if defined __linux__ && __linux__
char fname[256]; char fname[256];
sprintf(fname, "/proc/%d/status", getpid()); sprintf(fname, "/proc/%d/status", getpid());
FILE *f = fopen(fname, "r"); FILE *f = fopen(fname, "r");
if (f) { if (f) {
char line[256]; char line[256];
while (fgets(line, sizeof line, f)) while (fgets(line, sizeof line, f)) {
fputs(line, stdout); int n;
fclose(f); if (sscanf(line, "VmPeak: %d", &n) || sscanf(line, "VmHWM: %d", &n) || sscanf(line, "VmRSS: %d", &n))
} fputs(line, stdout);
{ }
sprintf(fname, "/proc/%d/statm", getpid());
FILE *f = fopen(fname, "r");
if (f) {
char line[256];
while (fgets(line, sizeof line, f))
fputs(line, stdout);
fclose(f); fclose(f);
} }
}
#endif #endif
#endif #endif
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment