MySQL 8.0.39
Source Code Documentation
Performance schema TLS channels instrumentation

Registration

To expose TLS configuration details through performance schema:

  • Implement a subclass of TLS_channel_property_iterator
  • Register it with Performance schema on init/bootstrap
  • Unregister instrumentation with Performance schema on deinit/shutdown

Iteration for each TLS channel

When the server performs a SELECT * from performance_schema.tls_channeL_info, the performance schema creates a TLS_channel_status_container for the duration of the table scan.

Then, the scan loops for each TLS channel capable of exposing status (i.e. channels that registered TLS channel status iterator).

For each channel, an iterator is created, dedicated for this SELECT scan.

Inside a registered TLS channel

When rnd_init() is called, the performance schema iterates through registered TLS channels and add data corresponding to each channel in TLS channel data container.

Upon subsequent calls rnd_next(), data present in the container is returned. This process continues until no more data is left in the container.

This method allows performance schema to shorten the duration for which registered TLS channel container is locked. This is essential because mysql_tls_channel_register() and mysql_tls_channel_deregister() may modify the TLS channel container.