-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use gdb for a more accurate rss value
- Loading branch information
1 parent
fae17de
commit fae1aec
Showing
5 changed files
with
28 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ CMD | |
VERSION | ||
STATS | ||
SIZE | ||
rss.txt |
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,19 @@ | ||
# run this with: | ||
|
||
# catch program exit | ||
catch syscall exit | ||
run | ||
|
||
# capture program pid | ||
python | ||
gdb.execute("set $pid = " + str(gdb.selected_inferior().pid)) | ||
end | ||
|
||
# while it's still running, extract rss from /proc | ||
eval "shell cat /proc/%d/smaps_rollup > rss.txt", $pid | ||
|
||
# allow program to exit, and exit gdb | ||
# when gdb is run with the `-return-child-result` flag it will cause gdb to exit | ||
# with the same code the child did | ||
continue | ||
exit |
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