Changeset View
Standalone View
cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | static ls_event_info_t g_event_info[LS_MAX_EVENTS] = { | ||||
{ 'C', "Lock", "R/W writer blocked by writer", "nsec", | { 'C', "Lock", "R/W writer blocked by writer", "nsec", | ||||
"lockstat:::rw-block", "arg2 == 0 && arg3 == 1" }, | "lockstat:::rw-block", "arg2 == 0 && arg3 == 1" }, | ||||
{ 'C', "Lock", "R/W writer blocked by readers", "nsec", | { 'C', "Lock", "R/W writer blocked by readers", "nsec", | ||||
"lockstat:::rw-block", "arg2 == 0 && arg3 == 0 && arg4" }, | "lockstat:::rw-block", "arg2 == 0 && arg3 == 0 && arg4" }, | ||||
{ 'C', "Lock", "R/W reader blocked by writer", "nsec", | { 'C', "Lock", "R/W reader blocked by writer", "nsec", | ||||
"lockstat:::rw-block", "arg2 != 0 && arg3 == 1" }, | "lockstat:::rw-block", "arg2 != 0 && arg3 == 1" }, | ||||
{ 'C', "Lock", "R/W reader blocked by write wanted", "nsec", | { 'C', "Lock", "R/W reader blocked by write wanted", "nsec", | ||||
"lockstat:::rw-block", "arg2 != 0 && arg3 == 0 && arg4" }, | "lockstat:::rw-block", "arg2 != 0 && arg3 == 0 && arg4" }, | ||||
{ 'C', "Lock", "Unknown event (type 8)", "units" }, | { 'C', "Lock", "R/W writer spin on writer", "nsec", | ||||
markj: I fixed this in D2642 by modifying the rwlock probes to pass the correct arguments as… | |||||
Not Done Inline ActionsI like your approach better. Ah, another thing is that we may report both the spinning and sleeping events for adaptive locks while on Solaris it's either-or. BTW, it would probably make sense for rw-spin to provide exactly the same arguments as rw-block? avg: I like your approach better.
So, it seems that with your change we conform to the Solaris… | |||||
Not Done Inline ActionsYup, I believe so. My plan is to next write a lockstat provider man page so that these differences can be documented (as was done with some other providers). I think it makes sense to reuse rw-block's arguments; the one difference is that args[1] should be the time spent spinning rather than the time spent blocked. markj: Yup, I believe so. My plan is to next write a lockstat provider man page so that these… | |||||
{ 'C', "Lock", "Unknown event (type 9)", "units" }, | "lockstat:::rw-spin", "arg2 == 0 && arg3 == 1" }, | ||||
{ 'C', "Lock", "Unknown event (type 10)", "units" }, | { 'C', "Lock", "R/W writer spin on readers", "nsec", | ||||
{ 'C', "Lock", "Unknown event (type 11)", "units" }, | "lockstat:::rw-spin", "arg2 == 0 && arg3 == 0 && arg4" }, | ||||
{ 'C', "Lock", "Unknown event (type 12)", "units" }, | { 'C', "Lock", "R/W reader spin on writer", "nsec", | ||||
{ 'C', "Lock", "Unknown event (type 13)", "units" }, | "lockstat:::rw-spin", "arg2 != 0 && arg3 == 1" }, | ||||
{ 'C', "Lock", "Unknown event (type 14)", "units" }, | { 'C', "Lock", "R/W reader spin on write wanted", "nsec", | ||||
{ 'C', "Lock", "Unknown event (type 15)", "units" }, | "lockstat:::rw-spin", "arg2 != 0 && arg3 == 0 && arg4" }, | ||||
{ 'C', "Lock", "SX exclusive block", "nsec", | |||||
"lockstat:::sx-block", "arg2 == 0" }, | |||||
{ 'C', "Lock", "SX shared block", "nsec", | |||||
"lockstat:::sx-block", "arg2 != 0" }, | |||||
{ 'C', "Lock", "SX exclusive spin", "nsec", | |||||
"lockstat:::sx-spin", "arg2 == 0" }, | |||||
{ 'C', "Lock", "SX shared spin", "nsec", | |||||
"lockstat::sx-spin", "arg2 != 0" }, | |||||
markjUnsubmitted Done Inline ActionsThis should be lockstat:::sx-spin? markj: This should be lockstat:::sx-spin? | |||||
avgAuthorUnsubmitted Not Done Inline ActionsYes! avg: Yes! | |||||
{ 'C', "Lock", "Unknown event (type 16)", "units" }, | { 'C', "Lock", "Unknown event (type 16)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 17)", "units" }, | { 'C', "Lock", "Unknown event (type 17)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 18)", "units" }, | { 'C', "Lock", "Unknown event (type 18)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 19)", "units" }, | { 'C', "Lock", "Unknown event (type 19)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 20)", "units" }, | { 'C', "Lock", "Unknown event (type 20)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 21)", "units" }, | { 'C', "Lock", "Unknown event (type 21)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 22)", "units" }, | { 'C', "Lock", "Unknown event (type 22)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 23)", "units" }, | { 'C', "Lock", "Unknown event (type 23)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 24)", "units" }, | { 'C', "Lock", "Unknown event (type 24)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 25)", "units" }, | { 'C', "Lock", "Unknown event (type 25)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 26)", "units" }, | { 'C', "Lock", "Unknown event (type 26)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 27)", "units" }, | { 'C', "Lock", "Unknown event (type 27)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 28)", "units" }, | { 'C', "Lock", "Unknown event (type 28)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 29)", "units" }, | { 'C', "Lock", "Unknown event (type 29)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 30)", "units" }, | { 'C', "Lock", "Unknown event (type 30)", "units" }, | ||||
{ 'C', "Lock", "Unknown event (type 31)", "units" }, | { 'C', "Lock", "Unknown event (type 31)", "units" }, | ||||
{ 'H', "Lock", "Adaptive mutex hold", "nsec", | { 'H', "Lock", "Adaptive mutex hold", "nsec", | ||||
"lockstat:::adaptive-release", NULL, | "lockstat:::adaptive-release", NULL, | ||||
"lockstat:::adaptive-acquire" }, | "lockstat:::adaptive-acquire" }, | ||||
{ 'H', "Lock", "Spin lock hold", "nsec", | { 'H', "Lock", "Spin lock hold", "nsec", | ||||
"lockstat:::spin-release", NULL, | "lockstat:::spin-release", NULL, | ||||
"lockstat:::spin-acquire" }, | "lockstat:::spin-acquire" }, | ||||
{ 'H', "Lock", "R/W writer hold", "nsec", | { 'H', "Lock", "R/W writer hold", "nsec", | ||||
"lockstat:::rw-release", "arg1 == 0", | "lockstat::rw_wunlock:rw-release", NULL, | ||||
markjUnsubmitted Not Done Inline ActionsThese probes should also use arguments to determine whether a reader or writer is taking or releasing the lock. markj: These probes should also use arguments to determine whether a reader or writer is taking or… | |||||
avgAuthorUnsubmitted Not Done Inline ActionsYes, but I was too lazy to transplant that part of your change into this change. avg: Yes, but I was too lazy to transplant that part of your change into this change.
I still can do… | |||||
"lockstat:::rw-acquire" }, | "lockstat::rw_wlock:rw-acquire" }, | ||||
{ 'H', "Lock", "R/W reader hold", "nsec", | { 'H', "Lock", "R/W reader hold", "nsec", | ||||
Not Done Inline ActionsSure, I can handle that. markj: Sure, I can handle that. | |||||
"lockstat:::rw-release", "arg1 != 0", | "lockstat::rw_runlock:rw-release", NULL, | ||||
"lockstat:::rw-acquire" }, | "lockstat::rw_rlock:rw-acquire" }, | ||||
{ 'H', "Lock", "Unknown event (type 36)", "units" }, | { 'H', "Lock", "SX shared hold", "nsec", | ||||
{ 'H', "Lock", "Unknown event (type 37)", "units" }, | "lockstat::sx_sunlock:sx-release", NULL, | ||||
"lockstat::sx_slock:sx-acquire" }, | |||||
{ 'H', "Lock", "SX exclusive hold", "nsec", | |||||
"lockstat::sx_xunlock:sx-release", NULL, | |||||
"lockstat::sx_xlock:sx-acquire" }, | |||||
{ 'H', "Lock", "Unknown event (type 38)", "units" }, | { 'H', "Lock", "Unknown event (type 38)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 39)", "units" }, | { 'H', "Lock", "Unknown event (type 39)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 40)", "units" }, | { 'H', "Lock", "Unknown event (type 40)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 41)", "units" }, | { 'H', "Lock", "Unknown event (type 41)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 42)", "units" }, | { 'H', "Lock", "Unknown event (type 42)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 43)", "units" }, | { 'H', "Lock", "Unknown event (type 43)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 44)", "units" }, | { 'H', "Lock", "Unknown event (type 44)", "units" }, | ||||
{ 'H', "Lock", "Unknown event (type 45)", "units" }, | { 'H', "Lock", "Unknown event (type 45)", "units" }, | ||||
▲ Show 20 Lines • Show All 1,714 Lines • Show Last 20 Lines |
I fixed this in D2642 by modifying the rwlock probes to pass the correct arguments as documented in Solaris' lockstat provider page: https://wikis.oracle.com/display/DTrace/lockstat+Provider
Do you have a preference for either approach?