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

[scudo] Mark page status in getStats in secondary #67588

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

ChiaHungDuan
Copy link
Contributor

Cache entry marked with [R] indicates that the pages have been released by releaseToOS().

Cache entry marked with [R] indicates that the pages have been released
by releaseToOS().
@llvmbot
Copy link
Collaborator

llvmbot commented Sep 27, 2023

@llvm/pr-subscribers-compiler-rt-sanitizer

Changes

Cache entry marked with [R] indicates that the pages have been released by releaseToOS().


Full diff: https://github.com/llvm/llvm-project/pull/67588.diff

1 Files Affected:

  • (modified) compiler-rt/lib/scudo/standalone/secondary.h (+2-2)
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index d0890d1c5e2d3d5..9302c226cba0a26 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -174,9 +174,9 @@ template <typename Config> class MapAllocatorCache {
       if (!Entry.isValid())
         continue;
       Str->append("StartBlockAddress: 0x%zx, EndBlockAddress: 0x%zx, "
-                  "BlockSize: %zu\n",
+                  "BlockSize: %zu %s\n",
                   Entry.CommitBase, Entry.CommitBase + Entry.CommitSize,
-                  Entry.CommitSize);
+                  Entry.CommitSize, Entry.Time == 0 ? "[R]" : " ");
     }
   }
 

@@ -174,9 +174,9 @@ template <typename Config> class MapAllocatorCache {
if (!Entry.isValid())
continue;
Str->append("StartBlockAddress: 0x%zx, EndBlockAddress: 0x%zx, "
"BlockSize: %zu\n",
"BlockSize: %zu %s\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is a really, really small nit, but could this be modified slightly so there is no whitespace at the end?

For example:

BlockSize: %zu%s\n", ..., EntryTime == 0 ? " [R]" : "");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I was under the impression that we have to have non-empty string in ScopedString for the placeholder and I was wrong.

Fixed

@ChiaHungDuan ChiaHungDuan merged commit ce00dde into llvm:main Oct 2, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants