1 /*
2 * Copyright (c) 2012, 2016, 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 *
411 if (e.should_commit()) {
412 e.set_gcId(GCId::current());
413 e.set_when((u1) when);
414 e.set_gcThreshold(meta_space_summary.capacity_until_GC());
415 e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
416 e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
417 e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
418 e.commit();
419 }
420 }
421
422 class PhaseSender : public PhaseVisitor {
423 void visit_pause(GCPhase* phase) {
424 assert(phase->level() < PhasesStack::PHASE_LEVELS, "Need more event types for PausePhase");
425
426 switch (phase->level()) {
427 case 0: send_phase<EventGCPhasePause>(phase); break;
428 case 1: send_phase<EventGCPhasePauseLevel1>(phase); break;
429 case 2: send_phase<EventGCPhasePauseLevel2>(phase); break;
430 case 3: send_phase<EventGCPhasePauseLevel3>(phase); break;
431 default: /* Ignore sending this phase */ break;
432 }
433 }
434
435 void visit_concurrent(GCPhase* phase) {
436 assert(phase->level() < 1, "There is only one level for ConcurrentPhase");
437
438 switch (phase->level()) {
439 case 0: send_phase<EventGCPhaseConcurrent>(phase); break;
440 default: /* Ignore sending this phase */ break;
441 }
442 }
443
444 public:
445 template<typename T>
446 void send_phase(GCPhase* phase) {
447 T event(UNTIMED);
448 if (event.should_commit()) {
449 event.set_gcId(GCId::current());
450 event.set_name(phase->name());
|
1 /*
2 * Copyright (c) 2012, 2017, 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 *
411 if (e.should_commit()) {
412 e.set_gcId(GCId::current());
413 e.set_when((u1) when);
414 e.set_gcThreshold(meta_space_summary.capacity_until_GC());
415 e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
416 e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
417 e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
418 e.commit();
419 }
420 }
421
422 class PhaseSender : public PhaseVisitor {
423 void visit_pause(GCPhase* phase) {
424 assert(phase->level() < PhasesStack::PHASE_LEVELS, "Need more event types for PausePhase");
425
426 switch (phase->level()) {
427 case 0: send_phase<EventGCPhasePause>(phase); break;
428 case 1: send_phase<EventGCPhasePauseLevel1>(phase); break;
429 case 2: send_phase<EventGCPhasePauseLevel2>(phase); break;
430 case 3: send_phase<EventGCPhasePauseLevel3>(phase); break;
431 case 4: send_phase<EventGCPhasePauseLevel4>(phase); break;
432 default: /* Ignore sending this phase */ break;
433 }
434 }
435
436 void visit_concurrent(GCPhase* phase) {
437 assert(phase->level() < 1, "There is only one level for ConcurrentPhase");
438
439 switch (phase->level()) {
440 case 0: send_phase<EventGCPhaseConcurrent>(phase); break;
441 default: /* Ignore sending this phase */ break;
442 }
443 }
444
445 public:
446 template<typename T>
447 void send_phase(GCPhase* phase) {
448 T event(UNTIMED);
449 if (event.should_commit()) {
450 event.set_gcId(GCId::current());
451 event.set_name(phase->name());
|