Commit Graph

16 Commits

Author SHA1 Message Date
jmcneill
7620cd8840 Add tprof backend for ARMv8 performance monitors. 2018-07-15 16:05:24 +00:00
maxv
a087cb3c40 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).
2018-07-13 07:56:29 +00:00
christos
e7ae23fd9e include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
yamt
83fb606c68 for each samples, record and report cpuid and lwpid. 2011-04-14 16:23:59 +00:00
yamt
04a6913f3d tprof_start: don't forget to restore refcount when failed to start backend. 2011-02-25 22:35:38 +00:00
yamt
89e330a773 tprof: record pid and userland events. 2011-02-05 14:04:40 +00:00
pgoyette
aa30923a4e Keep condvar wmesg within 8-char limit 2010-08-11 11:32:58 +00:00
yamt
004373b0b4 comment 2009-11-18 12:24:05 +00:00
yamt
34ccaa3db1 tprof_stop1: add an assertion. 2009-03-13 11:06:26 +00:00
yamt
0bbefb72ab fix breakage where db_regs_t != trapframe.
the problem pointed out by Martin Husemann on tech-kern@.
2009-03-11 13:48:47 +00:00
yamt
e1b625b4bc - adapt to MODULAR.
- some preparations to have more backends.
- add some comments.
2009-03-10 14:45:02 +00:00
yamt
70a4009abb comment 2009-01-20 15:13:54 +00:00
yamt
4a30ae1037 tprof_start: fix workqueue's IPL. 2008-05-07 08:48:11 +00:00
yamt
48a1e4c2c1 a simple performance monitor based profiler, inspired from linux oprofile. 2008-01-01 21:28:37 +00:00