Skip to content

8348536: Remove remain SIZE_FORMAT usage after JDK-8347990#23290

Closed
sendaoYan wants to merge 4 commits intoopenjdk:masterfrom
sendaoYan:jbs8348536
Closed

8348536: Remove remain SIZE_FORMAT usage after JDK-8347990#23290
sendaoYan wants to merge 4 commits intoopenjdk:masterfrom
sendaoYan:jbs8348536

Conversation

@sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Jan 24, 2025

Hi all,
This is complement implement PR of JDK-8347990, which fix make fails with extra flags '-DLOG_PLEASE'.

Change has been verified locally, test-fix only, risk is low.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8348536: Remove remain SIZE_FORMAT usage after JDK-8347990 (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23290/head:pull/23290
$ git checkout pull/23290

Update a local copy of the PR:
$ git checkout pull/23290
$ git pull https://git.openjdk.org/jdk.git pull/23290/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23290

View PR using the GUI difftool:
$ git pr show -t 23290

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23290.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 24, 2025

👋 Welcome back syan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 24, 2025

@sendaoYan This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348536: Remove remain SIZE_FORMAT usage after JDK-8347990

Reviewed-by: dholmes, kbarrett

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 349 new commits pushed to the master branch:

  • 990d40e: 8350476: Fix typo introduced in JDK-8350147
  • 39cb493: 8348106: Catch C++ exception in Java_sun_awt_windows_WTaskbarPeer_setOverlayIcon
  • ddb2569: 8280682: Refactor AOT code source validation checks
  • 65f79c1: 8347335: ZGC: Use limitless mark stack memory
  • e410af0: 8342393: Promote commutative vector IR node sharing
  • f755fad: 8349653: Clarify the docs for MemorySegment::reinterpret
  • a5c9a4d: 8349032: C2: Parse Predicate refactoring in Loop Unswitching broke fix for JDK-8290850
  • 302bed0: 8350499: Minimal build fails with slowdebug builds
  • 0795d11: 8350464: The flags to set the native priority for the VMThread and Java threads need a broader range
  • 05b4812: 8350041: Skip test/jdk/java/lang/String/nativeEncoding/StringPlatformChars.java on static JDK
  • ... and 339 more: https://git.openjdk.org/jdk/compare/416d46947ca926a31fbf9e97d0e7c320063ecfb2...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 24, 2025
@openjdk
Copy link

openjdk bot commented Jan 24, 2025

@sendaoYan The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jan 24, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 24, 2025

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 21, 2025

@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@sendaoYan
Copy link
Member Author

Hi, can anyone take look this PR.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Lots of gtests attempt to use SIZE_FORMAT. Isn't this just a missing include of globalDefinitions ??

@sendaoYan
Copy link
Member Author

Lots of gtests attempt to use SIZE_FORMAT. Isn't this just a missing include of globalDefinitions ??

Most of the use of SIZE_FORMAT has been removed by #23180

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Okay. I am still seeing a number of other uses in the gtests so I guess @coleenp missed a few others.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 24, 2025
@kimbarrett
Copy link

Lots of gtests attempt to use SIZE_FORMAT. Isn't this just a missing include of globalDefinitions ??

There are no longer definitions of SIZE_FORMAT and SSIZE_FORMAT in globalDefinitions.hpp.

Presumably the uses being looked at here (which appear to be all of the remaining residue) were overlooked
because they were under conditional compilation that doesn't didn't get tested.

Running egrep -r "\bS?SIZE_FORMAT\b" . in src/hotspot gets nothing. Running it in test/hotspot/gtest finds
the ones being changed by this PR.

@kimbarrett
Copy link

kimbarrett commented Feb 24, 2025

make fails with extra flags '-DLOG_PLEASE'

The way that macro is being used, I don't think it's intended to be globally enabled like that. It's definition is typically
commented or uncommented to provide some additional logging for some tests of interest. I'm wondering if the places
where it is currently being defined are debugging leftovers that shouldn't have been committed.

For example, I think the LOG_PLEASE and LOG_HERE in runtime/test_os_reserve_between.cpp should either comment
out the LOG_PLEASE definition or just use ordinary logging. Maybe @tstuefe has an opinion?

Maybe the changes related to LOG_PLEASE definitions ought to be removed and examined as a separate issue?
It's still good that the lingering SIZE_FORMATs were uncovered and are being fixed.

@sendaoYan sendaoYan changed the title 8348536: Build fails with extra cflags -DLOG_PLEASE 8348536: Remove remain SIZE_FORMAT usage after JDK-8347990 Feb 24, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Feb 24, 2025
@sendaoYan
Copy link
Member Author

Maybe the changes related to LOG_PLEASE definitions ought to be removed and examined as a separate issue? It's still good that the lingering SIZE_FORMATs were uncovered and are being fixed.

The LOG_PLEASE definition has been removed by this PR, and I create a new issue JDK-8350584 to record this issue.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

I didn't see these with the final grep and now I see they're conditionally compiled out. There are a couple others here. Can you get these too?

gtest/nmt/test_nmt_totals.cpp:  LOG("Deviation: n=" SSIZE_FORMAT ", s=" SSIZE_FORMAT ", ovrh=" SSIZE_FORMAT,   \
gtest/runtime/test_virtualMemoryTracker.cpp:  LOG("In reserved region " PTR_FORMAT ", size " SIZE_FORMAT_HEX ":", p2i(rmr->base()), rmr->size());
gtest/runtime/test_virtualMemoryTracker.cpp:    LOG("   committed region: " PTR_FORMAT ", size " SIZE_FORMAT_HEX, p2i(region->base()), region->size());

@sendaoYan
Copy link
Member Author

sendaoYan commented Feb 24, 2025

I didn't see these with the final grep and now I see they're conditionally compiled out. There are a couple others here. Can you get these too?

Do you mean I should replace SSIZE_FORMAT as %zd in this PR?
What's string should I use to replace to PTR_FORMAT and PTR_FORMAT.

@coleenp
Copy link
Contributor

coleenp commented Feb 24, 2025

Yes, replace SSIZE_FORMAT with %zd. I see that the SIZE_FORMAT_HEX was the one I kept, so that should not be replaced. Sorry for the confusion. PTR_FORMAT should not be replaced.

Edit. I'm the one suffering from confusion. I don't see any SIZE_FORMAT_HEX, just SIZE_FORMAT_X_0. Can you fix that one too?

@sendaoYan
Copy link
Member Author

Yes, replace SSIZE_FORMAT with %zd.

SSIZE_FORMAT has been replace as %zd.

Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 25, 2025
@dholmes-ora
Copy link
Member

Okay so this is no longer about LOG_PLEASE but just the leftover SIZE_FORMAT.

The way that macro is being used, I don't think it's intended to be globally enabled like that.

I don't see why not, but I will take that up in the other PR.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Seems fine. Thanks

@sendaoYan
Copy link
Member Author

Thanks @kimbarrett @coleenp @dholmes-ora for the suggestions and reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Feb 25, 2025

Going to push as commit e1081cf.
Since your change was applied there have been 350 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 25, 2025
@openjdk openjdk bot closed this Feb 25, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 25, 2025
@openjdk
Copy link

openjdk bot commented Feb 25, 2025

@sendaoYan Pushed as commit e1081cf.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@coleenp
Copy link
Contributor

coleenp commented Feb 25, 2025

I requested since you were doing this, that you should fix SIZE_FORMAT_HEX in test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp too.

@sendaoYan sendaoYan deleted the jbs8348536 branch February 25, 2025 12:35
@sendaoYan
Copy link
Member Author

I requested since you were doing this, that you should fix SIZE_FORMAT_HEX in test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp too.

Sorry, I did not got your request exately. Do you mean the SIZE_FORMAT_HEX should be deal with? What's flags should be replace to SIZE_FORMAT_HEX

@coleenp
Copy link
Contributor

coleenp commented Feb 25, 2025

From the test_globalDefinitions.cpp, this seems like a good format for that. If you want to make a trivial change.
check_format("0x%zx", (intx)0x123, "0x123");

@sendaoYan
Copy link
Member Author

sendaoYan commented Feb 25, 2025

From the test_globalDefinitions.cpp, this seems like a good format for that. If you want to make a trivial change. check_format("0x%zx", (intx)0x123, "0x123");

I have create a new PR #23778 to fix remain SIZE_FORMAT_HEX macro undefined issue since this PR has been integrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants