xref: /freebsd-src/usr.sbin/pmcstudy/pmcstudy.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
152467047SWarner Losh.\"
252467047SWarner Losh.\" Copyright (c) 2015 Netflix, Inc.
34d9bf203SRandall Stewart.\"
44d9bf203SRandall Stewart.\" Redistribution and use in source and binary forms, with or without
54d9bf203SRandall Stewart.\" modification, are permitted provided that the following conditions
64d9bf203SRandall Stewart.\" are met:
74d9bf203SRandall Stewart.\" 1. Redistributions of source code must retain the above copyright
84d9bf203SRandall Stewart.\"    notice, this list of conditions and the following disclaimer.
94d9bf203SRandall Stewart.\" 2. Redistributions in binary form must reproduce the above copyright
104d9bf203SRandall Stewart.\"    notice, this list of conditions and the following disclaimer in the
114d9bf203SRandall Stewart.\"    documentation and/or other materials provided with the distribution.
124d9bf203SRandall Stewart.\"
134d9bf203SRandall Stewart.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
144d9bf203SRandall Stewart.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
154d9bf203SRandall Stewart.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
164d9bf203SRandall Stewart.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
174d9bf203SRandall Stewart.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
184d9bf203SRandall Stewart.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
194d9bf203SRandall Stewart.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
204d9bf203SRandall Stewart.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
214d9bf203SRandall Stewart.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
224d9bf203SRandall Stewart.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
234d9bf203SRandall Stewart.\" SUCH DAMAGE.
244d9bf203SRandall Stewart.\"
25*6d6d6c36SGordon Bergling.Dd March 26, 2015
26907b0aadSRandall Stewart.Dt PMCSTUDY 8
274d9bf203SRandall Stewart.Os
284d9bf203SRandall Stewart.Sh NAME
294d9bf203SRandall Stewart.Nm pmcstudy
30a9a393b3SEdward Tomasz Napierala.Nd Perform various studies on a system's overall PMCs
314d9bf203SRandall Stewart.Sh SYNOPSIS
324d9bf203SRandall Stewart.Nm
33eef0660aSRandall Stewart.Oo Fl i Ar inputfile | Fl A |  Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc
344d9bf203SRandall Stewart.Nm
354d9bf203SRandall Stewart.Fl i Ar inputfile
364d9bf203SRandall Stewart.Nm
374d9bf203SRandall Stewart.Fl v
384d9bf203SRandall Stewart.Nm
394d9bf203SRandall Stewart.Fl m Ar max
404d9bf203SRandall Stewart.Nm
414d9bf203SRandall Stewart.Fl e Ar exp-name
424d9bf203SRandall Stewart.Nm
434d9bf203SRandall Stewart.Fl E Ar your-expr
444d9bf203SRandall Stewart.Nm
454d9bf203SRandall Stewart.Fl h
464d9bf203SRandall Stewart.Nm
474d9bf203SRandall Stewart.Fl H
484d9bf203SRandall Stewart.Nm
494d9bf203SRandall Stewart.Fl T
504d9bf203SRandall Stewart.Sh DESCRIPTION
514d9bf203SRandall StewartThe
524d9bf203SRandall Stewart.Nm
534d9bf203SRandall Stewartprogram is designed to run various tests against your systems
544d9b9e1cSChristian Bruefferperformance.
554d9b9e1cSChristian BruefferThere are roughly 20-22 canned tests that setup specific
564d9b9e1cSChristian BruefferPMCs and then run various formulas on the output information.
574d9bf203SRandall StewartThese formulas can be found in Intel documentation "Using Intel Vtune
584d9b9e1cSChristian Bruefferamplifier xe on NNN Generation Intel Core Processors".
594d9b9e1cSChristian BruefferThe NNN is either
60385e27bfSRandall Stewart2nd, 3rd, 4th or 5th generation i.e., Sandy Bridge, Ivy Bridge, Haswell and Broadwell.
61385e27bfSRandall StewartCurrently the program only works on these four Intel processor types.
624d9bf203SRandall Stewart.Sh OPTIONS
634d9bf203SRandall StewartThe following options are available:
644d9bf203SRandall Stewart.Bl -tag -width indent
654d9bf203SRandall Stewart.It Fl i Ar filename
664d9bf203SRandall StewartIf this option is supplied, instead of running a
674d9bf203SRandall Stewart.Xr pmcstat 8
684d9b9e1cSChristian Brueffercommand to collect the current running information the filename will be read
694d9bf203SRandall Stewartin as input instead.
704d9bf203SRandall Stewart.It Fl H
714d9bf203SRandall StewartThis option will display the complete list of canned formulas that can be run including
724d9b9e1cSChristian Brueffertheir names which can be input to the
734d9bf203SRandall Stewart.Fl e
744d9bf203SRandall Stewartoption.
754d9bf203SRandall Stewart.It Fl e Ar name
764d9bf203SRandall StewartExecute the canned test
774d9bf203SRandall Stewart.Ar name
784d9bf203SRandall Stewarton the running kernel.
794d9bf203SRandall Stewart.It Fl h
804d9bf203SRandall StewartIf you add this option to the
814d9bf203SRandall Stewart.Fl e
824d9bf203SRandall Stewartoption the test will not execute but instead give you a small description
834d9bf203SRandall Stewartof the test that would run.
844d9bf203SRandall Stewart.It Fl T
854d9bf203SRandall StewartThis option will execute a test of every PMC to validate that they are working
864d9b9e1cSChristian Bruefferon your system.
874d9b9e1cSChristian BruefferIf a PMC does not show up in this test chances
884d9b9e1cSChristian Bruefferare the kernel
894d9b9e1cSChristian Brueffer.Xr hwpmc 4
904d9b9e1cSChristian Bruefferdriver needs updating with new PMC information.
914d9bf203SRandall Stewart.It Fl m Ar num
924d9bf203SRandall StewartThis option can restrict the number of one second samples that will
934d9bf203SRandall Stewartbe collected by your system when running a test (it bounds the
944d9b9e1cSChristian Brueffertime the test will run).
954d9b9e1cSChristian BruefferWithout this option the test will run
964d9bf203SRandall Stewartfor 1024 seconds or until the user types ctrl-c.
974d9bf203SRandall Stewart.It Fl v
984d9bf203SRandall StewartThe verbose option adds debugging output to the command.
994d9bf203SRandall Stewart.It Fl E Ar expression
1004d9b9e1cSChristian BruefferThis option can be used by those that have their own ideas
1014d9b9e1cSChristian Bruefferon what formulas they want to run.
1024d9b9e1cSChristian BruefferThe expression given to the
1034d9bf203SRandall Stewart.Fl E
1044d9b9e1cSChristian Bruefferoption is a "formula".
1054d9b9e1cSChristian BruefferThe formula can declare directly the PMCs by name
1064d9b9e1cSChristian Bruefferor you can use an abbreviation %NNN.
1074d9b9e1cSChristian BruefferTo find out the abbreviations
1084d9bf203SRandall Stewarton your system you may run the
1094d9bf203SRandall Stewart.Fl L
1104d9bf203SRandall Stewartoption.
1114d9bf203SRandall StewartAn example of a formula of your own might be
1124d9bf203SRandall Stewart.Fl E
1134d9bf203SRandall Stewart"FP_ASSIST.ANY / INST_RETIRED.ANY_P" or using the abbreviations on a
1144d9bf203SRandall StewartHaswell machine you would type
1154d9bf203SRandall Stewart.Fl E
1164d9b9e1cSChristian Brueffer" %176 / %150".
1174d9b9e1cSChristian BruefferYou must have spaces between each entry and
1184d9b9e1cSChristian Bruefferyou may use parentheses to prioritize the operators.
1194d9b9e1cSChristian BruefferAdd (+), Subtract (-),
1204d9b9e1cSChristian BruefferDivide (/) and Multiplication (*) are supported.
1214d9b9e1cSChristian BruefferYou may also introduce
1224d9b9e1cSChristian Bruefferconstant numbers.
123989531dcSPedro F. GiffuniFor example you can do a standard efficiency
1244d9bf203SRandall Stewarttest like
1254d9b9e1cSChristian Brueffer.Fl E
1264d9bf203SRandall Stewart"UOPS_RETIRED.RETIRE_SLOTS / (4 * CPU_CLK_UNHALTED.THREAD_P)".
1274d9bf203SRandall Stewart.It Fl L
1284d9b9e1cSChristian BruefferThis option will list all known PMCs and their abbreviation (%NNN).
129eef0660aSRandall Stewart.It Fl A
130eef0660aSRandall StewartRun all canned tests.
1314d9b9e1cSChristian Brueffer.El
1324d9bf203SRandall Stewart.Sh SEE ALSO
1334d9bf203SRandall Stewart.Xr pmc 3 ,
1344d9bf203SRandall Stewart.Xr pmclog 3 ,
1354d9bf203SRandall Stewart.Xr hwpmc 4 ,
1364d9b9e1cSChristian Brueffer.Xr pmcstat 8
1374d9bf203SRandall Stewart.Sh HISTORY
1384d9bf203SRandall StewartThe
1394d9bf203SRandall Stewart.Nm
1404d9bf203SRandall Stewartutility first appeared in
1414d9bf203SRandall Stewart.Fx 11.0 .
1424d9bf203SRandall Stewart.Sh AUTHORS
1434d9bf203SRandall Stewart.An Randall Stewart Aq Mt rrs@FreeBSD.org
144