When a semaphore wait is in progress, InnoDB prints information about the wait in sync_array_cell_print():
For mutexes, the function does print the mutex's name. For example, here is a log message for trx_sys->mutex which is identified by TRX_SYS:
However, for RW-latches, the function does not print the RW-latch's name. For example:
You can still determine the RW-latch's name by looking for strings like created in file ibuf0ibuf.cc line 563. This specific output was taken from MariaDB 10.2.21, so we would need to look at that specific file for that specific version. Let's take a look:
We can see that this specific RW-latch is ibuf->index->lock.
I suspect that users could also determine what the specific RW-latch is by looking for strings like at 0x138245380 and using debugging tools like gdb to inspect the memory address.
However, these kinds of tedious analytical methods should not be required. The lock monitor should print an easily identifiable name for the RW-latch, just like it already does for mutexes, so that users do not need to do tedious things to determine what the specific RW-latch is called.