RFR: 8368124: Show useful thread names in ASAN reports [v4]
Matthias Baesken
mbaesken at openjdk.org
Wed Sep 24 07:43:15 UTC 2025
On Wed, 24 Sep 2025 06:53:24 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> The smart-threshold is just a threshold to switch to plain truncation. E.g. if the output buffer were just four characters, the resulting name would be "C..3".
>>
>> I disagree about making this a utility function. A function like this makes sense in a number of cases. It certainly is preferable to dumb truncation without any indication one truncated. Arguably, with longer output buffers something like "...(truncate)..." in the middle would be even more helpful.
>>
>> And having it a separate function allows me to test the function in gtest.
>
> Sorry I'm still not grokking this 4 chars aspect. For whatever buffer size, if the length of the name < buffer_len we write it as-is. Otherwise we chop out the middle and replace with .. such that it fits in the buffer.
> I'm really not understanding the "smart-threshold" here; nor does this seem worthy of being a utility function.
I think it is a good string utility function; at least it is not only related only to the ASAN support but could be used for other things.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27395#discussion_r2374781681
More information about the hotspot-dev
mailing list