Date: Wed, 21 Apr 2021 20:35:11 GMT From: Mitchell Horne <mhorne@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: edcf9e59c356 - main - pmcstat: set initial counter value to zero Message-ID: <202104212035.13LKZBwf029319@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=edcf9e59c356525632dd2546d72916aeca609a2b commit edcf9e59c356525632dd2546d72916aeca609a2b Author: Mitchell Horne <mhorne@FreeBSD.org> AuthorDate: 2021-04-21 20:28:12 +0000 Commit: Mitchell Horne <mhorne@FreeBSD.org> CommitDate: 2021-04-21 20:35:03 +0000 pmcstat: set initial counter value to zero For an infrequent event, pmcstat may report (u_long)-1 for CPUs where the counter was never incremented. Just set this to zero, instead. ev->ev_count is passed as the 'count' argument to pmc_allocate(3), but this wasn't always the case. Reviewed by: gnn MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29887 --- usr.sbin/pmcstat/pmcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 688a98843652..b7f6c5e0f63e 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -675,7 +675,7 @@ main(int argc, char **argv) if (option == 'S' || option == 'P') ev->ev_count = current_sampling_count ? current_sampling_count : pmc_pmu_sample_rate_get(ev->ev_spec); else - ev->ev_count = -1; + ev->ev_count = 0; if (option == 'S' || option == 's') ev->ev_cpu = CPU_FFS(&cpumask) - 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104212035.13LKZBwf029319>