Hello community, here is the log from the commit of package tmon for openSUSE:Factory checked in at 2018-04-19 15:29:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/tmon (Old) and /work/SRC/openSUSE:Factory/.tmon.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tmon" Thu Apr 19 15:29:40 2018 rev:4 rq:597356 version:1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/tmon/tmon.changes 2017-10-07 17:52:46.361746005 +0200 +++ /work/SRC/openSUSE:Factory/.tmon.new/tmon.changes 2018-04-19 15:29:41.830542746 +0200 @@ -1,0 +2,14 @@ +Tue Apr 17 08:19:00 UTC 2018 - tchva...@suse.com + +- Format with spec-cleaner +- Update URL to point out to the real location in kernel for easier + understanding + +------------------------------------------------------------------- +Mon Apr 16 12:07:19 UTC 2018 - josef.moell...@suse.com + +- Backported a patch from upstream to prevent a race condition + wrt "cur_thermal_record". + [bsc#1075156, prevent-cur_thermal_record_race.patch] + +------------------------------------------------------------------- New: ---- prevent-cur_thermal_record_race.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tmon.spec ++++++ --- /var/tmp/diff_new_pack.Uh2dpd/_old 2018-04-19 15:29:42.406519151 +0200 +++ /var/tmp/diff_new_pack.Uh2dpd/_new 2018-04-19 15:29:42.410518987 +0200 @@ -1,8 +1,7 @@ # # spec file for package tmon # -# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany. -# Author: Thomas Renninger <tr...@suse.com> +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,33 +21,33 @@ Version: 1.0 Release: 0 Summary: A Monitoring and Testing Tool for Linux kernel thermal subsystem -License: GPL-2.0 +License: GPL-2.0-only Group: System/Base -Url: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git +URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/thermal/tmon Source: %{name}-%{version}.tar.bz2 Patch1: tmon_pkg_config_ncurses_missing.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Patch2: prevent-cur_thermal_record_race.patch BuildRequires: ncurses-devel -BuildRequires: pkg-config +BuildRequires: pkgconfig %description This tool is conceived as a tool to help visualize, tune, and test the complex thermal subsystem. %prep -%setup +%setup -q %patch1 -p1 +%patch2 -p1 %build -CFLAGS="%optflags" make %{?_smp_mflags} +CFLAGS="%{optflags}" make %{?_smp_mflags} %install -make install INSTALL_ROOT=$RPM_BUILD_ROOT -install -D -m 644 tmon.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/tmon.8 +make install INSTALL_ROOT=%{buildroot} +install -D -m 644 tmon.8 %{buildroot}%{_mandir}/man8/tmon.8 %files -%defattr (-,root,root) %{_bindir}/tmon -%{_mandir}/man8/tmon* +%{_mandir}/man8/tmon.8%{?ext_man} %changelog ++++++ prevent-cur_thermal_record_race.patch ++++++ Index: tmon-1.0/sysfs.c =================================================================== --- tmon-1.0.orig/sysfs.c +++ tmon-1.0/sysfs.c @@ -486,6 +486,7 @@ int zone_instance_to_index(int zone_inst int update_thermal_data() { int i; + int next_thermal_record = cur_thermal_record + 1; char tz_name[256]; static unsigned long samples; @@ -495,9 +496,9 @@ int update_thermal_data() } /* circular buffer for keeping historic data */ - if (cur_thermal_record >= NR_THERMAL_RECORDS) - cur_thermal_record = 0; - gettimeofday(&trec[cur_thermal_record].tv, NULL); + if (next_thermal_record >= NR_THERMAL_RECORDS) + next_thermal_record = 0; + gettimeofday(&trec[next_thermal_record].tv, NULL); if (tmon_log) { fprintf(tmon_log, "%lu ", ++samples); fprintf(tmon_log, "%3.1f ", p_param.t_target); @@ -507,11 +508,12 @@ int update_thermal_data() snprintf(tz_name, 256, "%s/%s%d", THERMAL_SYSFS, TZONE, ptdata.tzi[i].instance); sysfs_get_ulong(tz_name, "temp", - &trec[cur_thermal_record].temp[i]); + &trec[next_thermal_record].temp[i]); if (tmon_log) fprintf(tmon_log, "%lu ", - trec[cur_thermal_record].temp[i]/1000); + trec[next_thermal_record].temp[i] / 1000); } + cur_thermal_record = next_thermal_record; for (i = 0; i < ptdata.nr_cooling_dev; i++) { char cdev_name[256]; unsigned long val; Index: tmon-1.0/tmon.c =================================================================== --- tmon-1.0.orig/tmon.c +++ tmon-1.0/tmon.c @@ -336,7 +336,6 @@ int main(int argc, char **argv) show_data_w(); show_cooling_device(); } - cur_thermal_record++; time_elapsed += ticktime; controller_handler(trec[0].temp[target_tz_index] / 1000, &yk);