Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_check/ScanFormatter.hpp
5990 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2014 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
/**
24
* @file
25
* @ingroup GC_Check
26
*/
27
28
#if !defined(SCANFORMATTER_HPP_)
29
#define SCANFORMATTER_HPP_
30
31
#include "j9.h"
32
#include "j9cfg.h"
33
34
#include "Base.hpp"
35
36
#define NUMBER_ELEMENTS_DISPLAYED_PER_LINE 8
37
38
class GC_ScanFormatter : public MM_Base
39
{
40
private:
41
J9PortLibrary *_portLibrary;
42
43
UDATA _currentCount;
44
bool _displayedData;
45
46
public:
47
void section(const char *type, void *pointer);
48
void section(const char *type);
49
void endSection();
50
void entry(void *pointer);
51
void end(const char *type, void *pointer);
52
void end(const char *type);
53
54
GC_ScanFormatter(J9PortLibrary *portLibrary, const char *title, void *pointer) :
55
MM_Base(),
56
_portLibrary(portLibrary),
57
_currentCount(0),
58
_displayedData(false)
59
{
60
PORT_ACCESS_FROM_PORT(_portLibrary);
61
j9tty_printf(PORTLIB, "<gc check: Start scan %s (%p)>\n", title, pointer);
62
}
63
64
GC_ScanFormatter(J9PortLibrary *portLibrary, const char *title) :
65
MM_Base(),
66
_portLibrary(portLibrary),
67
_currentCount(0),
68
_displayedData(false)
69
{
70
PORT_ACCESS_FROM_PORT(_portLibrary);
71
j9tty_printf(PORTLIB, "<gc check: Start scan %s>\n", title);
72
}
73
};
74
75
#endif /* SCANFORMATTER_HPP_ */
76
77