-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/…
…rzhang/linux Pull thermal management updates from Zhang Rui: "This time we only have a few changes as there are no soc thermal changes from Eduardo. The only big change is the introduction of TMON, a tool to help visualize, tune, and test the thermal subsystem. The rest is mostly cleanups and fixes all over. Specifics: - introduce TMON, a tool base on thermal sysfs I/F. It can be used to visualize, tune and test the thermal subsystem. - fix a zone/cooling device binding problem, when both thermal zone bind parameters and .bind() callback are available" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: tools/thermal: Introduce tmon, a tool for thermal subsystem thermal: Fix binding problem when there is thermal zone params thermal: cpu_cooling: fix return value check in cpufreq_cooling_register() Thermal: Check for validity before doing kfree thermal/intel_powerclamp: Add newer CPU models Thermal: Tidy up error handling in powerclamp_init thermal: Kconfig: cosmetic fixes ACPI/thermal : Remove zone disabled warning typo in drivers/thermal/Kconfig: lpatform instead of platform
- Loading branch information
Showing
14 changed files
with
2,216 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
VERSION = 1.0 | ||
|
||
BINDIR=usr/bin | ||
WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int | ||
CFLAGS= -O1 ${WARNFLAGS} -fstack-protector | ||
CC=gcc | ||
|
||
CFLAGS+=-D VERSION=\"$(VERSION)\" | ||
LDFLAGS+= | ||
TARGET=tmon | ||
|
||
INSTALL_PROGRAM=install -m 755 -p | ||
DEL_FILE=rm -f | ||
|
||
INSTALL_CONFIGFILE=install -m 644 -p | ||
CONFIG_FILE= | ||
CONFIG_PATH= | ||
|
||
|
||
OBJS = tmon.o tui.o sysfs.o pid.o | ||
OBJS += | ||
|
||
tmon: $(OBJS) Makefile tmon.h | ||
$(CC) ${CFLAGS} $(LDFLAGS) $(OBJS) -o $(TARGET) -lm -lpanel -lncursesw -lpthread | ||
|
||
valgrind: tmon | ||
sudo valgrind -v --track-origins=yes --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./$(TARGET) 1> /dev/null | ||
|
||
install: | ||
- mkdir -p $(INSTALL_ROOT)/$(BINDIR) | ||
- $(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" | ||
- mkdir -p $(INSTALL_ROOT)/$(CONFIG_PATH) | ||
- $(INSTALL_CONFIGFILE) "$(CONFIG_FILE)" "$(INSTALL_ROOT)/$(CONFIG_PATH)" | ||
|
||
uninstall: | ||
$(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" | ||
$(CONFIG_FILE) "$(CONFIG_PATH)" | ||
|
||
|
||
clean: | ||
find . -name "*.o" | xargs $(DEL_FILE) | ||
rm -f $(TARGET) | ||
|
||
dist: | ||
git tag v$(VERSION) | ||
git archive --format=tar --prefix="$(TARGET)-$(VERSION)/" v$(VERSION) | \ | ||
gzip > $(TARGET)-$(VERSION).tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
TMON - A Monitoring and Testing Tool for Linux kernel thermal subsystem | ||
|
||
Why TMON? | ||
========== | ||
Increasingly, Linux is running on thermally constrained devices. The simple | ||
thermal relationship between processor and fan has become past for modern | ||
computers. | ||
|
||
As hardware vendors cope with the thermal constraints on their products, more | ||
and more sensors are added, new cooling capabilities are introduced. The | ||
complexity of the thermal relationship can grow exponentially among cooling | ||
devices, zones, sensors, and trip points. They can also change dynamically. | ||
|
||
To expose such relationship to the userspace, Linux generic thermal layer | ||
introduced sysfs entry at /sys/class/thermal with a matrix of symbolic | ||
links, trip point bindings, and device instances. To traverse such | ||
matrix by hand is not a trivial task. Testing is also difficult in that | ||
thermal conditions are often exception cases that hard to reach in | ||
normal operations. | ||
|
||
TMON is conceived as a tool to help visualize, tune, and test the | ||
complex thermal subsystem. | ||
|
||
Files | ||
===== | ||
tmon.c : main function for set up and configurations. | ||
tui.c : handles ncurses based user interface | ||
sysfs.c : access to the generic thermal sysfs | ||
pid.c : a proportional-integral-derivative (PID) controller | ||
that can be used for thermal relationship training. | ||
|
||
Requirements | ||
============ | ||
Depends on ncurses | ||
|
||
Build | ||
========= | ||
$ make | ||
$ sudo ./tmon -h | ||
Usage: tmon [OPTION...] | ||
-c, --control cooling device in control | ||
-d, --daemon run as daemon, no TUI | ||
-l, --log log data to /var/tmp/tmon.log | ||
-h, --help show this help message | ||
-t, --time-interval set time interval for sampling | ||
-v, --version show version | ||
-g, --debug debug message in syslog | ||
|
||
1. For monitoring only: | ||
$ sudo ./tmon |
Oops, something went wrong.