git: cd165c8bf054 - main - x86/tsc.c: Add TSLOG to test_tsc

Colin Percival cperciva at FreeBSD.org
Fri Sep 10 00:02:27 UTC 2021


The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=cd165c8bf05452d38ce552ae819d87378fecf52f

commit cd165c8bf05452d38ce552ae819d87378fecf52f
Author:     Colin Percival <cperciva at FreeBSD.org>
AuthorDate: 2021-09-10 00:01:00 +0000
Commit:     Colin Percival <cperciva at FreeBSD.org>
CommitDate: 2021-09-10 00:02:15 +0000

    x86/tsc.c: Add TSLOG to test_tsc
    
    On my benchmark system this takes ~ 14 ms; enough to be worth
    recording in the boot time profile.
---
 sys/x86/x86/tsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index 0ebcea895cd3..15e6037c68ee 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -511,6 +511,7 @@ test_tsc(int adj_max_count)
 	if (vm_guest == VM_GUEST_VBOX)
 		return (0);
 
+	TSENTER();
 	size = (mp_maxid + 1) * 3;
 	data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK);
 	adj = 0;
@@ -531,6 +532,7 @@ retry:
 		printf("SMP: %sed TSC synchronization test%s\n",
 		    smp_tsc ? "pass" : "fail", 
 		    adj > 0 ? " after adjustment" : "");
+	TSEXIT();
 	if (smp_tsc && tsc_is_invariant) {
 		switch (cpu_vendor_id) {
 		case CPU_VENDOR_AMD:


More information about the dev-commits-src-main mailing list