Date: Wed, 8 Nov 2017 06:31:09 +0000 From: Ruslan Bukin <ruslan.bukin@cl.cam.ac.uk> To: freebsd-arch@freebsd.org Subject: Intel PT support Message-ID: <20171108063109.GA68007@bsdpad.com>
next in thread | raw e-mail | index | archive | help
Hi, Here is patch enables Intel Processor Tracing (PT) support. This is exciting new and first(?) hardware-level tracing support available for FreeBSD! PT is supported on Intel 5th generation Core (Broadwell), 6th generation Core (Skylake) CPUs, and later. I'm testing it currently on a late Kabylake. PT is evolving since its introduction in Broadwell CPU and I'm not sure if the features we use on Kabylake are available on Broeadwell (tracing to SG buffer for example). I will try to support all of these CPUs but if someone can help testing it would be good. Providing the output of pt_enumerate() on your CPU may be helpful as well. So with a minimal impact on system perfomance we can trace pretty much everything now. I provided simple 'pmctrace' application that enables tracing and decodes tracing buffers. It supports function tracing. Intel PT provides 25 types of packets, we currently decode few of them only. Example usage: 1. Trace all the conditional branches for uname(1) application. pmctrace -u pt,branches uname 2. Trace all the conditional branches in memset(3) function in libc. pmctrace -u pt,branches -i libc.so.7 -f memset sleep 1 3. Trace all the conditional branches for copyin() and show timestamp (TSC -- amount of clock cycles since boot). sudo pmctrace -s pt,branches,tsc -i kernel -f copyin So I have added new counters modes for HWPMC: MODE_ST - system tracing MODE_TT - virtual thread tracing We may look for ARM tracing technologies later as well. It is on review here: https://reviews.freebsd.org/D12875 It require libipt decoder from Intel as well: https://reviews.freebsd.org/D12717 Thanks. Ruslan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171108063109.GA68007>