Commit 1a410d88 authored by Anton Blanchard's avatar Anton Blanchard Committed by Paul Mackerras

[PATCH] ppc64: Add oprofile cpu_type to cpu feature struct

Add oprofile cpu_type to cpu feature struct.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a6908cd0
...@@ -60,6 +60,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -60,6 +60,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/power3",
}, },
{ /* Power3+ */ { /* Power3+ */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -72,6 +73,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -72,6 +73,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/power3",
}, },
{ /* Northstar */ { /* Northstar */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -85,6 +87,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -85,6 +87,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64",
}, },
{ /* Pulsar */ { /* Pulsar */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -98,6 +101,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -98,6 +101,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64",
}, },
{ /* I-star */ { /* I-star */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -111,6 +115,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -111,6 +115,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64",
}, },
{ /* S-star */ { /* S-star */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -124,6 +129,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -124,6 +129,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power3, .cpu_setup = __setup_cpu_power3,
.oprofile_cpu_type = "ppc64/rs64",
}, },
{ /* Power4 */ { /* Power4 */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -137,6 +143,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -137,6 +143,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power4",
}, },
{ /* Power4+ */ { /* Power4+ */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -150,6 +157,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -150,6 +157,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power4",
}, },
{ /* PPC970 */ { /* PPC970 */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -165,6 +173,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -165,6 +173,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970",
}, },
{ /* PPC970FX */ { /* PPC970FX */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -180,6 +189,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -180,6 +189,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 8, .num_pmcs = 8,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970",
}, },
{ /* PPC970MP */ { /* PPC970MP */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -194,6 +204,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -194,6 +204,7 @@ struct cpu_spec cpu_specs[] = {
.icache_bsize = 128, .icache_bsize = 128,
.dcache_bsize = 128, .dcache_bsize = 128,
.cpu_setup = __setup_cpu_ppc970, .cpu_setup = __setup_cpu_ppc970,
.oprofile_cpu_type = "ppc64/970",
}, },
{ /* Power5 */ { /* Power5 */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -209,6 +220,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -209,6 +220,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power5",
}, },
{ /* Power5 */ { /* Power5 */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
...@@ -224,6 +236,7 @@ struct cpu_spec cpu_specs[] = { ...@@ -224,6 +236,7 @@ struct cpu_spec cpu_specs[] = {
.dcache_bsize = 128, .dcache_bsize = 128,
.num_pmcs = 6, .num_pmcs = 6,
.cpu_setup = __setup_cpu_power4, .cpu_setup = __setup_cpu_power4,
.oprofile_cpu_type = "ppc64/power5",
}, },
{ /* BE DD1.x */ { /* BE DD1.x */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
......
...@@ -132,7 +132,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) ...@@ -132,7 +132,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
case PV_630: case PV_630:
case PV_630p: case PV_630p:
model = &op_model_rs64; model = &op_model_rs64;
ops->cpu_type = "ppc64/power3";
break; break;
case PV_NORTHSTAR: case PV_NORTHSTAR:
...@@ -140,32 +139,29 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) ...@@ -140,32 +139,29 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
case PV_ICESTAR: case PV_ICESTAR:
case PV_SSTAR: case PV_SSTAR:
model = &op_model_rs64; model = &op_model_rs64;
ops->cpu_type = "ppc64/rs64";
break; break;
case PV_POWER4: case PV_POWER4:
case PV_POWER4p: case PV_POWER4p:
model = &op_model_power4; model = &op_model_power4;
ops->cpu_type = "ppc64/power4";
break; break;
case PV_970: case PV_970:
case PV_970FX: case PV_970FX:
case PV_970MP: case PV_970MP:
model = &op_model_power4; model = &op_model_power4;
ops->cpu_type = "ppc64/970";
break; break;
case PV_POWER5: case PV_POWER5:
case PV_POWER5p: case PV_POWER5p:
model = &op_model_power4; model = &op_model_power4;
ops->cpu_type = "ppc64/power5";
break; break;
default: default:
return -ENODEV; return -ENODEV;
} }
ops->cpu_type = cur_cpu_spec->oprofile_cpu_type;
model->num_counters = cur_cpu_spec->num_pmcs; model->num_counters = cur_cpu_spec->num_pmcs;
ops->create_files = op_ppc64_create_files; ops->create_files = op_ppc64_create_files;
ops->setup = op_ppc64_setup; ops->setup = op_ppc64_setup;
......
...@@ -59,6 +59,9 @@ struct cpu_spec { ...@@ -59,6 +59,9 @@ struct cpu_spec {
* BHT, SPD, etc... from head.S before branching to identify_machine * BHT, SPD, etc... from head.S before branching to identify_machine
*/ */
cpu_setup_t cpu_setup; cpu_setup_t cpu_setup;
/* Used by oprofile userspace to select the right counters */
char *oprofile_cpu_type;
}; };
extern struct cpu_spec cpu_specs[]; extern struct cpu_spec cpu_specs[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment