Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/tprof Add a comment and simplify the code ever so sl...



details:   https://anonhg.NetBSD.org/src/rev/c770964efbd2
branches:  trunk
changeset: 1026610:c770964efbd2
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Dec 03 08:02:52 2021 +0000

description:
Add a comment and simplify the code ever so slightly.

diffstat:

 sys/dev/tprof/tprof_armv8.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r dcb8d423b313 -r c770964efbd2 sys/dev/tprof/tprof_armv8.c
--- a/sys/dev/tprof/tprof_armv8.c       Fri Dec 03 08:00:13 2021 +0000
+++ b/sys/dev/tprof/tprof_armv8.c       Fri Dec 03 08:02:52 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_armv8.c,v 1.11 2021/12/03 08:00:13 skrll Exp $ */
+/* $NetBSD: tprof_armv8.c,v 1.12 2021/12/03 08:02:52 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.11 2021/12/03 08:00:13 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.12 2021/12/03 08:02:52 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -57,6 +57,7 @@
        eid[0] = reg_pmceid0_el0_read();
        eid[1] = reg_pmceid1_el0_read();
 
+       /* The low 32bits of PMCEID[01]_EL0 contain the commmon events 0 to n */
        const u_int idx = event / 32;
        const u_int bit = event % 32;
 
@@ -222,9 +223,7 @@
 int
 armv8_pmu_init(void)
 {
-       uint64_t xc;
-
-       xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
+       uint64_t xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
        xc_wait(xc);
 
        return tprof_backend_register("tprof_armv8", &tprof_armv8_pmu_ops,



Home | Main Index | Thread Index | Old Index