-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pmap: implement --device
#249
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
==========================================
+ Coverage 60.62% 60.76% +0.13%
==========================================
Files 44 44
Lines 4500 4577 +77
Branches 693 711 +18
==========================================
+ Hits 2728 2781 +53
- Misses 1611 1625 +14
- Partials 161 171 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
700bd50
to
179572b
Compare
179572b
to
e1ed696
Compare
set_exit_code(1); | ||
} | ||
if matches.get_flag(options::DEVICE) { | ||
output_device_format(pid).map_err(|_| set_exit_code(1)).ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it expected that they (the map_err) don't return an error message ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the original pmap
doesn't show an error message if /proc/<PID>/maps
can't be read:
$ pmap 1 --device
1: /sbin/init \vmlinuz-linux
$ echo $?
1
In this example, no memory map is shown because /proc/1/maps
is not accessible for a normal user.
e1ed696
to
99ddca0
Compare
99ddca0
to
cc6d948
Compare
This PR implements
-d
/--device
and creates output in the following format: