tmon.8 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. .TH TMON 8
  2. # SPDX-License-Identifier: GPL-2.0
  3. .SH NAME
  4. \fBtmon\fP - A monitoring and testing tool for Linux kernel thermal subsystem
  5. .SH SYNOPSIS
  6. .ft B
  7. .B tmon
  8. .RB [ Options ]
  9. .br
  10. .SH DESCRIPTION
  11. \fBtmon \fP can be used to visualize thermal relationship and
  12. real-time thermal data; tune
  13. and test cooling devices and sensors; collect thermal data for offline
  14. analysis and plot. \fBtmon\fP must be run as root in order to control device
  15. states via sysfs.
  16. .PP
  17. \fBFunctions\fP
  18. .PP
  19. .nf
  20. 1. Thermal relationships:
  21. - show thermal zone information
  22. - show cooling device information
  23. - show trip point binding within each thermal zone
  24. - show trip point and cooling device instance bindings
  25. .PP
  26. 2. Real time data display
  27. - show temperature of all thermal zones w.r.t. its trip points and types
  28. - show states of all cooling devices
  29. .PP
  30. 3. Thermal relationship learning and device tuning
  31. - with a built-in Proportional Integral Derivative (\fBPID\fP)
  32. controller, user can pair a cooling device to a thermal sensor for
  33. testing the effectiveness and learn about the thermal distance between the two
  34. - allow manual control of cooling device states and target temperature
  35. .PP
  36. 4. Data logging in /var/tmp/tmon.log
  37. - contains thermal configuration data, i.e. cooling device, thermal
  38. zones, and trip points. Can be used for data collection in remote
  39. debugging.
  40. - log real-time thermal data into space separated format that can be
  41. directly consumed by plotting tools such as Rscript.
  42. .SS Options
  43. .PP
  44. The \fB-c --control\fP option sets a cooling device type to control temperature
  45. of a thermal zone
  46. .PP
  47. The \fB-d --daemon\fP option runs \fBtmon \fP as daemon without user interface
  48. .PP
  49. The \fB-g --debug\fP option allow debug messages to be stored in syslog
  50. .PP
  51. The \fB-h --help\fP option shows help message
  52. .PP
  53. The \fB-l --log\fP option write data to /var/tmp/tmon.log
  54. .PP
  55. The \fB-t --time-interval\fP option sets the polling interval in seconds
  56. .PP
  57. The \fB-T --target-temp\fP option sets the initial target temperature
  58. .PP
  59. The \fB-v --version\fP option shows the version of \fBtmon \fP
  60. .PP
  61. The \fB-z --zone\fP option sets the target therma zone instance to be controlled
  62. .PP
  63. .SH FIELD DESCRIPTIONS
  64. .nf
  65. .PP
  66. \fBP \fP passive cooling trip point type
  67. \fBA \fP active cooling trip point type (fan)
  68. \fBC \fP critical trip point type
  69. \fBA \fP hot trip point type
  70. \fBkp \fP proportional gain of \fBPID\fP controller
  71. \fBki \fP integral gain of \fBPID\fP controller
  72. \fBkd \fP derivative gain of \fBPID\fP controller
  73. .SH REQUIREMENT
  74. Build depends on ncurses
  75. .PP
  76. Runtime depends on window size large enough to show the number of
  77. devices found on the system.
  78. .PP
  79. .SH INTERACTIVE COMMANDS
  80. .pp
  81. .nf
  82. \fBCtrl-C, q/Q\fP stops \fBtmon\fP
  83. \fBTAB\fP shows tuning pop up panel, choose a letter to modify
  84. .SH EXAMPLES
  85. Without any parameters, tmon is in monitoring only mode and refresh
  86. screen every 1 second.
  87. .PP
  88. 1. For monitoring only:
  89. .nf
  90. $ sudo ./tmon
  91. 2. Use Processor cooling device to control thermal zone 0 at default 65C.
  92. $ sudo ./tmon -c Processor -z 0
  93. 3. Use intel_powerclamp(idle injection) cooling device to control thermal zone 1
  94. $ sudo ./tmon -c intel_powerclamp -z 1
  95. 4. Turn on debug and collect data log at /var/tmp/tmon.log
  96. $ sudo ./tmon -g -l
  97. For example, the log below shows PID controller was adjusting current states
  98. for all cooling devices with "Processor" type such that thermal zone 0
  99. can stay below 65 dC.
  100. #---------- THERMAL DATA LOG STARTED -----------
  101. Samples TargetTemp acpitz0 acpitz1 Fan0 Fan1 Fan2 Fan3 Fan4 Fan5
  102. Fan6 Fan7 Fan8 Fan9 Processor10 Processor11 Processor12 Processor13
  103. LCD14 intel_powerclamp15 1 65.0 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 2
  104. 65.0 66 65 0 0 0 0 0 0 0 0 0 0 4 4 4 4 6 0 3 65.0 60 54 0 0 0 0 0 0 0 0
  105. 0 0 4 4 4 4 6 0 4 65.0 53 53 0 0 0 0 0 0 0 0 0 0 4 4 4 4 6 0
  106. 5 65.0 52 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0
  107. 6 65.0 53 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0
  108. 7 65.0 68 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0
  109. 8 65.0 68 68 0 0 0 0 0 0 0 0 0 0 5 5 5 5 6 0
  110. 9 65.0 68 68 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 0
  111. 10 65.0 67 67 0 0 0 0 0 0 0 0 0 0 7 7 7 7 6 0
  112. 11 65.0 67 67 0 0 0 0 0 0 0 0 0 0 8 8 8 8 6 0
  113. 12 65.0 67 67 0 0 0 0 0 0 0 0 0 0 8 8 8 8 6 0
  114. 13 65.0 67 67 0 0 0 0 0 0 0 0 0 0 9 9 9 9 6 0
  115. 14 65.0 66 66 0 0 0 0 0 0 0 0 0 0 10 10 10 10 6 0
  116. 15 65.0 66 67 0 0 0 0 0 0 0 0 0 0 10 10 10 10 6 0
  117. 16 65.0 66 66 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 0
  118. 17 65.0 66 66 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 0
  119. 18 65.0 64 61 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 0
  120. 19 65.0 60 59 0 0 0 0 0 0 0 0 0 0 12 12 12 12 6 0
  121. Data can be read directly into an array by an example R-script below:
  122. #!/usr/bin/Rscript
  123. tdata <- read.table("/var/tmp/tmon.log", header=T, comment.char="#")
  124. attach(tdata)
  125. jpeg("tmon.jpg")
  126. X11()
  127. g_range <- range(0, intel_powerclamp15, TargetTemp, acpitz0)
  128. plot( Samples, intel_powerclamp15, col="blue", ylim=g_range, axes=FALSE, ann=FALSE)
  129. par(new=TRUE)
  130. lines(TargetTemp, type="o", pch=22, lty=2, col="red")
  131. dev.off()