WL#7445: PERFORMANCE SCHEMA: instrument SX-lock for rw_lock

Affects: Server-5.7   —   Status: Complete

This task is a consequence of

WL#6363 InnoDB: implement SX-lock for rw_lock

Now that new operations are defined on a read/write lock,
the performance schema instrumentation for read/write locks
should be enhanced to support the new SX-lock operation.

F-1 Existing table setup_instruments exposes a new instrument prefix,
for instrumented SX-locks.
The prefix is "wait/synch/sxlock/"

F-2 Existing wait summary tables do provide aggregate statistics
for "wait/synch/sxlock/", in respectively:
- F-2-1: table events_waits_summary_by_account_by_event_name
- F-2-2: table events_waits_summary_by_host_by_event_name
- F-2-3: table events_waits_summary_by_thread_by_event_name
- F-2-4: table events_waits_summary_by_user_by_event_name
- F-2-5: table events_waits_summary_global_by_event_name

F-3 Existing table rwlock_instances also exposes instances
of "wait/synch/sxlock/" locks.

F-4 Operations defined for SX-locks are:
- "shared_lock"
- "shared_exclusive_lock"
- "exclusive_lock"
- "try_shared_lock"
- "try_shared_exclusive_lock"
- "try_exclusive_lock"

F-5 Instrumented operations for SX-locks are reported in column
OPERATION in tables:
- F-5-1 events_waits_current
- F-5-2 events_waits_history
- F-5-3 events_waits_history_long

Context
=======

The existing performance schema instrumentation for read-write locks defines the
following operations:
- READ LOCK
- WRITE LOCK
- TRY READ LOCK
- TRY WRITE LOCK

This instrumentation is sufficient to instrument pthread_rwlock_t,
as well as custom read-write locks using the same semantic.

Changes
=======

The list of operations supported by the performance schema read-write lock
instrumentation is extended to include the following operations:
- SHARED LOCK
- SHARED EXCLUSIVE LOCK
- EXCLUSIVE LOCK
- TRY SHARED LOCK
- TRY SHARED EXCLUSIVE LOCK
- TRY EXCLUSIVE LOCK

Project branch: mysql-trunk-wl7445

Code review: http://rb.no.oracle.com/rb/r/6077/