Skip to content
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

Fix bug in smaps parsing logic related to pathnames containing whitespace #1237

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

scottopell
Copy link
Contributor

What does this PR do?

The smaps parsing code now correctly handles pathnames that are annotated with strings that contain whitespace.

Motivation

The env var GLIBC_TUNABLES=glibc.mem.decorate_maps=1 will turn on extra pathname annotations for allocations originating in glibc, which can be very helpful for breaking down RSS. Our parsing code did not correctly handle this, now it should.

7514356d1000-7514356d3000 rw-p 00000000 00:00 0                          [anon: glibc: loader malloc]
Size:                  8 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   8 kB
Pss:                   8 kB
Pss_Dirty:             8 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         8 kB
Referenced:            8 kB
Anonymous:             8 kB
KSM:                   0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
FilePmdMapped:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
THPeligible:           0
ProtectionKey:         0
VmFlags: rd wr mr mw me ac sd

Additional Notes

@scottopell scottopell requested a review from a team as a code owner February 6, 2025 17:21
@scottopell scottopell enabled auto-merge (squash) February 6, 2025 17:23
Copy link
Contributor Author

@scottopell scottopell merged commit b729d77 into main Feb 6, 2025
17 checks passed
@scottopell scottopell deleted the sopell/smaps-pathnames-whitespace branch February 6, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants