-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[asan] Print unique_id
instead of tid
#111925
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
[asan] Print unique_id
instead of tid
#111925
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) ChangesBefore the first reuse, after 2^32 threads Full diff: https://github.com/llvm/llvm-project/pull/111925.diff 1 Files Affected:
diff --git a/compiler-rt/lib/asan/asan_descriptions.cpp b/compiler-rt/lib/asan/asan_descriptions.cpp
index db87789aea86a0..caec79313e22ff 100644
--- a/compiler-rt/lib/asan/asan_descriptions.cpp
+++ b/compiler-rt/lib/asan/asan_descriptions.cpp
@@ -24,7 +24,7 @@ AsanThreadIdAndName::AsanThreadIdAndName(AsanThreadContext *t) {
internal_snprintf(name, sizeof(name), "T-1");
return;
}
- int len = internal_snprintf(name, sizeof(name), "T%d", t->tid);
+ int len = internal_snprintf(name, sizeof(name), "T%llu", t->unique_id);
CHECK(((unsigned int)len) < sizeof(name));
if (internal_strlen(t->name))
internal_snprintf(&name[len], sizeof(name) - len, " (%s)", t->name);
|
Is this an improvement? How will people convert this to the TID, or know that they have to? |
Created using spr 1.3.4 [skip ci]
TID is not OS ID, TID is just an index in ThreadRegistry array |
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4 [skip ci]
Before the first reuse, after 2^32 threads they are equal.
Before the first reuse, after 2^32 threads
they are equal.