-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dump /proc/[pid]/statm for all processes in print_mem_stats()
It can be usefull to see statm info about all processes in the system during earlyoom killing. In some cases this may allow tracking of "heavy" processes that haven't been killed but are still present in system.
- Loading branch information
Showing
4 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <ctype.h> | ||
|
||
#include "utils.h" | ||
|
||
int isnumeric(char* str) | ||
{ | ||
int i = 0; | ||
|
||
// Empty string is not numeric | ||
if (str[0] == 0) | ||
return 0; | ||
|
||
while (1) { | ||
if (str[i] == 0) // End of string | ||
return 1; | ||
|
||
if (isdigit(str[i]) == 0) | ||
return 0; | ||
|
||
i++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __UTILS_H__ | ||
#define __UTILS_H__ | ||
|
||
int isnumeric(char* str); | ||
|
||
#endif |