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

Expand smaps / smaps_rollup parsing #1130

Merged
merged 11 commits into from
Dec 6, 2024
Merged

Conversation

blt
Copy link
Collaborator

@blt blt commented Dec 5, 2024

What does this PR do?

This commit expands the number of fields we parse from the smaps/smaps_rollup
files. I have not hooked these up yet to metrics emission but will in a follow-up
commit to this PR.

@blt blt marked this pull request as ready for review December 5, 2024 01:45
@blt blt requested a review from a team as a code owner December 5, 2024 01:45
@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch from 364810d to 20dd840 Compare December 5, 2024 08:00
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from 88bf086 to 5aa9221 Compare December 5, 2024 08:01
Comment on lines 248 to 261
shared_clean: shared_clean.unwrap_or(0),
shared_dirty: shared_dirty.unwrap_or(0),
private_clean: private_clean.unwrap_or(0),
private_dirty: private_dirty.unwrap_or(0),
referenced: referenced.unwrap_or(0),
anonymous: anonymous.unwrap_or(0),
lazy_free: lazy_free.unwrap_or(0),
anon_huge_pages: anon_huge_pages.unwrap_or(0),
shmem_pmd_mapped: shmem_pmd_mapped.unwrap_or(0),
file_pmd_mapped: file_pmd_mapped.unwrap_or(0),
shared_hugetlb: shared_hugetlb.unwrap_or(0),
private_hugetlb: private_hugetlb.unwrap_or(0),
swap_pss: swap_pss.unwrap_or(0),
locked: locked.unwrap_or(0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some preference towards doing the same thing with size, pss, rss, and swap to make handling consistent unless there's a reason to have different behavior for those.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'd like to see the required fields unwrapped similarly to how size, pss, rss etc are unwrapped above.
Only a few of these fields are actually optional, and I don't want to report 0 incorrectly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm the more I look at this the more I think the current approach is bankrupt. Best to read the whole file in, rip through it and create metrics without the intermediary structure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new approach seems good in terms of simpler code, but I'm concerned that we're blindly reporting 0 for any values that don't exist.
Unless I'm misunderstanding the code here, but it seems like we would end up reporting 0 in cases where there is no value, which makes this data confusing to work with.

@@ -329,8 +355,26 @@ impl Sampler {
gauge!("smaps.pss.sum", &labels).set(measures.pss as f64);
gauge!("smaps.size.sum", &labels).set(measures.size as f64);
gauge!("smaps.swap.sum", &labels).set(measures.swap as f64);

// This code reads smaps_rollup
gauge!("smaps.shared_clean.sum", &labels).set(measures.shared_clean as f64);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be open to removing the smaps.sum fields, I think this is just duplicating what we already get from smaps_rollup

Comment on lines 248 to 261
shared_clean: shared_clean.unwrap_or(0),
shared_dirty: shared_dirty.unwrap_or(0),
private_clean: private_clean.unwrap_or(0),
private_dirty: private_dirty.unwrap_or(0),
referenced: referenced.unwrap_or(0),
anonymous: anonymous.unwrap_or(0),
lazy_free: lazy_free.unwrap_or(0),
anon_huge_pages: anon_huge_pages.unwrap_or(0),
shmem_pmd_mapped: shmem_pmd_mapped.unwrap_or(0),
file_pmd_mapped: file_pmd_mapped.unwrap_or(0),
shared_hugetlb: shared_hugetlb.unwrap_or(0),
private_hugetlb: private_hugetlb.unwrap_or(0),
swap_pss: swap_pss.unwrap_or(0),
locked: locked.unwrap_or(0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'd like to see the required fields unwrapped similarly to how size, pss, rss etc are unwrapped above.
Only a few of these fields are actually optional, and I don't want to report 0 incorrectly.

@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch from 20dd840 to 996eaf8 Compare December 5, 2024 23:02
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch 2 times, most recently from 1bd074a to 5a1f0ac Compare December 5, 2024 23:06
@blt blt requested a review from scottopell December 6, 2024 03:16
@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch from 3596e48 to 2ffde30 Compare December 6, 2024 15:41
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from b3f9606 to e8d0095 Compare December 6, 2024 15:42
@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch from 2ffde30 to 050e8ca Compare December 6, 2024 16:17
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from e8d0095 to 237e686 Compare December 6, 2024 16:18
@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch from 050e8ca to 2c3fd89 Compare December 6, 2024 16:51
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from 237e686 to 2a09dca Compare December 6, 2024 16:52
@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch 2 times, most recently from 52db4dc to bdb4dcc Compare December 6, 2024 17:27
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from 2a09dca to e4a843b Compare December 6, 2024 17:27
@blt blt force-pushed the blt/move_smaps_and_smaps_rollup_parsing_into_modules branch from bdb4dcc to 08943ba Compare December 6, 2024 17:38
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from e4a843b to 2cbeb08 Compare December 6, 2024 17:38
@blt blt changed the base branch from blt/move_smaps_and_smaps_rollup_parsing_into_modules to graphite-base/1130 December 6, 2024 18:13
blt added 10 commits December 6, 2024 18:13
This commit expands the number of fields we parse from the smaps/smaps_rollup
files. I have not hooked these up yet to metrics emission but will in a follow-up
commit to this PR.

Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
@blt blt force-pushed the graphite-base/1130 branch from 08943ba to 47ff608 Compare December 6, 2024 18:13
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from 0cb9e7e to 7877403 Compare December 6, 2024 18:13
@blt blt changed the base branch from graphite-base/1130 to main December 6, 2024 18:14
Signed-off-by: Brian L. Troutwine <[email protected]>
@blt blt force-pushed the blt/expand_smaps___smaps_rollup_parsing branch from 7877403 to 89c9fb1 Compare December 6, 2024 18:14
@blt blt merged commit d767aa4 into main Dec 6, 2024
18 checks passed
Copy link
Collaborator Author

blt commented Dec 6, 2024

Merge activity

  • Dec 6, 2:23 PM EST: A user merged this pull request with Graphite.

@blt blt deleted the blt/expand_smaps___smaps_rollup_parsing branch December 6, 2024 19:23
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.

3 participants