0001 .TH TMON 8
0002 # SPDX-License-Identifier: GPL-2.0
0003 .SH NAME
0004 \fBtmon\fP - A monitoring and testing tool for Linux kernel thermal subsystem
0005
0006 .SH SYNOPSIS
0007 .ft B
0008 .B tmon
0009 .RB [ Options ]
0010 .br
0011 .SH DESCRIPTION
0012 \fBtmon \fP can be used to visualize thermal relationship and
0013 real-time thermal data; tune
0014 and test cooling devices and sensors; collect thermal data for offline
0015 analysis and plot. \fBtmon\fP must be run as root in order to control device
0016 states via sysfs.
0017 .PP
0018 \fBFunctions\fP
0019 .PP
0020 .nf
0021 1. Thermal relationships:
0022 - show thermal zone information
0023 - show cooling device information
0024 - show trip point binding within each thermal zone
0025 - show trip point and cooling device instance bindings
0026 .PP
0027 2. Real time data display
0028 - show temperature of all thermal zones w.r.t. its trip points and types
0029 - show states of all cooling devices
0030 .PP
0031 3. Thermal relationship learning and device tuning
0032 - with a built-in Proportional Integral Derivative (\fBPID\fP)
0033 controller, user can pair a cooling device to a thermal sensor for
0034 testing the effectiveness and learn about the thermal distance between the two
0035 - allow manual control of cooling device states and target temperature
0036 .PP
0037 4. Data logging in /var/tmp/tmon.log
0038 - contains thermal configuration data, i.e. cooling device, thermal
0039 zones, and trip points. Can be used for data collection in remote
0040 debugging.
0041 - log real-time thermal data into space separated format that can be
0042 directly consumed by plotting tools such as Rscript.
0043
0044 .SS Options
0045 .PP
0046 The \fB-c --control\fP option sets a cooling device type to control temperature
0047 of a thermal zone
0048 .PP
0049 The \fB-d --daemon\fP option runs \fBtmon \fP as daemon without user interface
0050 .PP
0051 The \fB-g --debug\fP option allow debug messages to be stored in syslog
0052 .PP
0053 The \fB-h --help\fP option shows help message
0054 .PP
0055 The \fB-l --log\fP option write data to /var/tmp/tmon.log
0056 .PP
0057 The \fB-t --time-interval\fP option sets the polling interval in seconds
0058 .PP
0059 The \fB-T --target-temp\fP option sets the initial target temperature
0060 .PP
0061 The \fB-v --version\fP option shows the version of \fBtmon \fP
0062 .PP
0063 The \fB-z --zone\fP option sets the target therma zone instance to be controlled
0064 .PP
0065
0066 .SH FIELD DESCRIPTIONS
0067 .nf
0068 .PP
0069 \fBP \fP passive cooling trip point type
0070 \fBA \fP active cooling trip point type (fan)
0071 \fBC \fP critical trip point type
0072 \fBA \fP hot trip point type
0073 \fBkp \fP proportional gain of \fBPID\fP controller
0074 \fBki \fP integral gain of \fBPID\fP controller
0075 \fBkd \fP derivative gain of \fBPID\fP controller
0076
0077 .SH REQUIREMENT
0078 Build depends on ncurses
0079 .PP
0080 Runtime depends on window size large enough to show the number of
0081 devices found on the system.
0082
0083 .PP
0084
0085 .SH INTERACTIVE COMMANDS
0086 .pp
0087 .nf
0088 \fBCtrl-C, q/Q\fP stops \fBtmon\fP
0089 \fBTAB\fP shows tuning pop up panel, choose a letter to modify
0090
0091 .SH EXAMPLES
0092 Without any parameters, tmon is in monitoring only mode and refresh
0093 screen every 1 second.
0094 .PP
0095 1. For monitoring only:
0096 .nf
0097 $ sudo ./tmon
0098
0099 2. Use Processor cooling device to control thermal zone 0 at default 65C.
0100 $ sudo ./tmon -c Processor -z 0
0101
0102 3. Use intel_powerclamp(idle injection) cooling device to control thermal zone 1
0103 $ sudo ./tmon -c intel_powerclamp -z 1
0104
0105 4. Turn on debug and collect data log at /var/tmp/tmon.log
0106 $ sudo ./tmon -g -l
0107
0108 For example, the log below shows PID controller was adjusting current states
0109 for all cooling devices with "Processor" type such that thermal zone 0
0110 can stay below 65 dC.
0111
0112 #---------- THERMAL DATA LOG STARTED -----------
0113 Samples TargetTemp acpitz0 acpitz1 Fan0 Fan1 Fan2 Fan3 Fan4 Fan5
0114 Fan6 Fan7 Fan8 Fan9 Processor10 Processor11 Processor12 Processor13
0115 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
0116 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
0117 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
0118 5 65.0 52 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0
0119 6 65.0 53 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0
0120 7 65.0 68 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0
0121 8 65.0 68 68 0 0 0 0 0 0 0 0 0 0 5 5 5 5 6 0
0122 9 65.0 68 68 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 0
0123 10 65.0 67 67 0 0 0 0 0 0 0 0 0 0 7 7 7 7 6 0
0124 11 65.0 67 67 0 0 0 0 0 0 0 0 0 0 8 8 8 8 6 0
0125 12 65.0 67 67 0 0 0 0 0 0 0 0 0 0 8 8 8 8 6 0
0126 13 65.0 67 67 0 0 0 0 0 0 0 0 0 0 9 9 9 9 6 0
0127 14 65.0 66 66 0 0 0 0 0 0 0 0 0 0 10 10 10 10 6 0
0128 15 65.0 66 67 0 0 0 0 0 0 0 0 0 0 10 10 10 10 6 0
0129 16 65.0 66 66 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 0
0130 17 65.0 66 66 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 0
0131 18 65.0 64 61 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 0
0132 19 65.0 60 59 0 0 0 0 0 0 0 0 0 0 12 12 12 12 6 0
0133
0134 Data can be read directly into an array by an example R-script below:
0135
0136 #!/usr/bin/Rscript
0137 tdata <- read.table("/var/tmp/tmon.log", header=T, comment.char="#")
0138 attach(tdata)
0139 jpeg("tmon.jpg")
0140 X11()
0141 g_range <- range(0, intel_powerclamp15, TargetTemp, acpitz0)
0142 plot( Samples, intel_powerclamp15, col="blue", ylim=g_range, axes=FALSE, ann=FALSE)
0143 par(new=TRUE)
0144 lines(TargetTemp, type="o", pch=22, lty=2, col="red")
0145 dev.off()