Skip to content

Commit

Permalink
8328278: Do not print the tenuring threshold in AgeTable::print_on
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, ysr
  • Loading branch information
lgxbslgx committed Apr 3, 2024
1 parent 16b842a commit e3e6c2a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1Policy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1185,7 +1185,7 @@ size_t G1Policy::desired_survivor_size(uint max_regions) const {
}

void G1Policy::print_age_table() {
_survivors_age_table.print_age_table(_tenuring_threshold);
_survivors_age_table.print_age_table();
}

// Calculates survivor space parameters.
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/serial/defNewGeneration.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -644,7 +644,7 @@ void DefNewGeneration::adjust_desired_tenuring_threshold() {
gc_counters->desired_survivor_size()->set_value(desired_survivor_size * oopSize);
}

age_table()->print_age_table(_tenuring_threshold);
age_table()->print_age_table();
}

void DefNewGeneration::collect(bool full,
Expand Down
11 changes: 5 additions & 6 deletions src/hotspot/share/gc/shared/ageTable.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -114,17 +114,16 @@ uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {
return result;
}

void AgeTable::print_age_table(uint tenuring_threshold) {
void AgeTable::print_age_table() {
LogTarget(Trace, gc, age) lt;
if (lt.is_enabled() || _use_perf_data || AgeTableTracer::is_tenuring_distribution_event_enabled()) {
LogStream st(lt);
print_on(&st, tenuring_threshold);
print_on(&st);
}
}

void AgeTable::print_on(outputStream* st, uint tenuring_threshold) {
st->print_cr("Age table with threshold %u (max threshold %u)",
tenuring_threshold, MaxTenuringThreshold);
void AgeTable::print_on(outputStream* st) {
st->print_cr("Age table:");

size_t total = 0;
uint age = 1;
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/shared/ageTable.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -72,8 +72,8 @@ class AgeTable: public CHeapObj<mtGC> {

// Calculate new tenuring threshold based on age information.
uint compute_tenuring_threshold(size_t desired_survivor_size);
void print_age_table(uint tenuring_threshold);
void print_on(outputStream* st, uint tenuring_threshold);
void print_age_table();
void print_on(outputStream* st);

private:
bool _use_perf_data;
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/gc/TestAgeOutput.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -83,7 +83,7 @@ public static void runTest(String gcArg) throws Exception {
String stdout = output.getStdout();

checkPattern(".*GC\\(0\\) .*Desired survivor size.*", stdout);
checkPattern(".*GC\\(0\\) .*Age table with threshold.*", stdout);
checkPattern(".*GC\\(0\\) .*Age table:.*", stdout);
checkPattern(".*GC\\(0\\) .*- age 1:.*", stdout);
}

Expand Down

0 comments on commit e3e6c2a

Please sign in to comment.