fd: dlm: trace send/recv of dlm message and rcom
authorAlexander Aring <aahringo@redhat.com>
Thu, 27 Oct 2022 20:45:15 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:18 +0000 (08:50 +0100)
commit387c3038949492b0d7c6a659ca33c30bb97fb8ec
treeb85d845e1c25edde9ca63c87a1aa3c20cca47920
parent8885e12aa107f1aa825e570cdcf8e53f9882d488
fd: dlm: trace send/recv of dlm message and rcom

[ Upstream commit e01c4b7bd41522ae0299c07e2ee8c721fee02595 ]

This patch adds tracepoints for send and recv cases of dlm messages and
dlm rcom messages. In case of send and dlm message we add the dlm rsb
resource name this dlm messages belongs to. This has the advantage to
follow dlm messages on a per lock basis. In case of recv message the
resource name can be extracted by follow the send message sequence
number.

The dlm message DLM_MSG_PURGE doesn't belong to a lock request and will
not set the resource name in a dlm_message trace. The same for all rcom
messages.

There is additional handling required for this debugging functionality
which is tried to be small as possible. Also the midcomms layer gets
aware of lock resource names, for now this is required to make a
connection between sequence number and lock resource names. It is for
debugging purpose only.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Stable-dep-of: 724b6bab0d75 ("fs: dlm: fix use after free in midcomms commit")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/dlm/lock.c
fs/dlm/midcomms.c
fs/dlm/midcomms.h
fs/dlm/rcom.c
include/trace/events/dlm.h