8xx-pmu.c (de4fb176622d54a82ea3ceb7362392aaf5ff0b5a) 8xx-pmu.c (1fd02f6605b855b4af2883f29a2abc88bdf17857)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Performance event support - PPC 8xx
4 *
5 * Copyright 2016 Christophe Leroy, CS Systemes d'Information
6 */
7
8#include <linux/kernel.h>

--- 143 unchanged lines hidden (view full) ---

152}
153
154static void mpc8xx_pmu_del(struct perf_event *event, int flags)
155{
156 ppc_inst_t insn = ppc_inst(PPC_RAW_MFSPR(10, SPRN_SPRG_SCRATCH2));
157
158 mpc8xx_pmu_read(event);
159
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Performance event support - PPC 8xx
4 *
5 * Copyright 2016 Christophe Leroy, CS Systemes d'Information
6 */
7
8#include <linux/kernel.h>

--- 143 unchanged lines hidden (view full) ---

152}
153
154static void mpc8xx_pmu_del(struct perf_event *event, int flags)
155{
156 ppc_inst_t insn = ppc_inst(PPC_RAW_MFSPR(10, SPRN_SPRG_SCRATCH2));
157
158 mpc8xx_pmu_read(event);
159
160 /* If it was the last user, stop counting to avoid useles overhead */
160 /* If it was the last user, stop counting to avoid useless overhead */
161 switch (event_type(event)) {
162 case PERF_8xx_ID_CPU_CYCLES:
163 break;
164 case PERF_8xx_ID_HW_INSTRUCTIONS:
165 if (atomic_dec_return(&insn_ctr_ref) == 0)
166 mtspr(SPRN_ICTRL, 7);
167 break;
168 case PERF_8xx_ID_ITLB_LOAD_MISS:

--- 29 unchanged lines hidden ---
161 switch (event_type(event)) {
162 case PERF_8xx_ID_CPU_CYCLES:
163 break;
164 case PERF_8xx_ID_HW_INSTRUCTIONS:
165 if (atomic_dec_return(&insn_ctr_ref) == 0)
166 mtspr(SPRN_ICTRL, 7);
167 break;
168 case PERF_8xx_ID_ITLB_LOAD_MISS:

--- 29 unchanged lines hidden ---