Skip to content

Remove compiler ras address masking - #7549

Merged
dsouzai merged 2 commits into
eclipse-omr:masterfrom
0xdaryl:maskaddresses
Nov 19, 2024
Merged

Remove compiler ras address masking#7549
dsouzai merged 2 commits into
eclipse-omr:masterfrom
0xdaryl:maskaddresses

Conversation

@0xdaryl

@0xdaryl 0xdaryl commented Nov 18, 2024

Copy link
Copy Markdown
Contributor

"Address masking" was an attempt to make compiler log files easier to compare by preventing addresses (that are likely to change between compilations) from being printed raw in a compilation log. It worked by intercepting the "printf" family of IO functions and checking whether any addresses were being printed with the %p format specifier, and instead of printing the address a "Masked Address" string was substituted instead.

This feature was introduced at a time when text file comparison tools were not as robust as they are today and many addresses are output to the log without using %p making this feature less effective. Since it adds overhead and complexity to the logging path, has incomplete coverage, and is not widely used (if at all), remove it from the code base.

Removing address masking was discussed briefly at the Oct 24 OMR Architecture Meeting with agreement to remove it.

@0xdaryl

0xdaryl commented Nov 18, 2024

Copy link
Copy Markdown
Contributor Author

@JBKingdon @klangman : FYI for any opinions you might have

@0xdaryl

0xdaryl commented Nov 18, 2024

Copy link
Copy Markdown
Contributor Author

@dsouzai : would you mind reviewing please?

@JamesKingdon

Copy link
Copy Markdown
Contributor

Sounds good to me.

@dsouzai dsouzai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall LGTM aside from a couple of comments.

Comment thread compiler/compile/OMRCompilation.cpp Outdated
Comment thread compiler/x/codegen/X86Debug.cpp Outdated
@dsouzai

dsouzai commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

jenkins build all

@dsouzai dsouzai self-assigned this Nov 19, 2024
@dsouzai

dsouzai commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

win build failure:

[2024-11-19T14:41:35.197Z]          Debug.cpp
[2024-11-19T14:41:36.525Z]     32>c:\omr\workspace\pullrequest-win_x86-64\build\compiler\ras\debug.cpp(531): error C2220: warning treated as error - no 'object' file generated [C:\omr\workspace\PullRequest-win_x86-64\Build\build\jitbuilder\jitbuilder.vcxproj]
[2024-11-19T14:41:36.525Z]     32>c:\omr\workspace\pullrequest-win_x86-64\build\compiler\ras\debug.cpp(531): warning C4101: 'buffer': unreferenced local variable [C:\omr\workspace\PullRequest-win_x86-64\Build\build\jitbuilder\jitbuilder.vcxproj]

I guess TR_Debug::vtrace(const char * format, va_list args) initializes char buffer[256]; which isn't used anymore.

"Address masking" was an attempt to make compiler log files easier to compare by
preventing addresses (that are likely to change between compilations) from being
printed raw in a compilation log.  It worked by intercepting the "printf" family
of IO functions and checking whether any addresses were being printed with the
`%p` format specifier, and instead of printing the address a "*Masked*" string
was substituted instead.

This feature was introduced at a time when text file comparison tools were not
as robust as they are today.  As well, these days, many addresses are output to
the log without using `%p` making this feature less effective.  Since it adds
overhead and complexity to the logging path, has incomplete coverage, and is not
widely used (if at all), remove it from the code base.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
The passed in va_list is not used so it can be simply passed along.  Also,
remove unused `buffer` array.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
@0xdaryl

0xdaryl commented Nov 19, 2024

Copy link
Copy Markdown
Contributor Author

Jenkins build all

@dsouzai
dsouzai merged commit d626d17 into eclipse-omr:master Nov 19, 2024
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.

3 participants