Skip to content

Commit 23108b1

Browse files
committed
Some IWYU changes
1 parent 9e1f80b commit 23108b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+309
-184
lines changed

src/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ if(UNIX) # APPLE, LINUX, FREE_BSD
168168
# Daemon & client
169169
file(GLOB DAEMON_SOURCES "daemon/*.cpp")
170170
add_executable(daemon ${DAEMON_SOURCES})
171+
target_include_directories(daemon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
171172
target_link_libraries(daemon PRIVATE PCM_STATIC Threads::Threads)
172173
set_target_properties(daemon PROPERTIES OUTPUT_NAME "pcm-daemon")
173174
install(TARGETS daemon DESTINATION ${CMAKE_INSTALL_SBINDIR})
174175

175176
file(GLOB CLIENT_SOURCES "client/*.cpp")
176177
add_executable(client ${CLIENT_SOURCES})
178+
target_include_directories(client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
177179
target_link_libraries(client PRIVATE Threads::Threads)
178180
set_target_properties(client PROPERTIES OUTPUT_NAME "pcm-client")
179181
install(TARGETS client DESTINATION ${CMAKE_INSTALL_BINDIR})

src/bw.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
//
66

77
#include <iostream>
8+
#include <exception>
9+
#include "mmio.h"
810
#include "bw.h"
911
#include "pci.h"
1012
#include "utils.h"
@@ -179,4 +181,4 @@ uint64 ServerBW::getPMMWrites()
179181
return result;
180182
}
181183

182-
} // namespace pcm
184+
} // namespace pcm

src/bw.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
#include <memory>
1414
#include <vector>
1515
#include <array>
16-
#include "mmio.h"
16+
#include <stddef.h>
17+
#include "types.h"
18+
19+
namespace pcm {
20+
class MMIORange;
21+
}
1722

1823
namespace pcm {
1924

@@ -70,4 +75,4 @@ class ServerBW
7075
uint64 getPMMWrites();
7176
};
7277

73-
} // namespace pcm
78+
} // namespace pcm

src/client/client.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
// Copyright (c) 2009-2017, Intel Corporation
33
// written by Steven Briscoe
44

5-
#include <cstdlib>
65
#include <iostream>
76
#include <unistd.h>
8-
#include <sys/types.h>
9-
#include <sys/ipc.h>
107
#include <sys/shm.h>
118
#include <errno.h>
12-
#include <sstream>
13-
#include <exception>
149
#include <stdexcept>
15-
#include <grp.h>
1610
#include <stdio.h>
1711
#include <stdlib.h>
12+
#include <string.h>
13+
#include <sstream>
1814

1915
#include "../daemon/common.h"
2016
#include "client.h"

src/client/client.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
// Copyright (c) 2009-2017, Intel Corporation
33
// written by Steven Briscoe
44

5-
#include <sys/types.h>
65
#include <string>
7-
#include <grp.h>
8-
6+
#include "../daemon/common.h"
97

108
#ifndef CLIENT_H_
119
#define CLIENT_H_
1210

13-
#include "../daemon/common.h"
14-
1511
namespace PCMDaemon {
1612

1713
class Client {

src/client/main.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <iostream>
88
#include <iomanip>
99
#include <cstdlib>
10+
#include <string>
11+
#include "daemon/common.h"
1012

1113
#include "client.h"
1214

src/cpucounters.cpp

+21-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
#include "winring0/OlsApiInit.h"
4747
#include "windows/windriver.h"
4848
#else
49+
#include <sched.h>
4950
#include <pthread.h>
51+
#include <unistd.h>
5052
#if defined(__FreeBSD__) || (defined(__DragonFly__) && __DragonFly_version >= 400707)
5153
#include <pthread_np.h>
5254
#include <sys/_cpuset.h>
@@ -58,20 +60,37 @@
5860
#include <sys/mman.h>
5961
#include <dirent.h>
6062
#include <sys/resource.h>
63+
#include <bits/strings_fortified.h>
64+
65+
#ifdef PCM_USE_PERF
66+
#include <linux/perf_event.h>
67+
#include <syscall.h>
68+
#endif
69+
6170
#endif
6271
#endif
6372

6473
#include <string.h>
65-
#include <limits>
6674
#include <map>
6775
#include <algorithm>
6876
#include <thread>
6977
#include <future>
70-
#include <functional>
7178
#include <queue>
7279
#include <condition_variable>
7380
#include <mutex>
7481
#include <atomic>
82+
#include <fcntl.h>
83+
#include <sys/types.h>
84+
#include <cstdlib>
85+
#include <fstream>
86+
#include <initializer_list>
87+
#include <iomanip>
88+
#include <stdexcept>
89+
#include <system_error>
90+
#include "bw.h"
91+
#include "exceptions/unsupported_processor_exception.hpp"
92+
#include "mutex.h"
93+
#include "width_extender.h"
7594

7695
#ifdef __APPLE__
7796
#include <sys/types.h>

src/cpucounters.h

+21-26
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,29 @@
2626
#include "topologyentry.h"
2727
#include "msr.h"
2828
#include "pci.h"
29-
#include "bw.h"
30-
#include "width_extender.h"
31-
#include "exceptions/unsupported_processor_exception.hpp"
3229

3330
#include <vector>
3431
#include <array>
35-
#include <limits>
3632
#include <string>
3733
#include <memory>
3834
#include <map>
3935
#include <unordered_map>
4036
#include <string.h>
4137
#include <assert.h>
4238

39+
#include <algorithm>
40+
#include <exception>
41+
#include <iostream>
42+
#include <type_traits>
43+
#include <utility>
44+
#include "mmio.h"
45+
#include "utils.h"
46+
#include "width_extender.h"
47+
4348
#ifdef PCM_USE_PERF
44-
#include <linux/perf_event.h>
45-
#include <errno.h>
4649
#define PCM_PERF_COUNT_HW_REF_CPU_CYCLES (9)
4750
#endif
4851

49-
#ifndef _MSC_VER
50-
#define NOMINMAX
51-
#include <semaphore.h>
52-
#include <sys/types.h>
53-
#include <sys/stat.h>
54-
#include <fcntl.h>
55-
#include <sys/syscall.h>
56-
#include <unistd.h>
57-
#endif
58-
5952
#ifdef _MSC_VER
6053
#if _MSC_VER>= 1600
6154
#include <intrin.h>
@@ -66,20 +59,24 @@
6659
#include "resctrl.h"
6760
#endif
6861

62+
namespace pcm {
63+
class FreeRunningBWCounters;
64+
class ServerBW;
65+
class SystemCounterState;
66+
class SocketCounterState;
67+
class CoreCounterState;
68+
class ServerUncoreCounterState;
69+
class PCM;
70+
class CoreTaskQueue;
71+
class SystemRoot;
72+
}
73+
6974
namespace pcm {
7075

7176
#ifdef _MSC_VER
7277
void PCM_API restrictDriverAccess(LPCTSTR path);
7378
#endif
7479

75-
class SystemCounterState;
76-
class SocketCounterState;
77-
class CoreCounterState;
78-
class BasicCounterState;
79-
class ServerUncoreCounterState;
80-
class PCM;
81-
class CoreTaskQueue;
82-
class SystemRoot;
8380

8481
/*
8582
CPU performance monitoring routines
@@ -503,8 +500,6 @@ typedef SimpleCounterState PCIeCounterState;
503500
typedef SimpleCounterState IIOCounterState;
504501
typedef std::vector<uint64> eventGroup_t;
505502

506-
class PerfVirtualControlRegister;
507-
508503
/*!
509504
\brief CPU Performance Monitor
510505

src/daemon/daemon.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,35 @@
44

55
#include <cstdlib>
66
#include <iostream>
7-
#include <cstring>
87
#include <algorithm>
98
#include <unistd.h>
109
#include <sys/types.h>
1110
#include <sys/ipc.h>
1211
#include <sys/shm.h>
1312
#include <errno.h>
1413
#include <time.h>
14+
#include <bits/getopt_core.h>
15+
#include <bits/types/struct_tm.h>
16+
#include <ctype.h>
17+
#include <grp.h>
18+
#include <stdio.h>
19+
#include <memory>
20+
#include <new>
21+
#include <utility>
22+
#include "types.h"
23+
#include "utils.h"
24+
25+
#ifdef __linux__
26+
#include <ext/alloc_traits.h>
27+
#endif
1528

1629
#ifndef CLOCK_MONOTONIC_RAW
1730
#define CLOCK_MONOTONIC_RAW (4) /* needed for SLES11 */
1831
#endif
1932

2033
#include "daemon.h"
2134
#include "common.h"
22-
#include "pcm.h"
35+
#include "exceptions/unsupported_processor_exception.hpp"
2336

2437
namespace PCMDaemon {
2538

src/daemon/daemon.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
#include <sys/types.h>
99
#include <map>
1010
#include <string>
11-
#include <grp.h>
1211

1312
#include "common.h"
14-
#include "pcm.h"
13+
#include <vector>
14+
#include "cpucounters.h"
15+
16+
using namespace pcm;
1517

1618
namespace PCMDaemon {
1719

src/dashboard.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <vector>
55
#include <memory>
66
#include <unistd.h>
7+
#include <initializer_list>
8+
#include <mutex>
79
#include "cpucounters.h"
810
#include "dashboard.h"
911

src/mmio.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66

77
#include <iostream>
88
#include <string.h>
9-
#ifndef _MSC_VER
10-
#include <sys/types.h>
11-
#endif
12-
#include <sys/stat.h>
9+
#include <exception>
1310
#include <fcntl.h>
14-
#include "pci.h"
1511
#include "mmio.h"
1612

1713
#ifndef _MSC_VER
@@ -22,10 +18,10 @@
2218
#ifdef _MSC_VER
2319
#include <windows.h>
2420
#include "utils.h"
21+
#else
22+
#include <unistd.h>
2523
#endif
2624

27-
#include <assert.h>
28-
2925
namespace pcm {
3026

3127
#ifdef _MSC_VER

src/mmio.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
#include "windows.h"
1818
#include "winpmem\winpmem.h"
1919
#include "Winmsrdriver\msrstruct.h"
20-
#else
21-
#include <unistd.h>
22-
#endif
23-
2420
#include "mutex.h"
25-
#include <memory>
21+
#endif
2622

2723
namespace pcm {
2824

@@ -152,4 +148,4 @@ class MMIORange
152148
};
153149
#endif
154150

155-
} // namespace pcm
151+
} // namespace pcm

src/msr.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
// Austen Ott
55
// Jim Harris (FreeBSD)
66

7-
#include <sys/types.h>
87
#include <stdio.h>
9-
#include <sys/stat.h>
108
#include <fcntl.h>
119
#ifndef _MSC_VER
1210
#include <unistd.h>
1311
#endif
1412
#include "types.h"
1513
#include "msr.h"
1614
#include "utils.h"
17-
#include <assert.h>
15+
16+
#include <errno.h>
17+
#include <string.h>
18+
#include <exception>
19+
#include <iostream>
20+
#include <string>
1821

1922
#ifdef _MSC_VER
2023

@@ -30,8 +33,6 @@
3033
#include <sys/cpuctl.h>
3134
#endif
3235

33-
#include <mutex>
34-
3536
namespace pcm {
3637

3738
#ifdef _MSC_VER

src/msr.h

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414

1515
#include "types.h"
16+
#include <stdexcept>
1617

1718
#ifdef _MSC_VER
1819
#include "windows.h"

0 commit comments

Comments
 (0)