1 /*
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1STRINGDEDUPSTAT_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1STRINGDEDUPSTAT_HPP
27
28 #include "memory/allocation.hpp"
29 #include "runtime/os.hpp"
30
31 // Macros for GC log output formating
32 #define G1_STRDEDUP_OBJECTS_FORMAT UINTX_FORMAT_W(12)
33 #define G1_STRDEDUP_TIME_FORMAT "%1.7lf secs"
34 #define G1_STRDEDUP_PERCENT_FORMAT "%5.1lf%%"
35 #define G1_STRDEDUP_PERCENT_FORMAT_NS "%.1lf%%"
36 #define G1_STRDEDUP_BYTES_FORMAT "%8.1lf%s"
37 #define G1_STRDEDUP_BYTES_FORMAT_NS "%.1lf%s"
38 #define G1_STRDEDUP_BYTES_PARAM(bytes) byte_size_in_proper_unit((double)(bytes)), proper_unit_for_byte_size((bytes))
39
40 //
41 // Statistics gathered by the deduplication thread.
42 //
43 class G1StringDedupStat : public StackObj {
44 private:
45 // Counters
46 uintx _inspected;
122 _block++;
123 }
124
125 void mark_unblock() {
126 double now = os::elapsedTime();
127 _block_elapsed += now - _start;
128 _start = now;
129 }
130
131 void mark_done() {
132 double now = os::elapsedTime();
133 _exec_elapsed += now - _start;
134 }
135
136 void add(const G1StringDedupStat& stat);
137
138 static void print_summary(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat);
139 static void print_statistics(outputStream* st, const G1StringDedupStat& stat, bool total);
140 };
141
142 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1STRINGDEDUPSTAT_HPP
|
1 /*
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_G1STRINGDEDUPSTAT_HPP
26 #define SHARE_VM_GC_G1_G1STRINGDEDUPSTAT_HPP
27
28 #include "memory/allocation.hpp"
29 #include "runtime/os.hpp"
30
31 // Macros for GC log output formating
32 #define G1_STRDEDUP_OBJECTS_FORMAT UINTX_FORMAT_W(12)
33 #define G1_STRDEDUP_TIME_FORMAT "%1.7lf secs"
34 #define G1_STRDEDUP_PERCENT_FORMAT "%5.1lf%%"
35 #define G1_STRDEDUP_PERCENT_FORMAT_NS "%.1lf%%"
36 #define G1_STRDEDUP_BYTES_FORMAT "%8.1lf%s"
37 #define G1_STRDEDUP_BYTES_FORMAT_NS "%.1lf%s"
38 #define G1_STRDEDUP_BYTES_PARAM(bytes) byte_size_in_proper_unit((double)(bytes)), proper_unit_for_byte_size((bytes))
39
40 //
41 // Statistics gathered by the deduplication thread.
42 //
43 class G1StringDedupStat : public StackObj {
44 private:
45 // Counters
46 uintx _inspected;
122 _block++;
123 }
124
125 void mark_unblock() {
126 double now = os::elapsedTime();
127 _block_elapsed += now - _start;
128 _start = now;
129 }
130
131 void mark_done() {
132 double now = os::elapsedTime();
133 _exec_elapsed += now - _start;
134 }
135
136 void add(const G1StringDedupStat& stat);
137
138 static void print_summary(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat);
139 static void print_statistics(outputStream* st, const G1StringDedupStat& stat, bool total);
140 };
141
142 #endif // SHARE_VM_GC_G1_G1STRINGDEDUPSTAT_HPP
|