146 lines · plain
1.TH TMON 82# SPDX-License-Identifier: GPL-2.03.SH NAME4\fBtmon\fP - A monitoring and testing tool for Linux kernel thermal subsystem5 6.SH SYNOPSIS7.ft B8.B tmon9.RB [ Options ]10.br11.SH DESCRIPTION12\fBtmon \fP can be used to visualize thermal relationship and13real-time thermal data; tune14and test cooling devices and sensors; collect thermal data for offline15analysis and plot. \fBtmon\fP must be run as root in order to control device16states via sysfs.17.PP18\fBFunctions\fP19.PP20.nf211. Thermal relationships:22- show thermal zone information23- show cooling device information24- show trip point binding within each thermal zone25- show trip point and cooling device instance bindings26.PP272. Real time data display28- show temperature of all thermal zones w.r.t. its trip points and types29- show states of all cooling devices30.PP313. Thermal relationship learning and device tuning32- with a built-in Proportional Integral Derivative (\fBPID\fP)33controller, user can pair a cooling device to a thermal sensor for34testing the effectiveness and learn about the thermal distance between the two35- allow manual control of cooling device states and target temperature36.PP374. Data logging in /var/tmp/tmon.log38- contains thermal configuration data, i.e. cooling device, thermal39 zones, and trip points. Can be used for data collection in remote40 debugging.41- log real-time thermal data into space separated format that can be42 directly consumed by plotting tools such as Rscript.43 44.SS Options45.PP46The \fB-c --control\fP option sets a cooling device type to control temperature47of a thermal zone48.PP49The \fB-d --daemon\fP option runs \fBtmon \fP as daemon without user interface50.PP51The \fB-g --debug\fP option allow debug messages to be stored in syslog52.PP53The \fB-h --help\fP option shows help message54.PP55The \fB-l --log\fP option write data to /var/tmp/tmon.log56.PP57The \fB-t --time-interval\fP option sets the polling interval in seconds58.PP59The \fB-T --target-temp\fP option sets the initial target temperature60.PP61The \fB-v --version\fP option shows the version of \fBtmon \fP62.PP63The \fB-z --zone\fP option sets the target therma zone instance to be controlled64.PP65 66.SH FIELD DESCRIPTIONS67.nf68.PP69\fBP \fP passive cooling trip point type70\fBA \fP active cooling trip point type (fan)71\fBC \fP critical trip point type72\fBA \fP hot trip point type73\fBkp \fP proportional gain of \fBPID\fP controller74\fBki \fP integral gain of \fBPID\fP controller75\fBkd \fP derivative gain of \fBPID\fP controller76 77.SH REQUIREMENT78Build depends on ncurses79.PP80Runtime depends on window size large enough to show the number of81devices found on the system.82 83.PP84 85.SH INTERACTIVE COMMANDS86.pp87.nf88\fBCtrl-C, q/Q\fP stops \fBtmon\fP89\fBTAB\fP shows tuning pop up panel, choose a letter to modify90 91.SH EXAMPLES92Without any parameters, tmon is in monitoring only mode and refresh93screen every 1 second.94.PP951. For monitoring only:96.nf97$ sudo ./tmon98 992. Use Processor cooling device to control thermal zone 0 at default 65C.100$ sudo ./tmon -c Processor -z 0101 1023. Use intel_powerclamp(idle injection) cooling device to control thermal zone 1103$ sudo ./tmon -c intel_powerclamp -z 1104 1054. Turn on debug and collect data log at /var/tmp/tmon.log106$ sudo ./tmon -g -l107 108For example, the log below shows PID controller was adjusting current states109for all cooling devices with "Processor" type such that thermal zone 0110can stay below 65 dC.111 112#---------- THERMAL DATA LOG STARTED -----------113Samples TargetTemp acpitz0 acpitz1 Fan0 Fan1 Fan2 Fan3 Fan4 Fan5114Fan6 Fan7 Fan8 Fan9 Processor10 Processor11 Processor12 Processor13115LCD14 intel_powerclamp15 1 65.0 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 211665.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 01170 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 01185 65.0 52 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 01196 65.0 53 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 01207 65.0 68 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 01218 65.0 68 68 0 0 0 0 0 0 0 0 0 0 5 5 5 5 6 01229 65.0 68 68 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 012310 65.0 67 67 0 0 0 0 0 0 0 0 0 0 7 7 7 7 6 012411 65.0 67 67 0 0 0 0 0 0 0 0 0 0 8 8 8 8 6 012512 65.0 67 67 0 0 0 0 0 0 0 0 0 0 8 8 8 8 6 012613 65.0 67 67 0 0 0 0 0 0 0 0 0 0 9 9 9 9 6 012714 65.0 66 66 0 0 0 0 0 0 0 0 0 0 10 10 10 10 6 012815 65.0 66 67 0 0 0 0 0 0 0 0 0 0 10 10 10 10 6 012916 65.0 66 66 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 013017 65.0 66 66 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 013118 65.0 64 61 0 0 0 0 0 0 0 0 0 0 11 11 11 11 6 013219 65.0 60 59 0 0 0 0 0 0 0 0 0 0 12 12 12 12 6 0133 134Data can be read directly into an array by an example R-script below:135 136#!/usr/bin/Rscript137tdata <- read.table("/var/tmp/tmon.log", header=T, comment.char="#")138attach(tdata)139jpeg("tmon.jpg")140X11()141g_range <- range(0, intel_powerclamp15, TargetTemp, acpitz0)142plot( Samples, intel_powerclamp15, col="blue", ylim=g_range, axes=FALSE, ann=FALSE)143par(new=TRUE)144lines(TargetTemp, type="o", pch=22, lty=2, col="red")145dev.off()146