Skip to content

Commit 2b8d6dd

Browse files
committed
refactoring and copyright year update
Change-Id: Icff051d6f43253705c8c8cd4a6b2bb54d7e79240
1 parent 7ccc3a2 commit 2b8d6dd

File tree

5 files changed

+31
-33
lines changed

5 files changed

+31
-33
lines changed

src/cpucounters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
// Copyright (c) 2009-2022, Intel Corporation
2+
// Copyright (c) 2009-2024, Intel Corporation
33
// written by Roman Dementiev
44
// Otto Bruggeman
55
// Thomas Willhalm

src/cpucounters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
// Copyright (c) 2009-2022, Intel Corporation
2+
// Copyright (c) 2009-2024, Intel Corporation
33
// written by Roman Dementiev
44
// Thomas Willhalm
55
// and others

src/pcm-accel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
// Copyright (c) 2022, Intel Corporation
2+
// Copyright (c) 2022-2024, Intel Corporation
33
// written by White.Hu
44

55
#include "pcm-accel-common.h"

src/tpmi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
// Copyright (c) 2023, Intel Corporation
2+
// Copyright (c) 2023-2024, Intel Corporation
33
// written by Roman Dementiev
44
//
55

src/types.h

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
// Copyright (c) 2009-2022, Intel Corporation
2+
// Copyright (c) 2009-2024, Intel Corporation
33
// written by Roman Dementiev
44
//
55

@@ -39,43 +39,41 @@ typedef signed int int32;
3939
#define PCM_ULIMIT_RECOMMENDATION ("try executing 'ulimit -n 1000000' to increase the limit on the number of open files.\n")
4040

4141
/*
42-
MSR addresses from
43-
"Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B:
44-
System Programming Guide, Part 2", Appendix A "PERFORMANCE-MONITORING EVENTS"
42+
MSR addresses from
43+
"Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B:
44+
System Programming Guide, Part 2", Appendix A "PERFORMANCE-MONITORING EVENTS"
4545
*/
4646

47-
#define INST_RETIRED_ADDR (0x309)
48-
#define CPU_CLK_UNHALTED_THREAD_ADDR (0x30A)
49-
#define CPU_CLK_UNHALTED_REF_ADDR (0x30B)
50-
#define TOPDOWN_SLOTS_ADDR (0x30C)
51-
#define PERF_METRICS_ADDR (0x329)
52-
#define IA32_CR_PERF_GLOBAL_CTRL (0x38F)
53-
#define IA32_CR_FIXED_CTR_CTRL (0x38D)
54-
#define IA32_PERFEVTSEL0_ADDR (0x186)
55-
#define IA32_PERFEVTSEL1_ADDR (IA32_PERFEVTSEL0_ADDR + 1)
56-
#define IA32_PERFEVTSEL2_ADDR (IA32_PERFEVTSEL0_ADDR + 2)
57-
#define IA32_PERFEVTSEL3_ADDR (IA32_PERFEVTSEL0_ADDR + 3)
58-
47+
constexpr auto INST_RETIRED_ADDR = 0x309;
48+
constexpr auto CPU_CLK_UNHALTED_THREAD_ADDR = 0x30A;
49+
constexpr auto CPU_CLK_UNHALTED_REF_ADDR = 0x30B;
50+
constexpr auto TOPDOWN_SLOTS_ADDR = 0x30C;
51+
constexpr auto PERF_METRICS_ADDR = 0x329;
52+
constexpr auto IA32_CR_PERF_GLOBAL_CTRL = 0x38F;
53+
constexpr auto IA32_CR_FIXED_CTR_CTRL = 0x38D;
54+
constexpr auto IA32_PERFEVTSEL0_ADDR = 0x186;
55+
constexpr auto IA32_PERFEVTSEL1_ADDR = IA32_PERFEVTSEL0_ADDR + 1;
56+
constexpr auto IA32_PERFEVTSEL2_ADDR = IA32_PERFEVTSEL0_ADDR + 2;
57+
constexpr auto IA32_PERFEVTSEL3_ADDR = IA32_PERFEVTSEL0_ADDR + 3;
5958
constexpr auto IA32_PERF_GLOBAL_STATUS = 0x38E;
6059
constexpr auto IA32_PERF_GLOBAL_OVF_CTRL = 0x390;
6160
constexpr auto IA32_PEBS_ENABLE_ADDR = 0x3F1;
6261

63-
#define PERF_MAX_FIXED_COUNTERS (3)
64-
#define PERF_MAX_CUSTOM_COUNTERS (8)
65-
#define PERF_TOPDOWN_COUNTERS_L1 (5)
66-
#define PERF_TOPDOWN_COUNTERS (PERF_TOPDOWN_COUNTERS_L1 + 4)
67-
#define PERF_MAX_COUNTERS (PERF_MAX_FIXED_COUNTERS + PERF_MAX_CUSTOM_COUNTERS + PERF_TOPDOWN_COUNTERS)
68-
69-
#define IA32_DEBUGCTL (0x1D9)
62+
constexpr auto PERF_MAX_FIXED_COUNTERS = 3;
63+
constexpr auto PERF_MAX_CUSTOM_COUNTERS = 8;
64+
constexpr auto PERF_TOPDOWN_COUNTERS_L1 = 5;
65+
constexpr auto PERF_TOPDOWN_COUNTERS = PERF_TOPDOWN_COUNTERS_L1 + 4;
66+
constexpr auto PERF_MAX_COUNTERS = PERF_MAX_FIXED_COUNTERS + PERF_MAX_CUSTOM_COUNTERS + PERF_TOPDOWN_COUNTERS;
7067

71-
#define IA32_PMC0 (0xC1)
72-
#define IA32_PMC1 (0xC1 + 1)
73-
#define IA32_PMC2 (0xC1 + 2)
74-
#define IA32_PMC3 (0xC1 + 3)
68+
constexpr auto IA32_DEBUGCTL = 0x1D9;
7569

76-
#define MSR_OFFCORE_RSP0 (0x1A6)
77-
#define MSR_OFFCORE_RSP1 (0x1A7)
70+
constexpr auto IA32_PMC0 = 0xC1;
71+
constexpr auto IA32_PMC1 = IA32_PMC0 + 1;
72+
constexpr auto IA32_PMC2 = IA32_PMC0 + 2;
73+
constexpr auto IA32_PMC3 = IA32_PMC0 + 3;
7874

75+
constexpr auto MSR_OFFCORE_RSP0 = 0x1A6;
76+
constexpr auto MSR_OFFCORE_RSP1 = 0x1A7;
7977
constexpr auto MSR_LOAD_LATENCY = 0x3F6;
8078
constexpr auto MSR_FRONTEND = 0x3F7;
8179

0 commit comments

Comments
 (0)