Skip to content

Commit c4ac078

Browse files
Pull up following revision(s) (requested by skrll in ticket #48):
sys/arch/riscv/riscv/trap.c: revision 1.31 sys/arch/riscv/riscv/cpu.c: revision 1.8 sys/arch/riscv/riscv/cpu.c: revision 1.9 whitespace Attach the fpu {loads,save,reenable} event counters.
1 parent e4290bb commit c4ac078

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

sys/arch/riscv/riscv/cpu.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cpu.c,v 1.7 2024/08/10 07:27:04 skrll Exp $ */
1+
/* $NetBSD: cpu.c,v 1.7.2.1 2025/10/09 09:25:52 martin Exp $ */
22

33
/*-
44
* Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
3232
#include "opt_multiprocessor.h"
3333

3434
#include <sys/cdefs.h>
35-
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.7 2024/08/10 07:27:04 skrll Exp $");
35+
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.7.2.1 2025/10/09 09:25:52 martin Exp $");
3636

3737
#include <sys/param.h>
3838

@@ -183,7 +183,7 @@ cpu_identify(device_t self, struct cpu_info *ci)
183183

184184
aprint_naive("\n");
185185
aprint_normal(": %s %s imp. %" PRIx32 "\n", cv_name, ca_name, mimpid);
186-
aprint_verbose_dev(ci->ci_dev,
186+
aprint_verbose_dev(ci->ci_dev,
187187
"vendor 0x%" PRIxREGISTER " arch. %" PRIxREGISTER " imp. %" PRIx32 "\n",
188188
mvendorid, marchid, mimpid);
189189
}
@@ -235,6 +235,15 @@ cpu_attach(device_t dv, cpuid_t hartid)
235235
ci->ci_dev = dv;
236236
device_set_private(dv, ci);
237237

238+
const char * const xname = device_xname(dv);
239+
240+
evcnt_attach_dynamic(&ci->ci_ev_fpu_loads, EVCNT_TYPE_MISC, NULL,
241+
xname, "fpu loads");
242+
evcnt_attach_dynamic(&ci->ci_ev_fpu_saves, EVCNT_TYPE_MISC, NULL,
243+
xname, "fpu saves");
244+
evcnt_attach_dynamic(&ci->ci_ev_fpu_reenables, EVCNT_TYPE_MISC, NULL,
245+
xname, "fpu reenables");
246+
238247
cpu_identify(dv, ci);
239248

240249
#ifdef MULTIPROCESSOR

sys/arch/riscv/riscv/trap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: trap.c,v 1.30 2024/11/25 22:04:14 skrll Exp $ */
1+
/* $NetBSD: trap.c,v 1.30.2.1 2025/10/09 09:25:52 martin Exp $ */
22

33
/*-
44
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
3434
#define __PMAP_PRIVATE
3535
#define __UFETCHSTORE_PRIVATE
3636

37-
__RCSID("$NetBSD: trap.c,v 1.30 2024/11/25 22:04:14 skrll Exp $");
37+
__RCSID("$NetBSD: trap.c,v 1.30.2.1 2025/10/09 09:25:52 martin Exp $");
3838

3939
#include <sys/param.h>
4040

@@ -301,7 +301,7 @@ dump_trapframe(const struct trapframe *tf, void (*pr)(const char *, ...))
301301

302302
static inline void
303303
trap_ksi_init(ksiginfo_t *ksi, int signo, int code, vaddr_t addr,
304-
register_t cause)
304+
register_t cause)
305305
{
306306
KSI_INIT_TRAP(ksi);
307307
ksi->ksi_signo = signo;

0 commit comments

Comments
 (0)