aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-09-06 00:53:57 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-06 02:09:21 -0400
commit1a410d883023da70806a0190c4bde104545cb9c6 (patch)
treefbc47ca22df94ed69e78d9abe9153cbe22a74924
parenta6908cd00036080fbea14ff67335e5f2a1ab5489 (diff)
[PATCH] ppc64: Add oprofile cpu_type to cpu feature struct
Add oprofile cpu_type to cpu feature struct. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/ppc64/kernel/cputable.c13
-rw-r--r--arch/ppc64/oprofile/common.c6
-rw-r--r--include/asm-ppc64/cputable.h3
3 files changed, 17 insertions, 5 deletions
diff --git a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c
index 25ab72323c58..c022ec4d1e91 100644
--- a/arch/ppc64/kernel/cputable.c
+++ b/arch/ppc64/kernel/cputable.c
@@ -60,6 +60,7 @@ struct cpu_spec cpu_specs[] = {
60 .dcache_bsize = 128, 60 .dcache_bsize = 128,
61 .num_pmcs = 8, 61 .num_pmcs = 8,
62 .cpu_setup = __setup_cpu_power3, 62 .cpu_setup = __setup_cpu_power3,
63 .oprofile_cpu_type = "ppc64/power3",
63 }, 64 },
64 { /* Power3+ */ 65 { /* Power3+ */
65 .pvr_mask = 0xffff0000, 66 .pvr_mask = 0xffff0000,
@@ -72,6 +73,7 @@ struct cpu_spec cpu_specs[] = {
72 .dcache_bsize = 128, 73 .dcache_bsize = 128,
73 .num_pmcs = 8, 74 .num_pmcs = 8,
74 .cpu_setup = __setup_cpu_power3, 75 .cpu_setup = __setup_cpu_power3,
76 .oprofile_cpu_type = "ppc64/power3",
75 }, 77 },
76 { /* Northstar */ 78 { /* Northstar */
77 .pvr_mask = 0xffff0000, 79 .pvr_mask = 0xffff0000,
@@ -85,6 +87,7 @@ struct cpu_spec cpu_specs[] = {
85 .dcache_bsize = 128, 87 .dcache_bsize = 128,
86 .num_pmcs = 8, 88 .num_pmcs = 8,
87 .cpu_setup = __setup_cpu_power3, 89 .cpu_setup = __setup_cpu_power3,
90 .oprofile_cpu_type = "ppc64/rs64",
88 }, 91 },
89 { /* Pulsar */ 92 { /* Pulsar */
90 .pvr_mask = 0xffff0000, 93 .pvr_mask = 0xffff0000,
@@ -98,6 +101,7 @@ struct cpu_spec cpu_specs[] = {
98 .dcache_bsize = 128, 101 .dcache_bsize = 128,
99 .num_pmcs = 8, 102 .num_pmcs = 8,
100 .cpu_setup = __setup_cpu_power3, 103 .cpu_setup = __setup_cpu_power3,
104 .oprofile_cpu_type = "ppc64/rs64",
101 }, 105 },
102 { /* I-star */ 106 { /* I-star */
103 .pvr_mask = 0xffff0000, 107 .pvr_mask = 0xffff0000,
@@ -111,6 +115,7 @@ struct cpu_spec cpu_specs[] = {
111 .dcache_bsize = 128, 115 .dcache_bsize = 128,
112 .num_pmcs = 8, 116 .num_pmcs = 8,
113 .cpu_setup = __setup_cpu_power3, 117 .cpu_setup = __setup_cpu_power3,
118 .oprofile_cpu_type = "ppc64/rs64",
114 }, 119 },
115 { /* S-star */ 120 { /* S-star */
116 .pvr_mask = 0xffff0000, 121 .pvr_mask = 0xffff0000,
@@ -124,6 +129,7 @@ struct cpu_spec cpu_specs[] = {
124 .dcache_bsize = 128, 129 .dcache_bsize = 128,
125 .num_pmcs = 8, 130 .num_pmcs = 8,
126 .cpu_setup = __setup_cpu_power3, 131 .cpu_setup = __setup_cpu_power3,
132 .oprofile_cpu_type = "ppc64/rs64",
127 }, 133 },
128 { /* Power4 */ 134 { /* Power4 */
129 .pvr_mask = 0xffff0000, 135 .pvr_mask = 0xffff0000,
@@ -137,6 +143,7 @@ struct cpu_spec cpu_specs[] = {
137 .dcache_bsize = 128, 143 .dcache_bsize = 128,
138 .num_pmcs = 8, 144 .num_pmcs = 8,
139 .cpu_setup = __setup_cpu_power4, 145 .cpu_setup = __setup_cpu_power4,
146 .oprofile_cpu_type = "ppc64/power4",
140 }, 147 },
141 { /* Power4+ */ 148 { /* Power4+ */
142 .pvr_mask = 0xffff0000, 149 .pvr_mask = 0xffff0000,
@@ -150,6 +157,7 @@ struct cpu_spec cpu_specs[] = {
150 .dcache_bsize = 128, 157 .dcache_bsize = 128,
151 .num_pmcs = 8, 158 .num_pmcs = 8,
152 .cpu_setup = __setup_cpu_power4, 159 .cpu_setup = __setup_cpu_power4,
160 .oprofile_cpu_type = "ppc64/power4",
153 }, 161 },
154 { /* PPC970 */ 162 { /* PPC970 */
155 .pvr_mask = 0xffff0000, 163 .pvr_mask = 0xffff0000,
@@ -165,6 +173,7 @@ struct cpu_spec cpu_specs[] = {
165 .dcache_bsize = 128, 173 .dcache_bsize = 128,
166 .num_pmcs = 8, 174 .num_pmcs = 8,
167 .cpu_setup = __setup_cpu_ppc970, 175 .cpu_setup = __setup_cpu_ppc970,
176 .oprofile_cpu_type = "ppc64/970",
168 }, 177 },
169 { /* PPC970FX */ 178 { /* PPC970FX */
170 .pvr_mask = 0xffff0000, 179 .pvr_mask = 0xffff0000,
@@ -180,6 +189,7 @@ struct cpu_spec cpu_specs[] = {
180 .dcache_bsize = 128, 189 .dcache_bsize = 128,
181 .num_pmcs = 8, 190 .num_pmcs = 8,
182 .cpu_setup = __setup_cpu_ppc970, 191 .cpu_setup = __setup_cpu_ppc970,
192 .oprofile_cpu_type = "ppc64/970",
183 }, 193 },
184 { /* PPC970MP */ 194 { /* PPC970MP */
185 .pvr_mask = 0xffff0000, 195 .pvr_mask = 0xffff0000,
@@ -194,6 +204,7 @@ struct cpu_spec cpu_specs[] = {
194 .icache_bsize = 128, 204 .icache_bsize = 128,
195 .dcache_bsize = 128, 205 .dcache_bsize = 128,
196 .cpu_setup = __setup_cpu_ppc970, 206 .cpu_setup = __setup_cpu_ppc970,
207 .oprofile_cpu_type = "ppc64/970",
197 }, 208 },
198 { /* Power5 */ 209 { /* Power5 */
199 .pvr_mask = 0xffff0000, 210 .pvr_mask = 0xffff0000,
@@ -209,6 +220,7 @@ struct cpu_spec cpu_specs[] = {
209 .dcache_bsize = 128, 220 .dcache_bsize = 128,
210 .num_pmcs = 6, 221 .num_pmcs = 6,
211 .cpu_setup = __setup_cpu_power4, 222 .cpu_setup = __setup_cpu_power4,
223 .oprofile_cpu_type = "ppc64/power5",
212 }, 224 },
213 { /* Power5 */ 225 { /* Power5 */
214 .pvr_mask = 0xffff0000, 226 .pvr_mask = 0xffff0000,
@@ -224,6 +236,7 @@ struct cpu_spec cpu_specs[] = {
224 .dcache_bsize = 128, 236 .dcache_bsize = 128,
225 .num_pmcs = 6, 237 .num_pmcs = 6,
226 .cpu_setup = __setup_cpu_power4, 238 .cpu_setup = __setup_cpu_power4,
239 .oprofile_cpu_type = "ppc64/power5",
227 }, 240 },
228 { /* BE DD1.x */ 241 { /* BE DD1.x */
229 .pvr_mask = 0xffff0000, 242 .pvr_mask = 0xffff0000,
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index a376eb2a1f0f..0260122a8d6c 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -132,7 +132,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
132 case PV_630: 132 case PV_630:
133 case PV_630p: 133 case PV_630p:
134 model = &op_model_rs64; 134 model = &op_model_rs64;
135 ops->cpu_type = "ppc64/power3";
136 break; 135 break;
137 136
138 case PV_NORTHSTAR: 137 case PV_NORTHSTAR:
@@ -140,32 +139,29 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
140 case PV_ICESTAR: 139 case PV_ICESTAR:
141 case PV_SSTAR: 140 case PV_SSTAR:
142 model = &op_model_rs64; 141 model = &op_model_rs64;
143 ops->cpu_type = "ppc64/rs64";
144 break; 142 break;
145 143
146 case PV_POWER4: 144 case PV_POWER4:
147 case PV_POWER4p: 145 case PV_POWER4p:
148 model = &op_model_power4; 146 model = &op_model_power4;
149 ops->cpu_type = "ppc64/power4";
150 break; 147 break;
151 148
152 case PV_970: 149 case PV_970:
153 case PV_970FX: 150 case PV_970FX:
154 case PV_970MP: 151 case PV_970MP:
155 model = &op_model_power4; 152 model = &op_model_power4;
156 ops->cpu_type = "ppc64/970";
157 break; 153 break;
158 154
159 case PV_POWER5: 155 case PV_POWER5:
160 case PV_POWER5p: 156 case PV_POWER5p:
161 model = &op_model_power4; 157 model = &op_model_power4;
162 ops->cpu_type = "ppc64/power5";
163 break; 158 break;
164 159
165 default: 160 default:
166 return -ENODEV; 161 return -ENODEV;
167 } 162 }
168 163
164 ops->cpu_type = cur_cpu_spec->oprofile_cpu_type;
169 model->num_counters = cur_cpu_spec->num_pmcs; 165 model->num_counters = cur_cpu_spec->num_pmcs;
170 ops->create_files = op_ppc64_create_files; 166 ops->create_files = op_ppc64_create_files;
171 ops->setup = op_ppc64_setup; 167 ops->setup = op_ppc64_setup;
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h
index 80b907727a79..445727ae2baa 100644
--- a/include/asm-ppc64/cputable.h
+++ b/include/asm-ppc64/cputable.h
@@ -59,6 +59,9 @@ struct cpu_spec {
59 * BHT, SPD, etc... from head.S before branching to identify_machine 59 * BHT, SPD, etc... from head.S before branching to identify_machine
60 */ 60 */
61 cpu_setup_t cpu_setup; 61 cpu_setup_t cpu_setup;
62
63 /* Used by oprofile userspace to select the right counters */
64 char *oprofile_cpu_type;
62}; 65};
63 66
64extern struct cpu_spec cpu_specs[]; 67extern struct cpu_spec cpu_specs[];