| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Free allocated per-CPU structures in the pcpu_fini and finalize methods.
While here, add debug trace entries to these methods.
Reviewed by: jkoshy, andrew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41269
(cherry picked from commit 9c0a2d522f3a18fc795a7dd6266d2be2aff4b084)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Free allocated per-CPU structures in the pcpu_fini and finalize methods.
While here, add debug trace entries to these methods.
Reviewed by: jkoshy, andrew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41268
(cherry picked from commit 8bdceaecabd91ce5ed23646d91cef878681e19d6)
|
| | |
|
| |
|
|
| |
(cherry picked from commit 3c872a70b883e4e2b38135bd6bd114ac9d2ea579)
|
| |
|
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Similar commit in current:
(cherry picked from commit 685dc743dc3b)
|
| |
|
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
Similar commit in current:
(cherry picked from commit 95ee2897e98f)
|
| |
|
|
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
|
| |
|
|
|
|
|
|
|
|
| |
It points to non-existent documentation. The wiki page still contains a
useful overview, so keep this link.
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit f7a217060608b5fa9e7c59724a617b7241a3ee3b)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Most platforms (non-x86) don't require these methods and implement stub
versions. If we initialize the pmc_mdep structure to always point to the
generic versions, then we can purge the duplicate stubs.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39913
(cherry picked from commit fa88954fd8f16ef60084a73d446a23e791ed22e5)
|
| |
|
|
|
|
|
|
|
|
|
| |
These are unused on all platforms.
Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39912
(cherry picked from commit 772b2dc3abc5072743e7598d35e0a8ad621e7b0d)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many cases this avoids an extra lookup, since the callers always have
pm at hand. We can also eliminate several assertions, mostly for pm !=
NULL. The class methods are an internal interface, and the callers
already handle such a scenario. No functional change intended.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39915
(cherry picked from commit 39f92a76a99a2ceb747250da4f2d627b9c317f8c)
|
| |
|
|
|
|
|
|
|
|
|
| |
These are preferred over casts to void. No functional change.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39914
(cherry picked from commit a35453b9c7644f11df83d0c7e73da488f521e56e)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This existing helper function is preferable to the hand-rolled
calculation of the kstack bounds.
Make some small style improvements while here. Notably, rename every
instance of "r", the return address, to "ra". Tidy the includes in the
affected files.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39909
(cherry picked from commit aba91805aa92a47b2f3f01741a55ff9f07c42d04)
|
| |
|
|
| |
(cherry picked from commit cb6abe87cf1c178ea1b9cd8a385e53459aef96e8)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Use the unwind_frame() function, which properly validates the frame
pointer and uses ADDR_MAKE_CANONICAL() for the pc, required when PAC is
enabled.
Reviewed by: andrew, markj, jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39934
(cherry picked from commit 5387495773e9e92441b795c0eb8c2a3ecc25708a)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide the log type names in their entirely, rather than relying on the
macro to prepend the prefix. This improves their searchability; for
example, if I see PMCLOG_TYPE_PMCALLOCATE in libpmc I will now be able
to find where that is emitted in the kernel with a simple grep.
Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39911
(cherry picked from commit 3a7c9fc01bdae13edbd5724745b748e6a61065eb)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It is just wrapper around strlcpy(), but results in more complicated
code. Clean this up to use strlcpy() or snprintf() as appropriate.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39910
(cherry picked from commit 31610e34b7e39d573d927ea98346c88f23cabdab)
|
| |
|
|
|
|
|
|
|
|
|
| |
No functional change.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39904
(cherry picked from commit ca43b2ae3ef2ed86b0df36296464d7830b61b944)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Improve the legibility of the list. Bump overall indentation, fix some
whitespace, and sort the IAF block.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39903
(cherry picked from commit b6c9d2a3f892169d4a6acc92869f9d9db52876ea)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This comment is no longer in sync with the contents of __PMC_EVENTS().
Update to reflect the removal of various Intel event definitions from
this list; these event definitions now come from Linux and live in
lib/libpmc/pmu-events/.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39902
(cherry picked from commit 6bdf067890ed1d1515ad0dbd105848bb11711210)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although this block has remained in __PMC_EVENTS(), there is no handling
of UCP in libpmc/libpmc.c, so it is not possible to select one of these
events. It should therefore be impossible to trigger the code removed
from ucp_start_pmc(). Note that the GQ_SNOOP_MSF MSR exists only for
Nehalem and Westmere architectures, and the related events do not exist
for later generations.
The Uncore support in hwpmc has severely atrophied in general. We have
uncore event definitions in pmu-events, but the kernel support was
written against Intel Performance Measurement Architecture version 2,
and is disabled for processor generations later than Westmere. Nehalem
and Westmere lack uncore event definitions in pmu-events. I'd be
surprised if Uncore support is usable on any machine in its current
state.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39901
(cherry picked from commit d71a439020721a9abea5c353b9e03b5dc29d253e)
|
| |
|
|
|
|
|
|
|
|
|
| |
These are maintained elsewhere. No functional change.
Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39900
(cherry picked from commit 1be8ef26794dcf93e2f4851474808dc3b34dbcbd)
|
| |
|
|
|
|
| |
MFC after: 1 week
(cherry picked from commit 56da525b535f8537205bccd1f4b25b3ce354ca62)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Support the "usr" and "os" qualifiers on arm64 events to restrict
event counting to either usermode or the kernel, respectively. If
neither qualifier is given, events are counted in both.
Reviewed by: emaste
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34527
(cherry picked from commit 6bb7ba4aa180f667c1b558de1fc364f41bab57ce)
|
| |
|
|
|
|
| |
Sponsored by: Netflix
(cherry picked from commit 6ca6b8ea523daa6f17e010711458800f30d2e1ee)
|
| |
|
|
|
|
|
|
|
| |
At least KVM in Proxmox seems not happy about it. Just to be safe
block it for all VMs, since it should just improve profile accuracy.
MFC after: 1 week
(cherry picked from commit 4e679d8aeaa86ce061b15c51fe9a5eae1eff7470)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With clang 15, the following -Werror warning is produced:
sys/dev/hwpmc/hwpmc_arm64.c:530:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
pmc_arm64_initialize()
^
void
This is because many of the functions are declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 05cef74742154cf3c89be214a464d8fabddf8d7d)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With clang 15, the following -Werror warning is produced:
sys/dev/hwpmc/hwpmc_mod.c:2462:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
pmc_thread_descriptor_pool_drain()
^
void
This is because pmc_thread_descriptor_pool_drain() is declared with a
(void) argument list, but defined with an empty argument list. Make the
definition match the declaration.
MFC after: 3 days
(cherry picked from commit 555d2c9394fa673241fd26a95152adfb9d20952e)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With clang 15, the following -Werror warning is produced:
sys/dev/hwpmc/hwpmc_x86.c:245:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
pcm_md_initialize()
^
void
This is because pcm_md_initialize() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.
MFC after: 3 days
(cherry picked from commit dc0cde7a21a6aab0a5e876d8f890764e32718932)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With clang 15, the following -Werror warnings are produced:
sys/dev/hwpmc/hwpmc_mod.c:4805:6: error: variable 'nfree' set but not used [-Werror,-Wunused-but-set-variable]
int nfree;
^
sys/dev/hwpmc/hwpmc_mod.c:4804:6: error: variable 'ncallchains' set but not used [-Werror,-Wunused-but-set-variable]
int ncallchains;
^
The 'nfree' and 'ncallchains' variables were used in KASSERTs, but these
were removed due to refactoring in d9f1b8dbf29d. Remove the variables
since they no longer serve any purpose.
MFC after: 3 days
(cherry picked from commit 38a9b8a00ce933e99b4a643cdcc3220be82e7d62)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With clang 15, the following -Werror warnings are produced:
sys/dev/hwpmc/hwpmc_logging.c:1228:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
pmclog_initialize()
^
void
sys/dev/hwpmc/hwpmc_logging.c:1277:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
pmclog_shutdown()
^
void
This is because pcmlog_{initialize,shutdown}() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.
MFC after: 3 days
(cherry picked from commit ba95c556029357800d18a5bc5abd02a2b7d0c9de)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A rarely occurring event (e.g. an event that occurs less than 1000
times during execution of a program) may require a lower minimum
threshold than 1000. Replace the hardcoded 1000 with a sysctl that
the administrator can use to permit smaller sampling count values.
Reviewed by: mhorne, mav
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D35400
(cherry picked from commit ca341f3cf52f8cb036d93cd611d8f3f5b552ea8e)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
These checks were inconsistently applied across the various hwpmc
classes. The condition is already checked by the generic code in
hwpmc_mod.c, so remove them.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31388
(cherry picked from commit 0e78510b75497d183ab1aafbd99ff1031798bd84)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is always a good idea. In one case, attempting to allocate N+1 PMCs
from a class with N hardware counters would incorrectly attempt to
allocate from the next class in the list. Without this validation, this
can lead to all kinds of strange behaviour.
Since powerpc_allocate_pmc() is used by both the mpc7xxx and ppc970
classes, add a new global to track which is active (it will never be
both).
Reviewed by: luporl, ray
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31387
(cherry picked from commit 315cd55dba61416495a847f0eed6e522421e2347)
|
| |
|
|
|
|
|
|
|
|
| |
Doing otherwise may lead to lost interrupts, that in combination
with hardware PMCs freezing may leave them frozen forever. It may
also slightly improve profiling accuracy.
MFC after: 2 weeks
(cherry picked from commit f9e62419f6daf226a7116be2601842f8f07b1928)
|
| |
|
|
|
|
| |
MFC after: 2 weeks
(cherry picked from commit 918505d0a084d18ad8e440c12c24b58231b33626)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This allows to profile already running high-priority threads, that
otherwise by blocking thread migration to respective CPUs blocked PMC
management, i.e. profiling could start only when workload completed.
While there, return the thread to its original CPU after iterating
the list. Otherwise all threads using PMC end up on the last CPU.
MFC after: 1 month
(cherry picked from commit eff9ee7c0c8e1fe782d6c01a29bb23224b02a847)
|
| |
|
|
|
|
| |
MFC after: 1 month
(cherry picked from commit 1326017849ee0536e415d69f150514d410b588ff)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
After we wipe PMC configuration, including its local enable bit(s),
we don't really care about its global enable bit. Global enable bits
now may only be cleared by interrupt handler in case of error (sample
buffer overflow). Being set is actually a reset default for them.
This saves one WRMSR per process-scope PMC per context switch, that
is clearly visible in profiles.
MFC after: 1 month
(cherry picked from commit 326a8d3e085dda2b82c99cf1eb2997cb4dc99a71)
|
| |
|
|
|
|
|
|
|
| |
Haswell added there bits 32/33 for TSX, and AlderLake added bit 34
for Adaptive PEBS Record.
MFC after: 1 month
(cherry picked from commit 1a4614a51ee7e3d3cd4ef30b16e13f9ef1713a56)
|
| |
|
|
|
|
|
|
| |
It should remove some unneeded pointer dereferences.
MFC after: 1 month
(cherry picked from commit 47699fc265b9d966b4eba6bc0c41739ac793f52b)
|
| |
|
|
|
|
| |
MFC after: 1 month
(cherry picked from commit 5acb4c862b5b22c0556545a0e3a8dc2300238aca)
|
| |
|
|
|
|
|
|
|
|
| |
The PMC subsystem is not designed for non-uniform CPU capabilities
(P/E-cores are different), but at least several working architectural
events like cpu_clk_unhalted.thread_p should be better than nothing.
MFC after: 1 month
(cherry picked from commit fe109d3113166c8e3b8557f0569c4e5a3597ac93)
|
| |
|
|
|
|
|
|
| |
Primarily remove unneeded restrictions from later CPUs.
MFC after: 1 month
(cherry picked from commit ae57fbc7ec65fcc75575a55c911e0da32ea9c20d)
|
| |
|
|
|
|
|
|
|
| |
Intel json's use event=0 to specify fixed counter number via umask.
Alternatively fixed counters have equivalent programmable event/umask.
MFC after: 1 month
(cherry picked from commit c1e813d1230915e19a236ec687cadc1051841e56)
|
| |
|
|
|
|
|
|
|
|
| |
Since version 2 Intel CPUs can freeze PMCs when intering PMI to reduce
PMI effects on collected statistics. Since version 4 hardware supports
"streamlined" mechanism, not requiring IA_GLOBAL_CTRL MSR access.
MFC after: 1 month
(cherry picked from commit 81ffb45f02dac470cfeddb98f2e4af2d895fea4a)
|
| |
|
|
|
|
| |
MFC after: 1 month
(cherry picked from commit 245b056556e61792ae3cb21fd61e9b2ce362f4b9)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This variable is set based on the exact CPU model detected. If this
value is set too small, it could lead to a NULL-dereference from an
improperly initialized pmc_rowindex_to_classdep array.
Though it has been fixed, this was previously the case for Broadwell.
Add two asserts to catch this in DEBUG kernels, as it represents a
configuration error that may be hard to uncover otherwise.
PR: 253687
Reported by: Zhenlei Huang <zlei.huang@gmail.com>
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 8399d923a5697b7c194dbd44c33018c94ec42c4e)
|
| |
|
|
|
|
|
|
| |
%p already includes the 0x.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 2075d00fabb6d6a76c4829b9e027a496f04262b0)
|
| |
|
|
|
|
| |
- s/avalable/available/
(cherry picked from commit 9966757dd6efe7514290d41cae761baf389dcfc2)
|