Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 38.1Mb
PDF (A4) - 38.1Mb
PDF (RPM) - 33.0Mb
HTML Download (TGZ) - 8.1Mb
HTML Download (Zip) - 8.1Mb
HTML Download (RPM) - 6.9Mb
Man Pages (TGZ) - 132.7Kb
Man Pages (Zip) - 189.0Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  The ps_trace_thread() Procedure

26.4.4.23 The ps_trace_thread() Procedure

Dumps all Performance Schema data for an instrumented thread to a .dot formatted graph file (for the DOT graph description language). Each result set returned from the procedure should be used for a complete graph.

This procedure requires the SYSTEM_VARIABLES_ADMIN or SUPER privilege because it manipulates the session sql_log_bin system variable to disable binary logging during its execution.

Parameters
  • in_thread_id INT: The thread to trace.

  • in_outfile VARCHAR(255): The name to use for the .dot output file.

  • in_max_runtime DECIMAL(20,2): The maximum number of seconds (which can be fractional) to collect data. Use NULL to collect data for the default of 60 seconds.

  • in_interval DECIMAL(20,2): The number of seconds (which can be fractional) to sleep between data collections. Use NULL to sleep for the default of 1 second.

  • in_start_fresh BOOLEAN: Whether to reset all Performance Schema data before tracing.

  • in_auto_setup BOOLEAN: Whether to disable all other threads and enable all instruments and consumers. This also resets the settings at the end of the run.

  • in_debug BOOLEAN: Whether to include file:lineno information in the graph.

Example
mysql> CALL ps_trace_thread(25, CONCAT('/tmp/stack-', REPLACE(NOW(), ' ', '-'), '.dot'), NULL, NULL, TRUE, TRUE, TRUE);
+-------------------+
| summary           |
+-------------------+
| Disabled 1 thread |
+-------------------+
1 row in set (0.00 sec)

+---------------------------------------------+
| Info                                        |
+---------------------------------------------+
| Data collection starting for THREAD_ID = 25 |
+---------------------------------------------+
1 row in set (0.03 sec)

+-----------------------------------------------------------+
| Info                                                      |
+-----------------------------------------------------------+
| Stack trace written to /tmp/stack-2014-02-16-21:18:41.dot |
+-----------------------------------------------------------+
1 row in set (60.07 sec)

+-------------------------------------------------------------------+
| Convert to PDF                                                    |
+-------------------------------------------------------------------+
| dot -Tpdf -o /tmp/stack_25.pdf /tmp/stack-2014-02-16-21:18:41.dot |
+-------------------------------------------------------------------+
1 row in set (60.07 sec)

+-------------------------------------------------------------------+
| Convert to PNG                                                    |
+-------------------------------------------------------------------+
| dot -Tpng -o /tmp/stack_25.png /tmp/stack-2014-02-16-21:18:41.dot |
+-------------------------------------------------------------------+
1 row in set (60.07 sec)

+------------------+
| summary          |
+------------------+
| Enabled 1 thread |
+------------------+
1 row in set (60.32 sec)

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.