Lines Matching +full:down +full:- +full:counters

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 2007 Ralf Baechle <ralf@linux-mips.org>
7 * written by Ralf Baechle <ralf@linux-mips.org>
85 * Routines for using 40-bit SCD cycle counter
89 * zclk_timer_init(0) at least every 2^40 - 1 ZCLKs.
145 u64 next = (1ULL << 40) - tb_period; in arm_tb()
156 * Unfortunately, in Pass 2 we must clear all counters to knock down in arm_tb()
158 * requires ALL of the SCD perf counters. in arm_tb()
162 /* keep counters 0,2,3,4,5,6,7 as is */ in arm_tb()
167 M_SPC_CFG_CLEAR | /* clear all counters */ in arm_tb()
172 /* keep counters 0,2,3 as is */ in arm_tb()
174 M_SPC_CFG_CLEAR | /* clear all counters */ in arm_tb()
182 /* XXXKW may want to expose control to the data-collector */ in arm_tb()
203 for (i = 256 * 6; i > 0; i -= 6) { in sbprof_tb_intr()
206 p[i - 1] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); in sbprof_tb_intr()
208 p[i - 2] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); in sbprof_tb_intr()
210 p[i - 3] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); in sbprof_tb_intr()
212 p[i - 4] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); in sbprof_tb_intr()
214 p[i - 5] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); in sbprof_tb_intr()
216 p[i - 6] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); in sbprof_tb_intr()
226 /* knock down current interrupt and get another one later */ in sbprof_tb_intr()
249 * saturate 40 bits. No subsequent use of SCD performance counters
259 return -EBUSY; in sbprof_zbprof_start()
264 filp->f_pos = 0; in sbprof_zbprof_start()
269 return -EBUSY; in sbprof_zbprof_start()
271 /* Make sure there isn't a perf-cnt interrupt waiting */ in sbprof_zbprof_start()
273 /* Disable and clear counters, override SRC_1 */ in sbprof_zbprof_start()
281 * (they only feed into the trace-on-interrupt mechanism) in sbprof_zbprof_start()
285 return -EBUSY; in sbprof_zbprof_start()
319 /* Initialize Trace Event 0-7 */ in sbprof_zbprof_start()
330 /* Initialize Trace Sequence 0-7 */ in sbprof_zbprof_start()
345 /* Now indicate the PERF_CNT interrupt as a trace-relevant interrupt */ in sbprof_zbprof_start()
395 return -ENODEV; in sbprof_tb_open()
398 return -EBUSY; in sbprof_tb_open()
405 return -ENOMEM; in sbprof_tb_open()
424 return -ENODEV; in sbprof_tb_release()
450 return -EFAULT; in sbprof_tb_read()
457 sample_left = TB_SAMPLE_SIZE - sample_off; in sbprof_tb_read()
466 *offp = cur_off + cur_count - err; in sbprof_tb_read()
472 size -= cur_count; in sbprof_tb_read()
473 sample_left -= cur_count; in sbprof_tb_read()
520 err = -EINVAL; in sbprof_tb_ioctl()
551 return -EIO; in sbprof_tb_init()
568 pr_info(DEVNAME ": initialized - tb_period = %lld\n", in sbprof_tb_init()
591 MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");