Pull up following revision(s) (requested by jmcneill in ticket #301): usr.sbin/tprof/tprof.8: revision 1.15 sys/dev/tprof/tprof_x86_amd.c: revision 1.5 usr.sbin/tprof/arch/tprof_x86.c: revision 1.9 Match Family 15h - Add support for AMD Family 15h - Add AMD Family 15h to supported model listdiff -r1.4 -r1.4.2.1 src/sys/dev/tprof/tprof_x86_amd.c
(martin)
--- src/sys/dev/tprof/tprof_x86_amd.c 2019/06/14 11:50:35 1.4
+++ src/sys/dev/tprof/tprof_x86_amd.c 2019/10/12 14:34:45 1.4.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: tprof_x86_amd.c,v 1.4 2019/06/14 11:50:35 msaitoh Exp $ */ | 1 | /* $NetBSD: tprof_x86_amd.c,v 1.4.2.1 2019/10/12 14:34:45 martin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Maxime Villard. | 8 | * by Maxime Villard. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -46,27 +46,27 @@ | @@ -46,27 +46,27 @@ | |||
46 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 46 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
55 | * SUCH DAMAGE. | 55 | * SUCH DAMAGE. | |
56 | */ | 56 | */ | |
57 | 57 | |||
58 | #include <sys/cdefs.h> | 58 | #include <sys/cdefs.h> | |
59 | __KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.4 2019/06/14 11:50:35 msaitoh Exp $"); | 59 | __KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.4.2.1 2019/10/12 14:34:45 martin Exp $"); | |
60 | 60 | |||
61 | #include <sys/param.h> | 61 | #include <sys/param.h> | |
62 | #include <sys/systm.h> | 62 | #include <sys/systm.h> | |
63 | #include <sys/kernel.h> | 63 | #include <sys/kernel.h> | |
64 | #include <sys/module.h> | 64 | #include <sys/module.h> | |
65 | 65 | |||
66 | #include <sys/cpu.h> | 66 | #include <sys/cpu.h> | |
67 | #include <sys/xcall.h> | 67 | #include <sys/xcall.h> | |
68 | 68 | |||
69 | #include <dev/tprof/tprof.h> | 69 | #include <dev/tprof/tprof.h> | |
70 | 70 | |||
71 | #include <uvm/uvm.h> /* VM_MIN_KERNEL_ADDRESS */ | 71 | #include <uvm/uvm.h> /* VM_MIN_KERNEL_ADDRESS */ | |
72 | 72 | |||
@@ -195,26 +195,27 @@ tprof_amd_estimate_freq(void) | @@ -195,26 +195,27 @@ tprof_amd_estimate_freq(void) | |||
195 | } | 195 | } | |
196 | 196 | |||
197 | static uint32_t | 197 | static uint32_t | |
198 | tprof_amd_ident(void) | 198 | tprof_amd_ident(void) | |
199 | { | 199 | { | |
200 | struct cpu_info *ci = curcpu(); | 200 | struct cpu_info *ci = curcpu(); | |
201 | 201 | |||
202 | if (cpu_vendor != CPUVENDOR_AMD) { | 202 | if (cpu_vendor != CPUVENDOR_AMD) { | |
203 | return TPROF_IDENT_NONE; | 203 | return TPROF_IDENT_NONE; | |
204 | } | 204 | } | |
205 | 205 | |||
206 | switch (CPUID_TO_FAMILY(ci->ci_signature)) { | 206 | switch (CPUID_TO_FAMILY(ci->ci_signature)) { | |
207 | case 0x10: | 207 | case 0x10: | |
208 | case 0x15: | |||
208 | case 0x17: | 209 | case 0x17: | |
209 | return TPROF_IDENT_AMD_GENERIC; | 210 | return TPROF_IDENT_AMD_GENERIC; | |
210 | } | 211 | } | |
211 | 212 | |||
212 | return TPROF_IDENT_NONE; | 213 | return TPROF_IDENT_NONE; | |
213 | } | 214 | } | |
214 | 215 | |||
215 | static int | 216 | static int | |
216 | tprof_amd_start(const tprof_param_t *param) | 217 | tprof_amd_start(const tprof_param_t *param) | |
217 | { | 218 | { | |
218 | uint64_t xc; | 219 | uint64_t xc; | |
219 | 220 | |||
220 | if (tprof_amd_ident() == TPROF_IDENT_NONE) { | 221 | if (tprof_amd_ident() == TPROF_IDENT_NONE) { |
--- src/usr.sbin/tprof/tprof.8 2019/05/29 17:09:17 1.14
+++ src/usr.sbin/tprof/tprof.8 2019/10/12 14:34:45 1.14.2.1
@@ -1,40 +1,40 @@ | @@ -1,40 +1,40 @@ | |||
1 | .\" $NetBSD: tprof.8,v 1.14 2019/05/29 17:09:17 maxv Exp $ | 1 | .\" $NetBSD: tprof.8,v 1.14.2.1 2019/10/12 14:34:45 martin Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c)2011 YAMAMOTO Takashi, | 3 | .\" Copyright (c)2011 YAMAMOTO Takashi, | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | 6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | 7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | 8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | 9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | 10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | 12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | 13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" | 14 | .\" | |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | 15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
16 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 16 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
17 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 17 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
18 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 18 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
19 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 19 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 20 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
21 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 21 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
22 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 22 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | .\" SUCH DAMAGE. | 25 | .\" SUCH DAMAGE. | |
26 | .\" | 26 | .\" | |
27 | .Dd May 29, 2019 | 27 | .Dd October 11, 2019 | |
28 | .Dt TPROF 8 | 28 | .Dt TPROF 8 | |
29 | .Os | 29 | .Os | |
30 | .Sh NAME | 30 | .Sh NAME | |
31 | .Nm tprof | 31 | .Nm tprof | |
32 | .Nd record tprof profiling samples | 32 | .Nd record tprof profiling samples | |
33 | .Sh SYNOPSIS | 33 | .Sh SYNOPSIS | |
34 | .Nm | 34 | .Nm | |
35 | .Ar op | 35 | .Ar op | |
36 | .Op Ar arguments | 36 | .Op Ar arguments | |
37 | .Sh DESCRIPTION | 37 | .Sh DESCRIPTION | |
38 | The | 38 | The | |
39 | .Nm | 39 | .Nm | |
40 | tool can be used to monitor hardware events (PMCs) during the execution of | 40 | tool can be used to monitor hardware events (PMCs) during the execution of | |
@@ -120,26 +120,28 @@ samples into the file myfile.out. | @@ -120,26 +120,28 @@ samples into the file myfile.out. | |||
120 | .Dl # tprof monitor -e llc-misses:k -o myfile.out sleep 20 | 120 | .Dl # tprof monitor -e llc-misses:k -o myfile.out sleep 20 | |
121 | The following command displays the results of the sampling. | 121 | The following command displays the results of the sampling. | |
122 | .Dl # tprof analyze myfile.out | 122 | .Dl # tprof analyze myfile.out | |
123 | .Sh SUPPORT | 123 | .Sh SUPPORT | |
124 | The following CPU models are supported: | 124 | The following CPU models are supported: | |
125 | .Bl -hyphen -compact -offset indent | 125 | .Bl -hyphen -compact -offset indent | |
126 | .It | 126 | .It | |
127 | ARMv7 | 127 | ARMv7 | |
128 | .It | 128 | .It | |
129 | ARMv8 | 129 | ARMv8 | |
130 | .It | 130 | .It | |
131 | x86 AMD Family 10h | 131 | x86 AMD Family 10h | |
132 | .It | 132 | .It | |
133 | x86 AMD Family 15h | |||
134 | .It | |||
133 | x86 AMD Family 17h | 135 | x86 AMD Family 17h | |
134 | .It | 136 | .It | |
135 | x86 Intel Generic (all Intel CPUs) | 137 | x86 Intel Generic (all Intel CPUs) | |
136 | .It | 138 | .It | |
137 | x86 Intel Skylake/Kabylake | 139 | x86 Intel Skylake/Kabylake | |
138 | .It | 140 | .It | |
139 | x86 Intel Silvermont/Airmont | 141 | x86 Intel Silvermont/Airmont | |
140 | .It | 142 | .It | |
141 | x86 Intel Goldmont | 143 | x86 Intel Goldmont | |
142 | .It | 144 | .It | |
143 | x86 Intel Goldmont Plus | 145 | x86 Intel Goldmont Plus | |
144 | .El | 146 | .El | |
145 | .Sh DIAGNOSTICS | 147 | .Sh DIAGNOSTICS |
--- src/usr.sbin/tprof/arch/tprof_x86.c 2019/05/29 17:09:18 1.8
+++ src/usr.sbin/tprof/arch/tprof_x86.c 2019/10/12 14:34:45 1.8.4.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: tprof_x86.c,v 1.8 2019/05/29 17:09:18 maxv Exp $ */ | 1 | /* $NetBSD: tprof_x86.c,v 1.8.4.1 2019/10/12 14:34:45 martin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2018-2019 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018-2019 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Maxime Villard. | 8 | * by Maxime Villard. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -645,26 +645,140 @@ static struct name_to_event amd_f10h_nam | @@ -645,26 +645,140 @@ static struct name_to_event amd_f10h_nam | |||
645 | { "break-match2", 0xDE, 0x00, true }, | 645 | { "break-match2", 0xDE, 0x00, true }, | |
646 | { "break-match3", 0xDF, 0x00, true }, | 646 | { "break-match3", 0xDF, 0x00, true }, | |
647 | }; | 647 | }; | |
648 | 648 | |||
649 | static struct event_table amd_f10h = { | 649 | static struct event_table amd_f10h = { | |
650 | .tablename = "AMD Family 10h", | 650 | .tablename = "AMD Family 10h", | |
651 | .names = amd_f10h_names, | 651 | .names = amd_f10h_names, | |
652 | .nevents = sizeof(amd_f10h_names) / | 652 | .nevents = sizeof(amd_f10h_names) / | |
653 | sizeof(struct name_to_event), | 653 | sizeof(struct name_to_event), | |
654 | .next = NULL | 654 | .next = NULL | |
655 | }; | 655 | }; | |
656 | 656 | |||
657 | /* | 657 | /* | |
658 | * AMD Family 15h | |||
659 | */ | |||
660 | static struct name_to_event amd_f15h_names[] = { | |||
661 | { "FpPipeAssignment", 0x000, 0x77, true }, | |||
662 | { "FpSchedulerEmpty", 0x001, 0x00, true }, | |||
663 | { "FpRetSseAvxOps", 0x003, 0xff, true }, | |||
664 | { "FpNumMovElim", 0x004, 0x0f, true }, | |||
665 | { "FpRetiredSerOps", 0x005, 0x0f, true }, | |||
666 | { "LsSegRegLoads", 0x020, 0x7f, true }, | |||
667 | { "LsPipeRestartSelfMod", 0x021, 0x00, true }, | |||
668 | { "LsPipeRestartVarious", 0x022, 0x1f, true }, | |||
669 | { "LsLoadQueueStoreQFull", 0x023, 0x03, true }, | |||
670 | { "LsLockedOps", 0x024, 0x00, true }, | |||
671 | { "LsRetClflushInstr", 0x026, 0x00, true }, | |||
672 | { "LsRetCpuidInstr", 0x027, 0x00, true }, | |||
673 | { "LsDispatch", 0x029, 0x07, true }, | |||
674 | { "LsCanStoreToLoadFwOps", 0x02a, 0x03, true }, | |||
675 | { "LsSmisReceived", 0x02b, 0x00, true }, | |||
676 | { "LsExecClflushInstr", 0x030, 0x00, true }, | |||
677 | { "LsMisalignStore", 0x032, 0x00, true }, | |||
678 | { "LsFpLoadBufStall", 0x034, 0x00, true }, | |||
679 | { "LsStlf", 0x035, 0x00, true }, | |||
680 | { "DcCacheAccess", 0x040, 0x00, true }, | |||
681 | { "DcCacheMiss", 0x041, 0x00, true }, | |||
682 | { "DcCacheFillL2Sys", 0x042, 0x1f, true }, | |||
683 | { "DcCacheFillSys", 0x043, 0x00, true }, | |||
684 | { "DcUnifiedTlbHit", 0x045, 0x77, true }, | |||
685 | { "DcUnifiedTlbMiss", 0x046, 0x77, true }, | |||
686 | { "DcMisalignAccess", 0x047, 0x00, true }, | |||
687 | { "DcPrefetchInstrDisp", 0x04b, 0x07, true }, | |||
688 | { "DcIneffSwPrefetch", 0x052, 0x09, true }, | |||
689 | { "CuCmdVictimBuf", 0x060, 0x98, true }, | |||
690 | { "CuCmdMaskedOps", 0x061, 0x65, true }, | |||
691 | { "CuCmdReadBlkOps", 0x062, 0x77, true }, | |||
692 | { "CuCmdChgDirtyOps", 0x063, 0x08, true }, | |||
693 | { "CuDramSysReq", 0x064, 0x00, true }, | |||
694 | { "CuMemReqByType", 0x065, 0x83, true }, | |||
695 | { "CuDataCachePrefetch", 0x067, 0x03, true }, | |||
696 | { "CuMabReq", 0x068, 0xff, true }, | |||
697 | { "CuMabWaitCyc", 0x069, 0xff, true }, | |||
698 | { "CuSysRespCacheFill", 0x06c, 0x3f, true }, | |||
699 | { "CuOctwordsWritten", 0x06d, 0x01, true }, | |||
700 | { "CuCacheXInv", 0x075, 0x0f, true }, | |||
701 | { "CuCpuClkNotHalted", 0x076, 0x00, true }, | |||
702 | { "CuL2Req", 0x07d, 0x5f, true }, | |||
703 | { "CuL2Miss", 0x07e, 0x17, true }, | |||
704 | { "CuL2FillWb", 0x07f, 0x07, true }, | |||
705 | { "CuPageSplintering", 0x165, 0x07, true }, | |||
706 | { "CuL2PrefetchTrigEv", 0x16c, 0x03, true }, | |||
707 | { "CuXabAllocStall", 0x177, 0x03, true }, | |||
708 | { "CuFreeXabEntries", 0x17f, 0x01, true }, | |||
709 | { "IcCacheFetch", 0x080, 0x00, true }, | |||
710 | { "IcCacheMiss", 0x081, 0x00, true }, | |||
711 | { "IcCacheFillL2", 0x082, 0x00, true }, | |||
712 | { "IcCacheFillSys", 0x083, 0x00, true }, | |||
713 | { "IcL1TlbMissL2Hit", 0x084, 0x00, true }, | |||
714 | { "IcL1TlbMissL2Miss", 0x085, 0x07, true }, | |||
715 | { "IcPipeRestartInstrStrProbe", 0x086, 0x00, true }, | |||
716 | { "IcFetchStall", 0x087, 0x00, true }, | |||
717 | { "IcRetStackHits", 0x088, 0x00, true }, | |||
718 | { "IcRetStackOver", 0x089, 0x00, true }, | |||
719 | { "IcCacheVictims", 0x08b, 0x00, true }, | |||
720 | { "IcCacheLinesInv", 0x08c, 0x0f, true }, | |||
721 | { "IcTlbReload", 0x099, 0x00, true }, | |||
722 | { "IcTlbReloadAbort", 0x09a, 0x00, true }, | |||
723 | { "IcUopsDispatched", 0x186, 0x01, true }, | |||
724 | { "ExRetInstr", 0x0c0, 0x00, true }, | |||
725 | { "ExRetCops", 0x0c1, 0x00, true }, | |||
726 | { "ExRetBrn", 0x0c2, 0x00, true }, | |||
727 | { "ExRetBrnMisp", 0x0c3, 0x00, true }, | |||
728 | { "ExRetBrnTkn", 0x0c4, 0x00, true }, | |||
729 | { "ExRetBrnTknMisp", 0x0c5, 0x00, true }, | |||
730 | { "ExRetBrnFar", 0x0c6, 0x00, true }, | |||
731 | { "ExRetBrnResync", 0x0c7, 0x00, true }, | |||
732 | { "ExRetNearRet", 0x0c8, 0x00, true }, | |||
733 | { "ExRetNearRetMispred", 0x0c9, 0x00, true }, | |||
734 | { "ExRetBrnIndMisp", 0x0ca, 0x00, true }, | |||
735 | { "ExRetMmxFpInstr@X87", 0x0cb, 0x01, true }, | |||
736 | { "ExRetMmxFpInstr@Mmx", 0x0cb, 0x02, true }, | |||
737 | { "ExRetMmxFpInstr@Sse", 0x0cb, 0x04, true }, | |||
738 | { "ExIntMaskedCyc", 0x0cd, 0x00, true }, | |||
739 | { "ExIntMaskedCycIntPend", 0x0ce, 0x00, true }, | |||
740 | { "ExIntTaken", 0x0cf, 0x00, true }, | |||
741 | { "ExDecEmpty", 0x0d0, 0x00, true }, | |||
742 | { "ExDispStall", 0x0d1, 0x00, true }, | |||
743 | { "ExUseqStallSer", 0x0d2, 0x00, true }, | |||
744 | { "ExDispStallInstrRetQFull", 0x0d5, 0x00, true }, | |||
745 | { "ExDispStallIntSchedQFull", 0x0d6, 0x00, true }, | |||
746 | { "ExDispStallFpSchedQFull", 0x0d7, 0x00, true }, | |||
747 | { "ExDispStallLdqFull", 0x0d8, 0x00, true }, | |||
748 | { "ExUseqStallAllQuiet", 0x0d9, 0x00, true }, | |||
749 | { "ExFpuEx", 0x0db, 0x1f, true }, | |||
750 | { "ExBpDr0", 0x0dc, 0x8f, true }, | |||
751 | { "ExBpDr1", 0x0dd, 0x8f, true }, | |||
752 | { "ExBpDr2", 0x0de, 0x8f, true }, | |||
753 | { "ExBpDr3", 0x0df, 0x8f, true }, | |||
754 | { "ExRetx87FpOps", 0x1c0, 0x07, true }, | |||
755 | { "ExTaggedIbsOps", 0x1cf, 0x07, true }, | |||
756 | { "ExRetFusBrInstr", 0x1d0, 0x00, true }, | |||
757 | { "ExDispStallStqFull", 0x1d8, 0x00, true }, | |||
758 | { "ExCycNoDispIntPrfTok", 0x1dd, 0x00, true }, | |||
759 | { "ExCycNoDispfpPrfTok", 0x1de, 0x00, true }, | |||
760 | { "ExFpDispContention", 0x1df, 0x0f, true }, | |||
761 | }; | |||
762 | ||||
763 | static struct event_table amd_f15h = { | |||
764 | .tablename = "AMD Family 15h", | |||
765 | .names = amd_f15h_names, | |||
766 | .nevents = sizeof(amd_f15h_names) / | |||
767 | sizeof(struct name_to_event), | |||
768 | .next = NULL | |||
769 | }; | |||
770 | ||||
771 | /* | |||
658 | * AMD Family 17h | 772 | * AMD Family 17h | |
659 | */ | 773 | */ | |
660 | static struct name_to_event amd_f17h_names[] = { | 774 | static struct name_to_event amd_f17h_names[] = { | |
661 | { "FpRetx87FpOps", 0x02, __BITS(2,0), true }, | 775 | { "FpRetx87FpOps", 0x02, __BITS(2,0), true }, | |
662 | { "FpRetSseAvxOps", 0x03, __BITS(7,0), true }, | 776 | { "FpRetSseAvxOps", 0x03, __BITS(7,0), true }, | |
663 | { "FpRetiredSerOps", 0x05, __BITS(3,0), true }, | 777 | { "FpRetiredSerOps", 0x05, __BITS(3,0), true }, | |
664 | { "LsL1DTlbMiss", 0x45, __BITS(7,0), true }, | 778 | { "LsL1DTlbMiss", 0x45, __BITS(7,0), true }, | |
665 | { "LsTableWalker", 0x46, __BITS(3,0), true }, | 779 | { "LsTableWalker", 0x46, __BITS(3,0), true }, | |
666 | { "LsMisalAccesses", 0x47, 0x00, true }, | 780 | { "LsMisalAccesses", 0x47, 0x00, true }, | |
667 | { "LsInefSwPref", 0x52, __BITS(1,0), true }, | 781 | { "LsInefSwPref", 0x52, __BITS(1,0), true }, | |
668 | { "LsNotHaltedCyc", 0x76, 0x00, true }, | 782 | { "LsNotHaltedCyc", 0x76, 0x00, true }, | |
669 | { "IcFw32", 0x80, 0x00, true }, | 783 | { "IcFw32", 0x80, 0x00, true }, | |
670 | { "IcFw32Miss", 0x81, 0x00, true }, | 784 | { "IcFw32Miss", 0x81, 0x00, true }, | |
@@ -710,26 +824,28 @@ static struct event_table * | @@ -710,26 +824,28 @@ static struct event_table * | |||
710 | init_amd_generic(void) | 824 | init_amd_generic(void) | |
711 | { | 825 | { | |
712 | unsigned int eax, ebx, ecx, edx; | 826 | unsigned int eax, ebx, ecx, edx; | |
713 | 827 | |||
714 | eax = 0x01; | 828 | eax = 0x01; | |
715 | ebx = 0; | 829 | ebx = 0; | |
716 | ecx = 0; | 830 | ecx = 0; | |
717 | edx = 0; | 831 | edx = 0; | |
718 | x86_cpuid(&eax, &ebx, &ecx, &edx); | 832 | x86_cpuid(&eax, &ebx, &ecx, &edx); | |
719 | 833 | |||
720 | switch (CPUID_TO_FAMILY(eax)) { | 834 | switch (CPUID_TO_FAMILY(eax)) { | |
721 | case 0x10: | 835 | case 0x10: | |
722 | return &amd_f10h; | 836 | return &amd_f10h; | |
837 | case 0x15: | |||
838 | return &amd_f15h; | |||
723 | case 0x17: | 839 | case 0x17: | |
724 | return &amd_f17h; | 840 | return &amd_f17h; | |
725 | } | 841 | } | |
726 | 842 | |||
727 | return NULL; | 843 | return NULL; | |
728 | } | 844 | } | |
729 | 845 | |||
730 | /* -------------------------------------------------------------------------- */ | 846 | /* -------------------------------------------------------------------------- */ | |
731 | 847 | |||
732 | int | 848 | int | |
733 | tprof_event_init(uint32_t ident) | 849 | tprof_event_init(uint32_t ident) | |
734 | { | 850 | { | |
735 | switch (ident) { | 851 | switch (ident) { |