aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lockstat.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-05-23 15:25:42 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-05-23 17:55:27 +0000
commit6a467cc5e1f673a700f6229e63e9a98ed65264c8 (patch)
tree20ceb414e21bd978115b5d5589895b4f7dfeca85 /sys/sys/lockstat.h
parenteaf00819bcfa90ab7ac8af324826eb985197d8c8 (diff)
downloadsrc-6a467cc5e1f673a700f6229e63e9a98ed65264c8.tar.gz
src-6a467cc5e1f673a700f6229e63e9a98ed65264c8.zip
lockprof: pass lock type as an argument instead of reading the spin flag
Diffstat (limited to 'sys/sys/lockstat.h')
-rw-r--r--sys/sys/lockstat.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h
index 6a5f79a2f152..76bd97dbafa5 100644
--- a/sys/sys/lockstat.h
+++ b/sys/sys/lockstat.h
@@ -97,22 +97,32 @@ extern volatile bool lockstat_enabled;
SDT_PROBE5(lockstat, , , probe, lp, arg1, arg2, arg3, arg4)
#define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) do { \
- lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \
+ lock_profile_obtain_lock_success(&(lp)->lock_object, false, c, wt, f, l); \
+ LOCKSTAT_RECORD0(probe, lp); \
+} while (0)
+
+#define LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) do { \
+ lock_profile_obtain_lock_success(&(lp)->lock_object, true, c, wt, f, l); \
LOCKSTAT_RECORD0(probe, lp); \
} while (0)
#define LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(probe, lp, c, wt, f, l, a) do { \
- lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l); \
+ lock_profile_obtain_lock_success(&(lp)->lock_object, false, c, wt, f, l); \
LOCKSTAT_RECORD1(probe, lp, a); \
} while (0)
#define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) do { \
- lock_profile_release_lock(&(lp)->lock_object); \
+ lock_profile_release_lock(&(lp)->lock_object, false); \
+ LOCKSTAT_RECORD0(probe, lp); \
+} while (0)
+
+#define LOCKSTAT_PROFILE_RELEASE_SPIN_LOCK(probe, lp) do { \
+ lock_profile_release_lock(&(lp)->lock_object, true); \
LOCKSTAT_RECORD0(probe, lp); \
} while (0)
#define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) do { \
- lock_profile_release_lock(&(lp)->lock_object); \
+ lock_profile_release_lock(&(lp)->lock_object, false); \
LOCKSTAT_RECORD1(probe, lp, a); \
} while (0)
@@ -130,13 +140,19 @@ uint64_t lockstat_nsecs(struct lock_object *);
#define LOCKSTAT_RECORD4(probe, lp, arg1, arg2, arg3, arg4)
#define LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) \
- lock_profile_obtain_lock_success(&(lp)->lock_object, c, wt, f, l)
+ lock_profile_obtain_lock_success(&(lp)->lock_object, false, c, wt, f, l)
+
+#define LOCKSTAT_PROFILE_OBTAIN_SPIN_LOCK_SUCCESS(probe, lp, c, wt, f, l) \
+ lock_profile_obtain_lock_success(&(lp)->lock_object, true, c, wt, f, l)
#define LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(probe, lp, c, wt, f, l, a) \
LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(probe, lp, c, wt, f, l)
#define LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) \
- lock_profile_release_lock(&(lp)->lock_object)
+ lock_profile_release_lock(&(lp)->lock_object, false)
+
+#define LOCKSTAT_PROFILE_RELEASE_SPIN_LOCK(probe, lp) \
+ lock_profile_release_lock(&(lp)->lock_object, true)
#define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \
LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp)