Home | History | Annotate | Download | only in tprof
History log of /src/sys/dev/tprof/tprof_ioctl.h
RevisionDateAuthorComments
 1.5  01-Dec-2022  ryo Improve tprof(4)

- Multiple events can now be handled simultaneously.
- Counters should be configured with TPROF_IOC_CONFIGURE_EVENT in advance,
instead of being configured at TPROF_IOC_START.
- The configured counters can be started and stopped repeatedly by
PROF_IOC_START/TPROF_IOC_STOP.
- The value of the performance counter can be obtained at any timing as a 64bit
value with TPROF_IOC_GETCOUNTS.
- Backend common parts are handled in tprof.c as much as possible, and functions
on the tprof_backend side have been reimplemented to be more primitive.
- The reset value of counter overflows for profiling can now be adjusted.
It is calculated by default from the CPU clock (speed of cycle counter) and
TPROF_HZ, but for some events the value may be too large to be sufficient for
profiling. The event counter can be specified as a ratio to the default or as
an absolute value when configuring the event counter.
- Due to overall changes, API and ABI have been changed. TPROF_VERSION and
TPROF_BACKEND_VERSION were updated.
 1.4  13-Jul-2018  maxv Revamp tprof.

Rewrite the Intel backend to use the generic PMC interface, which is
available on all Intel CPUs. Synchronize the AMD backend with the new
interface.

The kernel identifies the PMC interface, and gives its id to userland.
Userland then queries the events itself (via cpuid etc). These events
depend on the PMC interface.

The tprof utility is rewritten to allow the user to choose which event
to count (which was not possible until now, the event was hardcoded in
the backend). The command line format is based on usr.bin/pmc, eg:

tprof -e llc-misses:k -o output sleep 20

The man page is updated too, but the arguments will likely change soon
anyway so it doesn't matter a lot.

The tprof utility has three tables:

Intel Architectural Version 1
Intel Skylake/Kabylake
AMD Family 10h

A CPU can support a combination of tables. For example Kabylake has
Intel-Architectural-Version-1 and its own Intel-Kabylake table.

For now the Intel Skylake/Kabylake table contains only one event, just
to demonstrate that the combination of tables works. Tested on an
Intel Core i5 Kabylake.

The code for AMD Family 10h is taken from the code I had written for
usr.bin/pmc. I haven't tested it yet, but it's the same as pmc(1), so
I guess it works as-is.

The whole thing is written in such a way that (I think) it is not
complicated to add more CPU models, and more architectures (other than
x86).
 1.3  14-Apr-2011  yamt branches: 1.3.54; 1.3.56;
for each samples, record and report cpuid and lwpid.
 1.2  05-Feb-2011  yamt tprof: record pid and userland events.
 1.1  01-Jan-2008  yamt branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.40; 1.1.46; 1.1.48;
a simple performance monitor based profiler, inspired from linux oprofile.
 1.1.48.1  08-Feb-2011  bouyer Sync with HEAD
 1.1.46.1  06-Jun-2011  jruoho Sync with HEAD.
 1.1.40.2  21-Apr-2011  rmind sync with head
 1.1.40.1  05-Mar-2011  rmind sync with head
 1.1.8.2  18-Feb-2008  mjf Sync with HEAD.
 1.1.8.1  01-Jan-2008  mjf file tprof_ioctl.h was added on branch mjf-devfs on 2008-02-18 21:06:25 +0000
 1.1.6.2  21-Jan-2008  yamt sync with head
 1.1.6.1  01-Jan-2008  yamt file tprof_ioctl.h was added on branch yamt-lazymbuf on 2008-01-21 09:44:40 +0000
 1.1.4.2  09-Jan-2008  matt sync with HEAD
 1.1.4.1  01-Jan-2008  matt file tprof_ioctl.h was added on branch matt-armv6 on 2008-01-09 01:54:37 +0000
 1.1.2.2  02-Jan-2008  bouyer Sync with HEAD
 1.1.2.1  01-Jan-2008  bouyer file tprof_ioctl.h was added on branch bouyer-xeni386 on 2008-01-02 21:55:18 +0000
 1.3.56.1  10-Jun-2019  christos Sync with HEAD
 1.3.54.1  28-Jul-2018  pgoyette Sync with HEAD

RSS XML Feed