Skip to content

Commit 051f39e

Browse files
fandreuzDavid Holmes
authored andcommitted
8366864: Sort os/linux includes
Reviewed-by: ayang, dholmes
1 parent fb1924d commit 051f39e

14 files changed

+65
-63
lines changed

src/hotspot/os/linux/cgroupSubsystem_linux.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,22 @@
2222
*
2323
*/
2424

25-
#include <string.h>
26-
#include <math.h>
27-
#include <errno.h>
28-
#include <sys/vfs.h>
2925
#include "cgroupSubsystem_linux.hpp"
26+
#include "cgroupUtil_linux.hpp"
3027
#include "cgroupV1Subsystem_linux.hpp"
3128
#include "cgroupV2Subsystem_linux.hpp"
32-
#include "cgroupUtil_linux.hpp"
3329
#include "logging/log.hpp"
3430
#include "memory/allocation.hpp"
3531
#include "os_linux.hpp"
3632
#include "runtime/globals.hpp"
3733
#include "runtime/os.hpp"
3834
#include "utilities/globalDefinitions.hpp"
3935

36+
#include <errno.h>
37+
#include <math.h>
38+
#include <string.h>
39+
#include <sys/vfs.h>
40+
4041
// Inlined from <linux/magic.h> for portability.
4142
#ifndef CGROUP2_SUPER_MAGIC
4243
# define CGROUP2_SUPER_MAGIC 0x63677270

src/hotspot/os/linux/cgroupSubsystem_linux.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
#ifndef CGROUP_SUBSYSTEM_LINUX_HPP
2626
#define CGROUP_SUBSYSTEM_LINUX_HPP
2727

28+
#include "logging/log.hpp"
2829
#include "memory/allocation.hpp"
30+
#include "osContainer_linux.hpp"
2931
#include "runtime/os.hpp"
30-
#include "logging/log.hpp"
3132
#include "utilities/globalDefinitions.hpp"
3233
#include "utilities/macros.hpp"
33-
#include "osContainer_linux.hpp"
3434

3535
// Shared cgroups code (used by cgroup version 1 and version 2)
3636

src/hotspot/os/linux/cgroupUtil_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
*
2323
*/
2424

25-
#include "os_linux.hpp"
2625
#include "cgroupUtil_linux.hpp"
26+
#include "os_linux.hpp"
2727

2828
int CgroupUtil::processor_count(CgroupCpuController* cpu_ctrl, int host_cpus) {
2929
assert(host_cpus > 0, "physical host cpus must be positive");

src/hotspot/os/linux/cgroupUtil_linux.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#ifndef CGROUP_UTIL_LINUX_HPP
2626
#define CGROUP_UTIL_LINUX_HPP
2727

28-
#include "utilities/globalDefinitions.hpp"
2928
#include "cgroupSubsystem_linux.hpp"
29+
#include "utilities/globalDefinitions.hpp"
3030

3131
class CgroupUtil: AllStatic {
3232

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@
2222
*
2323
*/
2424

25-
#include <string.h>
26-
#include <math.h>
27-
#include <errno.h>
28-
#include "cgroupV1Subsystem_linux.hpp"
2925
#include "cgroupUtil_linux.hpp"
26+
#include "cgroupV1Subsystem_linux.hpp"
3027
#include "logging/log.hpp"
3128
#include "memory/allocation.hpp"
29+
#include "os_linux.hpp"
3230
#include "runtime/globals.hpp"
3331
#include "runtime/os.hpp"
3432
#include "utilities/globalDefinitions.hpp"
35-
#include "os_linux.hpp"
33+
34+
#include <errno.h>
35+
#include <math.h>
36+
#include <string.h>
3637

3738
/*
3839
* Set directory to subsystem specific files based

src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
#ifndef CGROUP_V1_SUBSYSTEM_LINUX_HPP
2626
#define CGROUP_V1_SUBSYSTEM_LINUX_HPP
2727

28-
#include "runtime/os.hpp"
29-
#include "memory/allocation.hpp"
3028
#include "cgroupSubsystem_linux.hpp"
3129
#include "cgroupUtil_linux.hpp"
30+
#include "memory/allocation.hpp"
31+
#include "runtime/os.hpp"
3232

3333
// Cgroups version 1 specific implementation
3434

src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*
2424
*/
2525

26-
#include "cgroupV2Subsystem_linux.hpp"
2726
#include "cgroupUtil_linux.hpp"
27+
#include "cgroupV2Subsystem_linux.hpp"
2828

2929
// Constructor
3030
CgroupV2Controller::CgroupV2Controller(char* mount_path,

src/hotspot/os/linux/osContainer_linux.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@
2222
*
2323
*/
2424

25-
#include <string.h>
26-
#include <math.h>
27-
#include <errno.h>
28-
#include "runtime/globals.hpp"
29-
#include "runtime/os.hpp"
25+
#include "cgroupSubsystem_linux.hpp"
3026
#include "logging/log.hpp"
3127
#include "os_linux.hpp"
3228
#include "osContainer_linux.hpp"
33-
#include "cgroupSubsystem_linux.hpp"
29+
#include "runtime/globals.hpp"
30+
#include "runtime/os.hpp"
31+
32+
#include <errno.h>
33+
#include <math.h>
34+
#include <string.h>
3435

3536

3637
bool OSContainer::_is_initialized = false;

src/hotspot/os/linux/osContainer_linux.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
#ifndef OS_LINUX_OSCONTAINER_LINUX_HPP
2626
#define OS_LINUX_OSCONTAINER_LINUX_HPP
2727

28+
#include "memory/allStatic.hpp"
2829
#include "utilities/globalDefinitions.hpp"
2930
#include "utilities/macros.hpp"
3031
#include "utilities/ostream.hpp"
31-
#include "memory/allStatic.hpp"
3232

3333
#define OSCONTAINER_ERROR (-2)
3434

src/hotspot/os/linux/os_linux.cpp

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
#include "memory/allocation.inline.hpp"
3737
#include "nmt/memTracker.hpp"
3838
#include "oops/oop.inline.hpp"
39-
#include "osContainer_linux.hpp"
4039
#include "os_linux.inline.hpp"
4140
#include "os_posix.inline.hpp"
41+
#include "osContainer_linux.hpp"
4242
#include "prims/jniFastGetField.hpp"
4343
#include "prims/jvm_misc.hpp"
4444
#include "runtime/arguments.hpp"
@@ -81,42 +81,39 @@
8181
#include "jfr/support/jfrNativeLibraryLoadEvent.hpp"
8282
#endif
8383

84-
// put OS-includes here
8584
# include <ctype.h>
86-
# include <stdlib.h>
87-
# include <sys/types.h>
88-
# include <sys/mman.h>
89-
# include <sys/stat.h>
90-
# include <sys/select.h>
91-
# include <sys/sendfile.h>
92-
# include <pthread.h>
93-
# include <signal.h>
85+
# include <dlfcn.h>
9486
# include <endian.h>
9587
# include <errno.h>
88+
# include <fcntl.h>
9689
# include <fenv.h>
97-
# include <dlfcn.h>
90+
# include <inttypes.h>
91+
# include <link.h>
92+
# include <linux/elf-em.h>
93+
# include <poll.h>
94+
# include <pthread.h>
95+
# include <pwd.h>
96+
# include <signal.h>
97+
# include <stdint.h>
9898
# include <stdio.h>
99-
# include <unistd.h>
99+
# include <stdlib.h>
100+
# include <string.h>
101+
# include <sys/ioctl.h>
102+
# include <sys/ipc.h>
103+
# include <sys/mman.h>
104+
# include <sys/prctl.h>
100105
# include <sys/resource.h>
101-
# include <pthread.h>
106+
# include <sys/select.h>
107+
# include <sys/sendfile.h>
108+
# include <sys/socket.h>
102109
# include <sys/stat.h>
110+
# include <sys/sysinfo.h>
103111
# include <sys/time.h>
104112
# include <sys/times.h>
113+
# include <sys/types.h>
105114
# include <sys/utsname.h>
106-
# include <sys/socket.h>
107-
# include <pwd.h>
108-
# include <poll.h>
109-
# include <fcntl.h>
110-
# include <string.h>
111115
# include <syscall.h>
112-
# include <sys/sysinfo.h>
113-
# include <sys/ipc.h>
114-
# include <link.h>
115-
# include <stdint.h>
116-
# include <inttypes.h>
117-
# include <sys/ioctl.h>
118-
# include <linux/elf-em.h>
119-
# include <sys/prctl.h>
116+
# include <unistd.h>
120117
#ifdef __GLIBC__
121118
# include <malloc.h>
122119
#endif

0 commit comments

Comments
 (0)