Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package powerstat for openSUSE:Factory checked in at 2023-04-21 14:17:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerstat (Old) and /work/SRC/openSUSE:Factory/.powerstat.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerstat" Fri Apr 21 14:17:07 2023 rev:15 rq:1080919 version:0.03.02 Changes: -------- --- /work/SRC/openSUSE:Factory/powerstat/powerstat.changes 2023-01-03 15:05:27.766543974 +0100 +++ /work/SRC/openSUSE:Factory/.powerstat.new.1533/powerstat.changes 2023-04-21 14:17:17.606675517 +0200 @@ -1,0 +2,16 @@ +Sun Apr 16 16:54:07 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 0.03.02: + * Don't account for duplicated RAPL domains, make Watts field + total of all RAPL domains + * Makefile: bump minor version + * Fix spelling mistake "informatiom" -> "information" + * Makefile: use xz compression for dist tarball + * Ignore duplicated power readings from RAPL mmio + * Remove unused variable total_freq + * Add min/max CPU frequencies, calculate CPU freq using + geometric mean + * Remove i915 power measurements + * Add extra errno error information and check for access issues + +------------------------------------------------------------------- Old: ---- V0.02.28.tar.gz New: ---- V0.03.02.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerstat.spec ++++++ --- /var/tmp/diff_new_pack.Su1q47/_old 2023-04-21 14:17:18.094678253 +0200 +++ /var/tmp/diff_new_pack.Su1q47/_new 2023-04-21 14:17:18.098678276 +0200 @@ -18,7 +18,7 @@ Name: powerstat -Version: 0.02.28 +Version: 0.03.02 Release: 0 Summary: Laptop power measuring tool License: GPL-2.0-only ++++++ V0.02.28.tar.gz -> V0.03.02.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.28/Makefile new/powerstat-0.03.02/Makefile --- old/powerstat-0.02.28/Makefile 2022-12-06 14:09:51.000000000 +0100 +++ new/powerstat-0.03.02/Makefile 2023-03-24 11:40:32.000000000 +0100 @@ -1,6 +1,6 @@ # # Copyright (C) 2011-2021 Canonical, Ltd. -# Copyright (C) 2021-2022 Colin Ian King. +# Copyright (C) 2021-2023 Colin Ian King. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -VERSION=0.02.28 +VERSION=0.03.02 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' @@ -47,7 +47,7 @@ mkdir powerstat-$(VERSION) cp -rp Makefile mascot powerstat.c powerstat.8 COPYING snap \ .travis.yml bash-completion README.md powerstat-$(VERSION) - tar -zcf powerstat-$(VERSION).tar.gz powerstat-$(VERSION) + tar -Jcf powerstat-$(VERSION).tar.xz powerstat-$(VERSION) rm -rf powerstat-$(VERSION) clean: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.28/debian/changelog new/powerstat-0.03.02/debian/changelog --- old/powerstat-0.02.28/debian/changelog 2022-12-06 14:09:51.000000000 +0100 +++ new/powerstat-0.03.02/debian/changelog 2023-03-24 11:40:32.000000000 +0100 @@ -1,3 +1,34 @@ +powerstat (0.03.02-1) unstable; urgency=medium + + * Makefile: bump version + * Debian: control: update standards version to 4.6.2 + * Don't account for duplicated RAPL domains, make Watts field total + of all RAPL domains + + -- Colin Ian King <colin.i.k...@gmail.com> Fri, 24 Mar 2023 10:39:11 +0000 + +powerstat (0.03.01-1) unstable; urgency=medium + + * Makefile: bump minor version + * Debain/changelog: fix typos + * Fix spelling mistake "informatiom" -> "information" + * Makefile: use xz compression for dist tarball + * Ignore duplicated power readings from RAPL mmio + + -- Colin Ian King <colin.i.k...@gmail.com> Mon, 30 Jan 2023 15:33:19 +0000 + +powerstat (0.03.00-1) unstable; urgency=medium + + * Manual: update copyright year + * Update manual date + * Makefile: bump version + * Remove unused variable total_freq + * Add min/max CPU frequencies, calculate CPU freq using geometric mean + * Remove i915 power measurements + * Add extra errno error information and check for access issues + + -- Colin Ian King <colin.i.k...@gmail.com> Tue, 24 Jan 2023 09:45:24 +0000 + powerstat (0.02.28-1) unstable; urgency=medium * Makefile: bump version @@ -166,7 +197,7 @@ * snapcraft: add default type and grade keys * snapcraft: Makefile: remove icon hack * reduce the scope of the variable 'buf' - * snapcraft.yaml: remove bogos unnecessary libs + * snapcraft.yaml: remove bogus unnecessary libs * Add snapcraft files * update copyright year @@ -428,7 +459,7 @@ powerstat (0.01.28-1) unstable; urgency=low * Makefile: bump version - * debain/control: update standards version + * debian/control: update standards version * Re-work battery not connected failure message * Add -S option to compute standard average on capacity values * Fix comment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.28/debian/control new/powerstat-0.03.02/debian/control --- old/powerstat-0.02.28/debian/control 2022-12-06 14:09:51.000000000 +0100 +++ new/powerstat-0.03.02/debian/control 2023-03-24 11:40:32.000000000 +0100 @@ -3,7 +3,7 @@ Section: admin Priority: optional Maintainer: Colin Ian King <colin.i.k...@gmail.com> -Standards-Version: 4.6.1 +Standards-Version: 4.6.2 Build-Depends: debhelper (>= 13), debhelper-compat (=13) Homepage: https://github.com/ColinIanKing/powerstat diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.28/powerstat.8 new/powerstat-0.03.02/powerstat.8 --- old/powerstat-0.02.28/powerstat.8 2022-12-06 14:09:51.000000000 +0100 +++ new/powerstat-0.03.02/powerstat.8 2023-03-24 11:40:32.000000000 +0100 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH POWERSTAT 8 "10 November 2021" +.TH POWERSTAT 8 "24 January 2023" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -56,14 +56,10 @@ enable extra power stats showing all the power domain power readings. This currently only applies to the \-R RAPL option. .TP .B \-f -compute an average frequency from all on-line CPU cores. Unfortunately a CPU core is always active to gather any form of stats because +compute the geometric mean of all on-line CPU core frequencies. Unfortunately a CPU core is always active to gather any form of stats because powerstat has to be running to do so, so these statistics are skewed by this. It is best to use this option with a reasonably large delay (more than 5 seconds) between samples to reduce the overhead of powerstat. .TP -.B \-g -show GPU power readings. Currently just Intel i915 is supported and one needs to run powerstat with root privilege to access the -kernel i915 /sys debug interface. -.TP .B \-h show help. .TP @@ -163,7 +159,7 @@ This manual page was written by Colin Ian King <colin.i.k...@gmail.com>, for the Ubuntu project (but may be used by others). .SH COPYRIGHT -Copyright \(co 2011-2021 Canonical Ltd. Copyright \(co 2021-2022 Colin Ian King +Copyright \(co 2011-2021 Canonical Ltd. Copyright \(co 2021-2023 Colin Ian King .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.28/powerstat.c new/powerstat-0.03.02/powerstat.c --- old/powerstat-0.02.28/powerstat.c 2022-12-06 14:09:51.000000000 +0100 +++ new/powerstat-0.03.02/powerstat.c 2023-03-24 11:40:32.000000000 +0100 @@ -1,6 +1,6 @@ /* * Copyright (C) 2011-2021 Canonical - * Copyright (C) 2021-2022 Colin Ian King + * Copyright (C) 2021-2023 Colin Ian King * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Author: Colin Ian King <colin.k...@canonical.com> + * Author: Colin Ian King <colin.i.k...@gmail.com> */ #include <stdlib.h> @@ -104,11 +104,12 @@ CPU_PROCS_RUN, CPU_PROCS_BLK, CPU_FREQ, + CPU_FREQ_MIN, + CPU_FREQ_MAX, PROC_FORK, PROC_EXEC, PROC_EXIT, POWER_TOTAL, - POWER_GPU, POWER_DOMAIN_0, THERMAL_ZONE_0 = POWER_DOMAIN_0 + MAX_POWER_DOMAINS, MAX_VALUES = THERMAL_ZONE_0 + MAX_THERMAL_ZONES, @@ -190,7 +191,6 @@ #define OPTS_CPU_FREQ (0x1000) /* Average CPU frequency */ #define OPTS_NO_STATS_HEADINGS (0x2000) /* No stats headings */ #define OPTS_THERMAL_ZONE (0x4000) /* Thermal zones */ -#define OPTS_GPU (0x8000) /* graphics */ #define OPTS_USE_NETLINK (OPTS_SHOW_PROC_ACTIVITY | \ OPTS_REDO_NETLINK_BUSY | \ @@ -249,7 +249,6 @@ double max_energy_uj; /* Energy in micro Joules */ double last_energy_uj; /* Last energy reading in micro Joules */ double t_last; /* Time of last reading */ - bool is_package; /* Is it a package? */ } rapl_info_t; /* Thermal zone info */ @@ -791,7 +790,9 @@ { struct dirent **cpu_list = NULL; int i, n_cpus, n = 0; - double total_freq = 0; + double freq_min = 1E12, freq_max = 0.0; + double mant = 1.0; /* geometric mean mantissa */ + long int expon = 0; /* goemetric mean exponent */ n_cpus = scandir("/sys/devices/system/cpu", &cpu_list, NULL, alphasort); for (i = 0; i < n_cpus; i++) { @@ -805,7 +806,17 @@ "/sys/devices/system/cpu/%s/cpufreq/scaling_cur_freq", name); if (file_get_uint64(path, &freq) == 0) { - total_freq += (double)freq / 1000.0; /* In MHz */ + int e; + const double freq_mhz = (double)freq / 1000.0; + const double f = frexp(freq_mhz, &e); + + mant *= f; + expon += e; + + if (freq_mhz > freq_max) + freq_max = freq_mhz; + if (freq_mhz < freq_min) + freq_min = freq_mhz; n++; } } @@ -814,10 +825,18 @@ if (n_cpus > -1) free(cpu_list); - if (n) - stats->value[CPU_FREQ] = total_freq / n; - else - stats->value[CPU_FREQ] = 0; + if (n) { + const double inverse_n = 1.0 / (double)n; + const double geomean = pow(mant, inverse_n) * pow(2.0, (double)expon * inverse_n); + + stats->value[CPU_FREQ] = geomean; + stats->value[CPU_FREQ_MIN] = freq_min; + stats->value[CPU_FREQ_MAX] = freq_max; + } else { + stats->value[CPU_FREQ] = 0.0; + stats->value[CPU_FREQ_MIN] = 0.0; + stats->value[CPU_FREQ_MAX] = 0.0; + } } /* @@ -969,6 +988,8 @@ res->value[CPU_PROCS_RUN] = s2->inaccurate[CPU_PROCS_RUN] ? NAN : s2->value[CPU_PROCS_RUN]; res->value[CPU_PROCS_BLK] = s2->inaccurate[CPU_PROCS_BLK] ? NAN : s2->value[CPU_PROCS_BLK]; res->value[CPU_FREQ] = s2->value[CPU_FREQ]; + res->value[CPU_FREQ_MIN] = s2->value[CPU_FREQ_MIN]; + res->value[CPU_FREQ_MAX] = s2->value[CPU_FREQ_MAX]; return true; } @@ -988,10 +1009,9 @@ if (opts & (OPTS_DOMAIN_STATS | OPTS_THERMAL_ZONE | - OPTS_CPU_FREQ | - OPTS_GPU)) + OPTS_CPU_FREQ)) (void)putchar(' '); - + if (opts & OPTS_DOMAIN_STATS) { for (i = 0; i < power_domains; i++) (void)printf(" %6.6s", @@ -1002,9 +1022,7 @@ (void)printf(" %6.6s", tz_get_type(i)); } if (opts & OPTS_CPU_FREQ) - (void)printf(" %9.9s", "CPU Freq"); - if (opts & OPTS_GPU) - (void)printf(" %6.6s", "GPU W"); + (void)printf(" %9.9s %9.9s %9.9s", "CPU Freq", "Freq Min", "Freq Max"); (void)printf("\n"); } @@ -1031,8 +1049,6 @@ } if (opts & OPTS_CPU_FREQ) (void)printf(" ---------"); - if (opts & OPTS_GPU) - (void)printf(" ------"); (void)printf("\n"); } @@ -1113,13 +1129,10 @@ for (i = 0; i < thermal_zones; i++) (void)printf(" %6.2f", s->value[THERMAL_ZONE_0 + i]); } - if (opts & OPTS_CPU_FREQ) + if (opts & OPTS_CPU_FREQ) { (void)printf(" %s", cpu_freq_format(s->value[CPU_FREQ])); - if (opts & OPTS_GPU) { - if (s->inaccurate[POWER_GPU]) - (void)printf(" -N/A-"); - else - (void)printf(" %6.2f", s->value[POWER_GPU]); + (void)printf(" %s", cpu_freq_format(s->value[CPU_FREQ_MIN])); + (void)printf(" %s", cpu_freq_format(s->value[CPU_FREQ_MAX])); } (void)printf("\n"); } @@ -1157,7 +1170,7 @@ if (stats[i].value[j] < min->value[j]) min->value[j] = stats[i].value[j]; total += stats[i].value[j]; - + f = frexp(stats[i].value[j], &e); mant *= f; expon += e; @@ -1167,7 +1180,7 @@ if (valid) { double inverse_n = 1.0 / (double)valid; - geometric_mean->value[j] = pow(mant, inverse_n) * + geometric_mean->value[j] = pow(mant, inverse_n) * pow(2.0, (double)expon / (double)valid); average->value[j] = total / (double)valid; total = 0.0; @@ -1414,9 +1427,9 @@ *discharging = false; if ((dir = opendir(SYS_CLASS_POWER_SUPPLY)) == NULL) { - (void)fprintf(stderr, "Device does not have %s, " + (void)fprintf(stderr, "Device does not have %s, errno=%d (%s), " "cannot run the test.\n", - SYS_CLASS_POWER_SUPPLY); + SYS_CLASS_POWER_SUPPLY, errno, strerror(errno)); return -1; } @@ -1547,9 +1560,9 @@ *discharging = false; if ((dir = opendir(PROC_ACPI_BATTERY)) == NULL) { - (void)fprintf(stderr, "Device does not have %s, " + (void)fprintf(stderr, "Device does not have %s, errno=%d (%s), " "cannot run the test.\n", - PROC_ACPI_BATTERY); + PROC_ACPI_BATTERY, errno, strerror(errno)); return -1; } @@ -1692,19 +1705,27 @@ for (i = 0; i < n && rapl; i++) { rapl = rapl->next; } - if (rapl) { - if (rapl->is_package) { - static char buf[128]; - - (void)snprintf(buf, sizeof(buf), "pkg-%s", rapl->domain_name + 8); - return buf; - } + if (rapl) return rapl->domain_name; - } return "unknown"; } /* + * rapl_domain_unique() + * returns true if domain_name is not in rapl_list + */ +static bool rapl_domain_unique(const char *domain_name) +{ + rapl_info_t *rapl; + + for (rapl = rapl_list; rapl; rapl = rapl->next) { + if (!strcmp(rapl->domain_name, domain_name)) + return false; + } + return true; +} + +/* * rapl_get_domains() */ static int rapl_get_domains(void) @@ -1715,7 +1736,8 @@ dir = opendir("/sys/class/powercap"); if (dir == NULL) { - (void)printf("Device does not have RAPL, cannot measure power usage.\n"); + (void)printf("Device does not have RAPL, cannot measure power usage, errno=%d (%s).\n", + errno, strerror(errno)); return -1; } @@ -1724,6 +1746,8 @@ FILE *fp; rapl_info_t *rapl; + printf("powercap: %s\n", entry->d_name); + /* Ignore non Intel RAPL interfaces */ if (strncmp(entry->d_name, "intel-rapl", 10)) continue; @@ -1759,17 +1783,27 @@ if (fgets(domain_name, sizeof(domain_name), fp) != NULL) { domain_name[strcspn(domain_name, "\n")] = '\0'; - rapl->domain_name = strdup(domain_name); + + /* Truncate package name */ + if (!strncmp(domain_name, "package-", 8)) { + char buf[sizeof(domain_name)]; + + (void)snprintf(buf, sizeof(buf), "pkg-%s", domain_name + 8); + strlcpy(domain_name, buf, sizeof(domain_name)); + } + + if (rapl_domain_unique(domain_name)) + rapl->domain_name = strdup(domain_name); } (void)fclose(fp); } + if (rapl->domain_name == NULL) { free(rapl->name); free(rapl); continue; } - rapl->is_package = (strncmp(rapl->domain_name, "package-", 8) == 0); rapl->next = rapl_list; rapl_list = rapl; n++; @@ -1778,7 +1812,7 @@ power_domains = MIN(n, MAX_POWER_DOMAINS); if (!n) - (void)printf("Device does not have any RAPL domains, cannot power measure power usage.\n"); + (void)printf("Device does not have any RAPL domains, cannot power measure power usage\n"); return n; } @@ -1818,7 +1852,7 @@ /* * power_get_rapl() - * get power discharge rate from battery via the RAPL interface + * get power discharge rate from system via the RAPL interface */ static int power_get_rapl( stats_t *stats, @@ -1833,6 +1867,7 @@ stats->value[POWER_TOTAL] = 0.0; get_domain = rapl_get_domain; *discharging = false; + bool access_failure = false; t_now = gettime_to_double(); @@ -1845,8 +1880,11 @@ "/sys/class/powercap/%s/energy_uj", rapl->name); - if ((fp = fopen(path, "r")) == NULL) + if ((fp = fopen(path, "r")) == NULL) { + if ((errno == EPERM) || (errno == EACCES)) + access_failure = true; continue; + } if (fscanf(fp, "%lf\n", &ujoules) == 1) { double t_delta = t_now - rapl->t_last; @@ -1870,8 +1908,9 @@ (ujoules - last_energy_uj) / (t_delta * 1000000.0); stats->inaccurate[POWER_DOMAIN_0 + n] = false; } - if (rapl->is_package && !stats->inaccurate[POWER_DOMAIN_0 + n]) + if (!stats->inaccurate[POWER_DOMAIN_0 + n]) { stats->value[POWER_TOTAL] += stats->value[POWER_DOMAIN_0 + n]; + } n++; *discharging = true; } @@ -1888,8 +1927,12 @@ *discharging = true; /* Lie */ return 0; } - (void)printf("Device does not have any RAPL domains, cannot power measure power usage.\n"); - (void)printf("Force powerstat to run without RAPL by using the -z option\n"); + if (access_failure) { + (void)printf("Cannot access RAPL domain energy information, try running with root permission.\n"); + } else { + (void)printf("Device does not have any RAPL domains, cannot power measure power usage.\n"); + (void)printf("Force powerstat to run without RAPL by using the -z option\n"); + } return -1; } return 0; @@ -1897,65 +1940,6 @@ #endif /* - * power_get_gpu_i915() - * get Intel i915 GPU power stats - * - * interface was removed from Linux 5.5 i915 driver by the commit: - * - * commit 6311d260a1794d8ccef0ac8b39405fea0e1d9474 - * Author: Tvrtko Ursulin <tvrtko.ursu...@intel.com> - * Date: Thu Feb 6 14:07:25 2020 +0000 - * drm/i915/debugfs: Remove i915_energy_uJ - * - */ -static int power_get_gpu_i915( - const stats_t *const s1, - stats_t *s2, - stats_t *const res) -{ -#if defined(POWERSTAT_X86) - uint64_t val; - int ret; - - if (file_get_uint64(I915_ENERGY_UJ, &val) < 0) { - s2->value[POWER_GPU] = 0.0; - res->value[POWER_GPU] = 0.0; - res->inaccurate[POWER_GPU] = true; - ret = -1; - } else { - s2->value[POWER_GPU] = ((double)val / 1000000.0) / sample_delay; - s2->inaccurate[POWER_GPU] = false; - res->inaccurate[POWER_GPU] = false; - res->value[POWER_GPU] = stats_sane(s1, s2, POWER_GPU); - ret = 0; - } - return ret; -#else - (void)s1; - (void)s2; - (void)res; - - return -1; -#endif -} - -/* - * power_get_gpu() - * get generic GPU power stats - */ -static void power_get_gpu( - const stats_t *const s1, - stats_t *s2, - stats_t *const res) -{ - if (power_get_gpu_i915(s1, s2, res) < 0) { - s2->value[POWER_GPU] = 0.0; - res->value[POWER_GPU] = 0.0; - res->inaccurate[POWER_GPU] = true; - } -} - -/* * tz_free_list() * free thermal zone list */ @@ -2629,8 +2613,6 @@ if (opts & OPTS_CSTATES) cpu_states_update(); - if (opts & OPTS_GPU) - power_get_gpu(&s2, &s1, &stats[readings]); while (!stop_recv && (readings < max_readings)) { double time_now, secs; @@ -2726,9 +2708,6 @@ if (opts & OPTS_THERMAL_ZONE) tz_get_temperature(&stats[readings]); - if (opts & OPTS_GPU) - power_get_gpu(&s1, &s2, &stats[readings]); - if (!discharging) { free(stats); return -1; /* No longer discharging! */ @@ -2869,10 +2848,6 @@ (void)printf("System: %6.2f Watts on average with standard deviation %-6.2f\n", average.value[POWER_TOTAL], stddev.value[POWER_TOTAL]); } - if (opts & OPTS_GPU) { - (void)printf("GPU: %6.2f Watts on average with standard deviation %-6.2f\n", - average.value[POWER_GPU], stddev.value[POWER_GPU]); - } #if defined(POWERSTAT_X86) if (opts & OPTS_RAPL) { @@ -2946,7 +2921,6 @@ (void)printf("\t-d specify delay before starting, default is %" PRId32 " seconds\n", start_delay); (void)printf("\t-D show RAPL domain power measurements (enables -R option)\n"); (void)printf("\t-f show average CPU frequency\n"); - (void)printf("\t-g show GPU power (currently just i915)\n"); (void)printf("\t-h show help\n"); (void)printf("\t-H show spread of measurements with power histogram\n"); (void)printf("\t-i specify CPU idle threshold, used in conjunction with -b\n"); @@ -2977,9 +2951,9 @@ for (;;) { #if defined(POWERSTAT_X86) - int c = getopt(argc, argv, "abd:cDfghHi:nprszStR"); + int c = getopt(argc, argv, "abd:cDfhHi:nprszStR"); #else - int c = getopt(argc, argv, "abd:cDfghHi:nprszSt"); + int c = getopt(argc, argv, "abd:cDfhHi:nprszSt"); #endif if (c == -1) break; @@ -2989,8 +2963,6 @@ OPTS_CPU_FREQ | OPTS_HISTOGRAM | OPTS_THERMAL_ZONE); - if (opts & OPTS_ROOT_PRIV) - opts |= OPTS_GPU; break; case 'b': opts |= OPTS_REDO_WHEN_NOT_IDLE; @@ -3017,9 +2989,6 @@ case 'f': opts |= OPTS_CPU_FREQ; break; - case 'g': - opts |= OPTS_GPU; - break; case 'h': show_help(argv); exit(EXIT_SUCCESS); @@ -3127,8 +3096,8 @@ (void)fprintf(stderr, "Number of readings low, results may be inaccurate.\n"); if (!(opts & OPTS_ROOT_PRIV) && - (opts & (OPTS_USE_NETLINK | OPTS_GPU))) { - (void)fprintf(stderr, "%s needs to be run with root privilege when using -g, -p, -r, -s options.\n", argv[0]); + (opts & (OPTS_USE_NETLINK))) { + (void)fprintf(stderr, "%s needs to be run with root privilege when using -p, -r, -s options.\n", argv[0]); exit(ret); }