summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/dt/dt_prov_static.c13
-rw-r--r--sys/kern/vfs_bio.c14
2 files changed, 24 insertions, 3 deletions
diff --git a/sys/dev/dt/dt_prov_static.c b/sys/dev/dt/dt_prov_static.c
index c2b02096c4f..d7e10542a0c 100644
--- a/sys/dev/dt/dt_prov_static.c
+++ b/sys/dev/dt/dt_prov_static.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dt_prov_static.c,v 1.4 2020/09/13 14:55:08 jasper Exp $ */
+/* $OpenBSD: dt_prov_static.c,v 1.5 2020/09/14 19:02:09 jasper Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
@@ -58,6 +58,13 @@ DT_STATIC_PROBE3(uvm, map_insert, "vaddr_t", "vaddr_t", "vm_prot_t");
DT_STATIC_PROBE3(uvm, map_remove, "vaddr_t", "vaddr_t", "vm_prot_t");
/*
+ * VFS
+ */
+DT_STATIC_PROBE3(vfs, bufcache_rel, "long", "int", "int64_t");
+DT_STATIC_PROBE3(vfs, bufcache_take, "long", "int", "int64_t");
+DT_STATIC_PROBE4(vfs, cleaner, "long", "int", "long", "long");
+
+/*
* List of all static probes
*/
struct dt_probe *dtps_static[] = {
@@ -76,6 +83,10 @@ struct dt_probe *dtps_static[] = {
&_DT_STATIC_P(uvm, fault),
&_DT_STATIC_P(uvm, map_insert),
&_DT_STATIC_P(uvm, map_remove),
+ /* VFS */
+ &_DT_STATIC_P(vfs, bufcache_rel),
+ &_DT_STATIC_P(vfs, bufcache_take),
+ &_DT_STATIC_P(vfs, cleaner),
};
int
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index de41d11ec56..a99f81956bf 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.202 2020/09/12 11:57:24 beck Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.203 2020/09/14 19:02:09 jasper Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
@@ -57,6 +57,7 @@
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/specdev.h>
+#include <sys/tracepoint.h>
#include <uvm/uvm_extern.h>
/* XXX Should really be in buf.h, but for uvm_constraint_range.. */
@@ -1209,6 +1210,9 @@ buf_daemon(void *arg)
}
while ((bp = bufcache_getdirtybuf())) {
+ TRACEPOINT(vfs, cleaner, bp->b_flags, pushed,
+ lodirtypages, hidirtypages);
+
if (UNCLEAN_PAGES < lodirtypages &&
bcstats.kvaslots_avail > 2 * RESERVE_SLOTS &&
pushed >= 16)
@@ -1693,6 +1697,9 @@ bufcache_take(struct buf *bp)
KASSERT((bp->cache < NUM_CACHES));
pages = atop(bp->b_bufsize);
+
+ TRACEPOINT(vfs, bufcache_take, bp->b_flags, bp->cache, pages);
+
struct bufcache *cache = &cleancache[bp->cache];
if (!ISSET(bp->b_flags, B_DELWRI)) {
if (ISSET(bp->b_flags, B_COLD)) {
@@ -1756,8 +1763,11 @@ bufcache_release(struct buf *bp)
int64_t pages;
struct bufcache *cache = &cleancache[bp->cache];
- pages = atop(bp->b_bufsize);
KASSERT(ISSET(bp->b_flags, B_BC));
+ pages = atop(bp->b_bufsize);
+
+ TRACEPOINT(vfs, bufcache_rel, bp->b_flags, bp->cache, pages);
+
if (fliphigh) {
if (ISSET(bp->b_flags, B_DMA) && bp->cache > 0)
panic("B_DMA buffer release from cache %d",