FreeBSD src
Go to file
John Baldwin a1febbf667 Fix two bugs that could result in PMC sampling effectively stopping.
In both cases, the the effect of the bug was that a very small positive
number was written to the counter. This means that a large number of
events needed to occur before the next sampling interrupt would trigger.
Even with very frequently occurring events like clock cycles wrapping all
the way around could take a long time. Both bugs occurred when updating
the saved reload count for an outgoing thread on a context switch.

First, the counter-independent code compares the current reload count
against the count set when the thread switched in and generates a delta
to apply to the saved count. If this delta causes the reload counter
to go negative, it would add a full reload interval to wrap it around to
a positive value. The fix is to add the full reload interval if the
resulting counter is zero.

Second, occasionally the raw counter value read during a context switch
has actually wrapped, but an interrupt has not yet triggered. In this
case the existing logic would return a very large reload count (e.g.
2^48 - 2 if the counter had overflowed by a count of 2). This was seen
both for fixed-function and programmable counters on an E5-2643.
Workaround this case by returning a reload count of zero.

PR:		198149
Differential Revision:	https://reviews.freebsd.org/D2557
Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	Norse Corp, Inc.
2015-05-19 19:15:19 +00:00
bin date(1): Make -r behave like GNU's version when the option can not be 2015-05-07 20:54:38 +00:00
cddl Fix a typo that snuck in with r283024, and remove the EXFAIL annotation from 2015-05-17 23:09:58 +00:00
contrib MFV of 283077,tzdata2015d 2015-05-18 21:05:11 +00:00
crypto Use proper CHAN_TCP_PACKET_DEFAULT for agent forwarding when HPN disabled. 2015-04-02 18:43:25 +00:00
etc Move all test integration pieces for etc/ from etc/ to tests/ 2015-05-18 11:02:43 +00:00
games fortune/tools/do_uniq.py 2015-04-02 22:42:23 +00:00
gnu Garbage collect GNU soelim Makefiles which are not in used anymore 2015-05-18 16:51:05 +00:00
include Make use of GCC alloc_align attribute 2015-05-15 20:43:37 +00:00
kerberos5 Add a ${CP} alias for copying files in the build. 2015-01-16 21:39:08 +00:00
lib Use fixed enum values for PMC_CLASSES(). 2015-05-19 18:58:18 +00:00
libexec Remove historical GNUC test 2015-05-06 15:29:11 +00:00
release Avoid polluting the filesystem when not necessary. 2015-05-12 01:27:58 +00:00
rescue Significant upgrades to sa(4) and mt(1). 2015-02-23 21:59:30 +00:00
sbin Bring back support for checking tables via "ipfw -n". 2015-05-19 18:29:13 +00:00
secure Add the openssl header for arm64. As it is based on MACHINE_CPUARCH it 2015-03-24 14:16:14 +00:00
share Fixup to the kern_psignal manpage 2015-05-19 15:43:20 +00:00
sys Fix two bugs that could result in PMC sampling effectively stopping. 2015-05-19 19:15:19 +00:00
tests Move all test integration pieces for etc/ from etc/ to tests/ 2015-05-18 11:02:43 +00:00
tools Add mv / expr ; these are used by the updated freebsd-wifi-build environment. 2015-05-19 03:02:52 +00:00
usr.bin Synchronize with OpenBSD 2015-05-18 22:40:12 +00:00
usr.sbin Merge ACPICA 20150515. 2015-05-18 23:46:11 +00:00
.arcconfig Phabricator: enable "history.immutable": 2015-04-30 00:27:53 +00:00
.arclint phabricator related changes: 2015-04-20 20:33:22 +00:00
COPYRIGHT Bump copyright year. 2014-12-31 10:00:43 +00:00
LOCKS Explicitly require Security Officer's approval for kernel PRNG bits. 2013-09-17 14:19:05 +00:00
MAINTAINERS Remove cokane@ from MAINTAINERS for 3dfx(4)/tdfx(4) because their email 2014-11-25 05:25:12 +00:00
Makefile Don't add arm64 to universe builds if the user provided a TARGETS list 2015-04-28 17:13:05 +00:00
Makefile.inc1 Update crunch bootstrapping test for recent fixes 2015-05-19 14:05:15 +00:00
ObsoleteFiles.inc libyaml.so.1 are actually libraries and should only be removed during 2015-05-14 17:49:01 +00:00
README README: changes and fixups 2015-04-19 07:16:44 +00:00
UPDATING Add a note about the replacement of GNU groff's soelim(1) 2015-05-01 21:26:40 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html