No cache version.


Caching disabled. Default setting for this page:enabled (code DEF204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher dans le manuel MySQL

27.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 disables binary logging during its execution by manipulating the session value of the sql_log_bin system variable. That is a restricted operation, so the procedure requires privileges sufficient to set restricted session variables. See Section 5.1.9.1, “System Variable Privileges”.

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.

Contents Haut

Example
  1. mysql> CALL sys.ps_trace_thread(25, CONCAT('/tmp/stack-', REPLACE(NOW(), ' ', '-'), '.dot'), NULL, NULL, TRUE, TRUE, TRUE);
  2. +-------------------+
  3. | summary           |
  4. +-------------------+
  5. | Disabled 1 thread |
  6. +-------------------+
  7. 1 row in set (0.00 sec)
  8.  
  9. +---------------------------------------------+
  10. | Info                                        |
  11. +---------------------------------------------+
  12. | Data collection starting for THREAD_ID = 25 |
  13. +---------------------------------------------+
  14. 1 row in set (0.03 sec)
  15.  
  16. +-----------------------------------------------------------+
  17. | Info                                                      |
  18. +-----------------------------------------------------------+
  19. | Stack trace written to /tmp/stack-2014-02-16-21:18:41.dot |
  20. +-----------------------------------------------------------+
  21. 1 row in set (60.07 sec)
  22.  
  23. +-------------------------------------------------------------------+
  24. | Convert to PDF                                                    |
  25. +-------------------------------------------------------------------+
  26. | dot -Tpdf -o /tmp/stack_25.pdf /tmp/stack-2014-02-16-21:18:41.dot |
  27. +-------------------------------------------------------------------+
  28. 1 row in set (60.07 sec)
  29.  
  30. +-------------------------------------------------------------------+
  31. | Convert to PNG                                                    |
  32. +-------------------------------------------------------------------+
  33. | dot -Tpng -o /tmp/stack_25.png /tmp/stack-2014-02-16-21:18:41.dot |
  34. +-------------------------------------------------------------------+
  35. 1 row in set (60.07 sec)
  36.  
  37. +------------------+
  38. | summary          |
  39. +------------------+
  40. | Enabled 1 thread |
  41. +------------------+
  42. 1 row in set (60.32 sec)

Find a PHP function

Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-sys-ps-trace-thread.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:en Manuel MySQL : https://dev.mysql.com/

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut