diff options
Diffstat (limited to 'arch/powerpc/oprofile')
-rw-r--r-- | arch/powerpc/oprofile/common.c | 28 | ||||
-rw-r--r-- | arch/powerpc/oprofile/op_model_fsl_emb.c | 30 |
2 files changed, 44 insertions, 14 deletions
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c index 4f51025f5b00..c77348c5d463 100644 --- a/arch/powerpc/oprofile/common.c +++ b/arch/powerpc/oprofile/common.c | |||
@@ -119,7 +119,7 @@ static void op_powerpc_stop(void) | |||
119 | model->global_stop(); | 119 | model->global_stop(); |
120 | } | 120 | } |
121 | 121 | ||
122 | static int op_powerpc_create_files(struct super_block *sb, struct dentry *root) | 122 | static int op_powerpc_create_files(struct dentry *root) |
123 | { | 123 | { |
124 | int i; | 124 | int i; |
125 | 125 | ||
@@ -128,9 +128,9 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root) | |||
128 | * There is one mmcr0, mmcr1 and mmcra for setting the events for | 128 | * There is one mmcr0, mmcr1 and mmcra for setting the events for |
129 | * all of the counters. | 129 | * all of the counters. |
130 | */ | 130 | */ |
131 | oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0); | 131 | oprofilefs_create_ulong(root, "mmcr0", &sys.mmcr0); |
132 | oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1); | 132 | oprofilefs_create_ulong(root, "mmcr1", &sys.mmcr1); |
133 | oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra); | 133 | oprofilefs_create_ulong(root, "mmcra", &sys.mmcra); |
134 | #ifdef CONFIG_OPROFILE_CELL | 134 | #ifdef CONFIG_OPROFILE_CELL |
135 | /* create a file the user tool can check to see what level of profiling | 135 | /* create a file the user tool can check to see what level of profiling |
136 | * support exits with this kernel. Initialize bit mask to indicate | 136 | * support exits with this kernel. Initialize bit mask to indicate |
@@ -142,7 +142,7 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root) | |||
142 | * If the file does not exist, then the kernel only supports SPU | 142 | * If the file does not exist, then the kernel only supports SPU |
143 | * cycle profiling, PPU event and cycle profiling. | 143 | * cycle profiling, PPU event and cycle profiling. |
144 | */ | 144 | */ |
145 | oprofilefs_create_ulong(sb, root, "cell_support", &sys.cell_support); | 145 | oprofilefs_create_ulong(root, "cell_support", &sys.cell_support); |
146 | sys.cell_support = 0x1; /* Note, the user OProfile tool must check | 146 | sys.cell_support = 0x1; /* Note, the user OProfile tool must check |
147 | * that this bit is set before attempting to | 147 | * that this bit is set before attempting to |
148 | * user SPU event profiling. Older kernels | 148 | * user SPU event profiling. Older kernels |
@@ -160,11 +160,11 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root) | |||
160 | char buf[4]; | 160 | char buf[4]; |
161 | 161 | ||
162 | snprintf(buf, sizeof buf, "%d", i); | 162 | snprintf(buf, sizeof buf, "%d", i); |
163 | dir = oprofilefs_mkdir(sb, root, buf); | 163 | dir = oprofilefs_mkdir(root, buf); |
164 | 164 | ||
165 | oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled); | 165 | oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled); |
166 | oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event); | 166 | oprofilefs_create_ulong(dir, "event", &ctr[i].event); |
167 | oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count); | 167 | oprofilefs_create_ulong(dir, "count", &ctr[i].count); |
168 | 168 | ||
169 | /* | 169 | /* |
170 | * Classic PowerPC doesn't support per-counter | 170 | * Classic PowerPC doesn't support per-counter |
@@ -173,14 +173,14 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root) | |||
173 | * Book-E style performance monitors, we do | 173 | * Book-E style performance monitors, we do |
174 | * support them. | 174 | * support them. |
175 | */ | 175 | */ |
176 | oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel); | 176 | oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel); |
177 | oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user); | 177 | oprofilefs_create_ulong(dir, "user", &ctr[i].user); |
178 | 178 | ||
179 | oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask); | 179 | oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask); |
180 | } | 180 | } |
181 | 181 | ||
182 | oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel); | 182 | oprofilefs_create_ulong(root, "enable_kernel", &sys.enable_kernel); |
183 | oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user); | 183 | oprofilefs_create_ulong(root, "enable_user", &sys.enable_user); |
184 | 184 | ||
185 | /* Default to tracing both kernel and user */ | 185 | /* Default to tracing both kernel and user */ |
186 | sys.enable_kernel = 1; | 186 | sys.enable_kernel = 1; |
diff --git a/arch/powerpc/oprofile/op_model_fsl_emb.c b/arch/powerpc/oprofile/op_model_fsl_emb.c index ccc1daa33aed..2a82d3ed464d 100644 --- a/arch/powerpc/oprofile/op_model_fsl_emb.c +++ b/arch/powerpc/oprofile/op_model_fsl_emb.c | |||
@@ -46,6 +46,12 @@ static inline u32 get_pmlca(int ctr) | |||
46 | case 3: | 46 | case 3: |
47 | pmlca = mfpmr(PMRN_PMLCA3); | 47 | pmlca = mfpmr(PMRN_PMLCA3); |
48 | break; | 48 | break; |
49 | case 4: | ||
50 | pmlca = mfpmr(PMRN_PMLCA4); | ||
51 | break; | ||
52 | case 5: | ||
53 | pmlca = mfpmr(PMRN_PMLCA5); | ||
54 | break; | ||
49 | default: | 55 | default: |
50 | panic("Bad ctr number\n"); | 56 | panic("Bad ctr number\n"); |
51 | } | 57 | } |
@@ -68,6 +74,12 @@ static inline void set_pmlca(int ctr, u32 pmlca) | |||
68 | case 3: | 74 | case 3: |
69 | mtpmr(PMRN_PMLCA3, pmlca); | 75 | mtpmr(PMRN_PMLCA3, pmlca); |
70 | break; | 76 | break; |
77 | case 4: | ||
78 | mtpmr(PMRN_PMLCA4, pmlca); | ||
79 | break; | ||
80 | case 5: | ||
81 | mtpmr(PMRN_PMLCA5, pmlca); | ||
82 | break; | ||
71 | default: | 83 | default: |
72 | panic("Bad ctr number\n"); | 84 | panic("Bad ctr number\n"); |
73 | } | 85 | } |
@@ -84,6 +96,10 @@ static inline unsigned int ctr_read(unsigned int i) | |||
84 | return mfpmr(PMRN_PMC2); | 96 | return mfpmr(PMRN_PMC2); |
85 | case 3: | 97 | case 3: |
86 | return mfpmr(PMRN_PMC3); | 98 | return mfpmr(PMRN_PMC3); |
99 | case 4: | ||
100 | return mfpmr(PMRN_PMC4); | ||
101 | case 5: | ||
102 | return mfpmr(PMRN_PMC5); | ||
87 | default: | 103 | default: |
88 | return 0; | 104 | return 0; |
89 | } | 105 | } |
@@ -104,6 +120,12 @@ static inline void ctr_write(unsigned int i, unsigned int val) | |||
104 | case 3: | 120 | case 3: |
105 | mtpmr(PMRN_PMC3, val); | 121 | mtpmr(PMRN_PMC3, val); |
106 | break; | 122 | break; |
123 | case 4: | ||
124 | mtpmr(PMRN_PMC4, val); | ||
125 | break; | ||
126 | case 5: | ||
127 | mtpmr(PMRN_PMC5, val); | ||
128 | break; | ||
107 | default: | 129 | default: |
108 | break; | 130 | break; |
109 | } | 131 | } |
@@ -133,6 +155,14 @@ static void init_pmc_stop(int ctr) | |||
133 | mtpmr(PMRN_PMLCA3, pmlca); | 155 | mtpmr(PMRN_PMLCA3, pmlca); |
134 | mtpmr(PMRN_PMLCB3, pmlcb); | 156 | mtpmr(PMRN_PMLCB3, pmlcb); |
135 | break; | 157 | break; |
158 | case 4: | ||
159 | mtpmr(PMRN_PMLCA4, pmlca); | ||
160 | mtpmr(PMRN_PMLCB4, pmlcb); | ||
161 | break; | ||
162 | case 5: | ||
163 | mtpmr(PMRN_PMLCA5, pmlca); | ||
164 | mtpmr(PMRN_PMLCB5, pmlcb); | ||
165 | break; | ||
136 | default: | 166 | default: |
137 | panic("Bad ctr number!\n"); | 167 | panic("Bad ctr number!\n"); |
138 | } | 168 | } |