summaryrefslogtreecommitdiff
path: root/app-benchmarks/i7z/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-benchmarks/i7z/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-benchmarks/i7z/files')
-rw-r--r--app-benchmarks/i7z/files/fix-insecure-tempfile.patch76
-rw-r--r--app-benchmarks/i7z/files/fix_cpuid_asm.patch21
-rw-r--r--app-benchmarks/i7z/files/gcc5.patch40
-rw-r--r--app-benchmarks/i7z/files/hyphen-used-as-minus-sign.patch26
-rw-r--r--app-benchmarks/i7z/files/i7z-0.27.2-ncurses.patch22
-rw-r--r--app-benchmarks/i7z/files/install-i7z_rw_registers.patch26
-rw-r--r--app-benchmarks/i7z/files/nehalem.patch15
-rw-r--r--app-benchmarks/i7z/files/qt5.patch13
-rw-r--r--app-benchmarks/i7z/files/use_stdbool.patch40
9 files changed, 279 insertions, 0 deletions
diff --git a/app-benchmarks/i7z/files/fix-insecure-tempfile.patch b/app-benchmarks/i7z/files/fix-insecure-tempfile.patch
new file mode 100644
index 000000000000..fb027158434b
--- /dev/null
+++ b/app-benchmarks/i7z/files/fix-insecure-tempfile.patch
@@ -0,0 +1,76 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: fix insecure temfile usage: /tmp/cpufreq.txt
+ switch from system() + fopen() to popen()
+ disable other insecure tempfiles that may be generated but not used
+Bug-Debian: http://bugs.debian.org/718418
+
+diff --git a/GUI/i7z_GUI.cpp b/GUI/i7z_GUI.cpp
+index 2705e84..60eaeb2 100644
+--- a/GUI/i7z_GUI.cpp
++++ b/GUI/i7z_GUI.cpp
+@@ -171,18 +171,17 @@ MyThread::run ()
+ //CPUINFO is wrong for i7 but correct for the number of physical and logical cores present
+ //If Hyperthreading is enabled then, multiple logical processors will share a common CORE ID
+ //http://www.redhat.com/magazine/022aug06/departments/tips_tricks/
+- system ("cat /proc/cpuinfo |grep MHz|sed 's/cpu\\sMHz\\s*:\\s//'|tail -n 1 > /tmp/cpufreq.txt");
+- system ("grep \"core id\" /proc/cpuinfo |sort -|uniq -|wc -l > /tmp/numPhysical.txt");
+- system ("grep \"processor\" /proc/cpuinfo |sort -|uniq -|wc -l > /tmp/numLogical.txt");
++ //system ("grep \"core id\" /proc/cpuinfo |sort -|uniq -|wc -l > /tmp/numPhysical.txt");
++ //system ("grep \"processor\" /proc/cpuinfo |sort -|uniq -|wc -l > /tmp/numLogical.txt");
+
+
+- //Open the parsed cpufreq file and obtain the cpufreq from /proc/cpuinfo
++ // obtain the cpufreq from /proc/cpuinfo
+ FILE *tmp_file;
+- tmp_file = fopen ("/tmp/cpufreq.txt", "r");
++ tmp_file = popen ("sed -n '/MHz/ { s/cpu\\sMHz\\s*:\\s//p; q }' /proc/cpuinfo", "r");
+ char tmp_str[30];
+ fgets (tmp_str, 30, tmp_file);
++ pclose (tmp_file);
+ double cpu_freq_cpuinfo = atof (tmp_str);
+- fclose (tmp_file);
+
+ unsigned int numPhysicalCores, numLogicalCores;
+ numPhysicalCores = socket_0.num_physical_cores + socket_1.num_physical_cores;
+diff --git a/helper_functions.c b/helper_functions.c
+index 2f8da87..906c298 100644
+--- a/helper_functions.c
++++ b/helper_functions.c
+@@ -531,16 +531,13 @@ double cpufreq_info()
+ //CPUINFO is wrong for i7 but correct for the number of physical and logical cores present
+ //If Hyperthreading is enabled then, multiple logical processors will share a common CORE ID
+ //http://www.redhat.com/magazine/022aug06/departments/tips_tricks/
+- system
+- ("cat /proc/cpuinfo |grep MHz|sed 's/cpu\\sMHz\\s*:\\s//'|tail -n 1 > /tmp/cpufreq.txt");
+
+-
+- //Open the parsed cpufreq file and obtain the cpufreq from /proc/cpuinfo
++ // obtain the cpufreq from /proc/cpuinfo
+ FILE *tmp_file;
+- tmp_file = fopen ("/tmp/cpufreq.txt", "r");
++ tmp_file = popen ("sed -n '/MHz/ { s/cpu\\sMHz\\s*:\\s//p; q }' /proc/cpuinfo", "r");
+ char tmp_str[30];
+ fgets (tmp_str, 30, tmp_file);
+- fclose (tmp_file);
++ pclose (tmp_file);
+ return atof(tmp_str);
+ }
+
+diff --git a/i7z_Single_Socket.c b/i7z_Single_Socket.c
+index 015f154..d0afee0 100644
+--- a/i7z_Single_Socket.c
++++ b/i7z_Single_Socket.c
+@@ -823,10 +823,13 @@ void print_i7z_single ()
+ //CPUINFO is wrong for i7 but correct for the number of physical and logical cores present
+ //If Hyperthreading is enabled then, multiple logical processors will share a common CORE ID
+ //http://www.redhat.com/magazine/022aug06/departments/tips_tricks/
++ERROR INSECURE TMPFILE
+ system
+ ("cat /proc/cpuinfo |grep MHz|sed 's/cpu\\sMHz\\s*:\\s//'|tail -n 1 > /tmp/cpufreq.txt");
++ERROR INSECURE TMPFILE
+ system
+ ("grep \"core id\" /proc/cpuinfo |sort -|uniq -|wc -l > /tmp/numPhysical.txt");
++ERROR INSECURE TMPFILE
+ system
+ ("grep \"processor\" /proc/cpuinfo |sort -|uniq -|wc -l > /tmp/numLogical.txt");
+ //At this step, /tmp/numPhysical contains number of physical cores in machine and
diff --git a/app-benchmarks/i7z/files/fix_cpuid_asm.patch b/app-benchmarks/i7z/files/fix_cpuid_asm.patch
new file mode 100644
index 000000000000..27739a64523e
--- /dev/null
+++ b/app-benchmarks/i7z/files/fix_cpuid_asm.patch
@@ -0,0 +1,21 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: fix cpuid inline assembly
+ the old code zeroed the upper half of %rbx
+
+--- a/helper_functions.c
++++ b/helper_functions.c
+@@ -101,13 +101,7 @@ static inline void cpuid (unsigned int i
+ unsigned int *ecx, unsigned int *edx)
+ {
+ unsigned int _eax = info, _ebx, _ecx, _edx;
+- asm volatile ("mov %%ebx, %%edi;" // save ebx (for PIC)
+- "cpuid;"
+- "mov %%ebx, %%esi;" // pass to caller
+- "mov %%edi, %%ebx;" // restore ebx
+- :"+a" (_eax), "=S" (_ebx), "=c" (_ecx), "=d" (_edx)
+- : /* inputs: eax is handled above */
+- :"edi" /* clobbers: we hit edi directly */);
++ asm volatile ("cpuid\n\t" : "+a" (_eax), "=b" (_ebx), "=c" (_ecx), "=d" (_edx) : : );
+ if (eax) *eax = _eax;
+ if (ebx) *ebx = _ebx;
+ if (ecx) *ecx = _ecx;
diff --git a/app-benchmarks/i7z/files/gcc5.patch b/app-benchmarks/i7z/files/gcc5.patch
new file mode 100644
index 000000000000..dd3ed99a1c7b
--- /dev/null
+++ b/app-benchmarks/i7z/files/gcc5.patch
@@ -0,0 +1,40 @@
+diff -Nuar i7z-5023138d7c35c4667c938b853e5ea89737334e92/GUI/i7z_GUI.cpp
+i7z-5023138d7c35c4667c938b853e5ea89737334e92-fixed/GUI/i7z_GUI.cpp
+--- i7z-5023138d7c35c4667c938b853e5ea89737334e92/GUI/i7z_GUI.cpp 2013-10-12 20:59:19.000000000 +0000
++++ i7z-5023138d7c35c4667c938b853e5ea89737334e92-fixed/GUI/i7z_GUI.cpp 2017-03-06 18:27:54.825756111 +0000
+@@ -16,7 +16,7 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <time.h>
+-#include <math.h>
++#include <cmath>
+
+ #include <QApplication>
+ #include <QPushButton>
+@@ -382,7 +382,7 @@
+
+ //C1_time[i] -= C3_time[i] + C6_time[i];
+ C1_time[i] = c1_time - (C3_time[i] + C6_time[i]) ;
+- if (!isnan(c1_time) && !isinf(c1_time)) {
++ if (!std::isnan(c1_time) && !std::isinf(c1_time)) {
+ if (C1_time[i] <= 0) {
+ C1_time[i]=0;
+ }
+@@ -642,13 +642,13 @@
+
+ for (i = 0; i < (int)numCPUs; i++)
+ {
+- if ( (mythread->FREQ[i] > Max_Freq_socket0) && (!isnan(mythread->FREQ[i])) &&
+- (!isinf(mythread->FREQ[i])) && (socket_list[i] == socket_0.socket_num) ) {
++ if ( (mythread->FREQ[i] > Max_Freq_socket0) && (!std::isnan(mythread->FREQ[i])) &&
++ (!std::isinf(mythread->FREQ[i])) && (socket_list[i] == socket_0.socket_num) ) {
+ Max_Freq_socket0 = mythread->FREQ[i];
+ num_socket0_cpus++;
+ }
+- if ( (mythread->FREQ[i] > Max_Freq_socket1) && (!isnan(mythread->FREQ[i])) &&
+- (!isinf(mythread->FREQ[i])) && (socket_list[i] == socket_1.socket_num) ) {
++ if ( (mythread->FREQ[i] > Max_Freq_socket1) && (!std::isnan(mythread->FREQ[i])) &&
++ (!std::isinf(mythread->FREQ[i])) && (socket_list[i] == socket_1.socket_num) ) {
+ Max_Freq_socket1 = mythread->FREQ[i];
+ num_socket1_cpus++;
+ }
diff --git a/app-benchmarks/i7z/files/hyphen-used-as-minus-sign.patch b/app-benchmarks/i7z/files/hyphen-used-as-minus-sign.patch
new file mode 100644
index 000000000000..f908b934621e
--- /dev/null
+++ b/app-benchmarks/i7z/files/hyphen-used-as-minus-sign.patch
@@ -0,0 +1,26 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: fix hyphen abuse
+
+--- a/doc/i7z.man
++++ b/doc/i7z.man
+@@ -7,15 +7,15 @@
+ i7z runs the i7z, ncurses based, program without any options. i7z will print out the C-states and temperature for i3, i5 and i7 based Core processors from Intel (including Nehalems, Sandy Bridge and Ivy Bridge).
+ .SH OPTIONS
+ .TP
+-\fB-h, --help \fPshow the list of options available with the i7z tool.
++\fB\-h, \-\-help \fPshow the list of options available with the i7z tool.
+ .TP
+-\fB-w [a|l], --write [a,l] \fPLogging of the frequencies can be turned on with this options. Option "-w a" or "--write a" will append to the log file. Option "-w l" or "--write l" will replace the log file.
++\fB\-w [a|l], \-\-write [a,l] \fPLogging of the frequencies can be turned on with this options. Option "\-w a" or "\-\-write a" will append to the log file. Option "\-w l" or "\-\-write l" will replace the log file.
+ .TP
+-\fB-l, --logfile [FILENAME] \fPChange the log file name to the specified FILENAME. Default logging file is cpu_freq_log.txt (single socket) or cpu_freq_log_dual%d.txt (dual socket, %d is either 0, 1).
++\fB\-l, \-\-logfile [FILENAME] \fPChange the log file name to the specified FILENAME. Default logging file is cpu_freq_log.txt (single socket) or cpu_freq_log_dual%d.txt (dual socket, %d is either 0, 1).
+ .TP
+-\fB--socket0 [SOCKETNUM], --socket1 [SOCKETNUM] \fPThe tool can print information for about 2 sockets at once at the most. The top view will be, by default, of the first socket (controlled by --socket0) and the bottom view will be of the second socket (controlled by --socket1). Supply the appropriate value of 0 or 1 or more for SOCKETNUM (if there are more sockets on the machine) to show in the top and bottom view.
++\fB\-\-socket0 [SOCKETNUM], \-\-socket1 [SOCKETNUM] \fPThe tool can print information for about 2 sockets at once at the most. The top view will be, by default, of the first socket (controlled by \-\-socket0) and the bottom view will be of the second socket (controlled by \-\-socket1). Supply the appropriate value of 0 or 1 or more for SOCKETNUM (if there are more sockets on the machine) to show in the top and bottom view.
+ .TP
+-\fB--nogui \fPDisable the GUI. Useful when the only need is logging.
++\fB\-\-nogui \fPDisable the GUI. Useful when the only need is logging.
+ .SH Example
+ To print for two sockets and also change the log file (log to /tmp/logfilei7z)
+
diff --git a/app-benchmarks/i7z/files/i7z-0.27.2-ncurses.patch b/app-benchmarks/i7z/files/i7z-0.27.2-ncurses.patch
new file mode 100644
index 000000000000..72695a951f7e
--- /dev/null
+++ b/app-benchmarks/i7z/files/i7z-0.27.2-ncurses.patch
@@ -0,0 +1,22 @@
+Index: Makefile
+===================================================================
+--- a/Makefile (revision 109)
++++ b/Makefile (working copy)
+@@ -19,7 +19,7 @@
+
+ CC ?= gcc
+
+-LIBS += -lncurses -lpthread -lrt -lm
++LIBS += `pkg-config --libs ncurses` -lpthread -lrt -lm
+ INCLUDEFLAGS =
+
+ BIN = i7z
+@@ -42,7 +42,7 @@
+
+ #http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=644728 for -ltinfo on debian
+ static-bin: message $(OBJ)
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) $(OBJ) -static-libgcc -DNCURSES_STATIC -static -lpthread -lncurses -lrt -lm -ltinfo
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) $(OBJ) -static-libgcc -DNCURSES_STATIC -static -lpthread `pkg-config --static --libs ncurses` -lrt -lm
+
+ # perfmon-bin: message $(OBJ)
+ # $(CC) $(CFLAGS) $(LDFLAGS) -o $(PERFMON-BIN) perfmon-i7z.c helper_functions.c $(LIBS)
diff --git a/app-benchmarks/i7z/files/install-i7z_rw_registers.patch b/app-benchmarks/i7z/files/install-i7z_rw_registers.patch
new file mode 100644
index 000000000000..65c36e9a26f6
--- /dev/null
+++ b/app-benchmarks/i7z/files/install-i7z_rw_registers.patch
@@ -0,0 +1,26 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: install the i7z_rw_registers script and fix the hashbang
+
+--- a/i7z_rw_registers.rb
++++ b/i7z_rw_registers.rb
+@@ -1,3 +1,5 @@
++#!/usr/bin/ruby
++
+ #* ----------------------------------------------------------------------- *
+ # *
+ # * Under GPL v3
+@@ -7,7 +9,6 @@
+ # *
+ # * ----------------------------------------------------------------------- */
+
+-#!/usr/bin/ruby
+
+ def print_command_list()
+ print "Do you need help? \n"
+--- a/Makefile
++++ b/Makefile
+@@ -61,3 +61,4 @@
+ install -D -m 755 $(BIN) $(DESTDIR)$(sbindir)$(BIN)
+ install -d $(DESTDIR)$(docdir)
+ install -m 0644 README.txt put_cores_offline.sh put_cores_online.sh MAKEDEV-cpuid-msr $(DESTDIR)$(docdir)
++ install -m 0755 i7z_rw_registers.rb $(DESTDIR)$(sbindir)/i7z_rw_registers
diff --git a/app-benchmarks/i7z/files/nehalem.patch b/app-benchmarks/i7z/files/nehalem.patch
new file mode 100644
index 000000000000..c1b5639779a9
--- /dev/null
+++ b/app-benchmarks/i7z/files/nehalem.patch
@@ -0,0 +1,15 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: fix some nehalem detected as haswell, too
+Bug-Debian: https://bugs.debian.org/856806
+
+--- a/helper_functions.c
++++ b/helper_functions.c
+@@ -420,7 +420,7 @@ void Print_Information_Processor(bool* n
+ *nehalem = true;
+ *sandy_bridge = false;
+ *ivy_bridge = false;
+- *haswell = true;
++ *haswell = false;
+
+ } else if (proc_info.extended_model == 0x2) {
+ switch (proc_info.model)
diff --git a/app-benchmarks/i7z/files/qt5.patch b/app-benchmarks/i7z/files/qt5.patch
new file mode 100644
index 000000000000..9e9b162d9e85
--- /dev/null
+++ b/app-benchmarks/i7z/files/qt5.patch
@@ -0,0 +1,13 @@
+diff -Naur a/GUI/i7z_GUI.pro b/GUI/i7z_GUI.pro
+--- a/GUI/i7z_GUI.pro 2013-10-12 21:59:19.000000000 +0100
++++ b/GUI/i7z_GUI.pro 2016-11-05 13:54:30.118655672 +0000
+@@ -3,7 +3,8 @@
+ ######################################################################
+
+ TEMPLATE = app
+-TARGET =
++TARGET = i7z_GUI
++QT += widgets
+ DEPENDPATH += .
+ INCLUDEPATH += .
+ CONFIG += debug
diff --git a/app-benchmarks/i7z/files/use_stdbool.patch b/app-benchmarks/i7z/files/use_stdbool.patch
new file mode 100644
index 000000000000..4aa84ac091c9
--- /dev/null
+++ b/app-benchmarks/i7z/files/use_stdbool.patch
@@ -0,0 +1,40 @@
+Author: Andreas Beckmann <anbe@debian.org>
+Description: use a consistent bool type
+Bug-Debian: #749724
+
+--- a/i7z.h
++++ b/i7z.h
+@@ -11,18 +11,13 @@
+ * ----------------------------------------------------------------------- */
+
+ #include <sys/time.h>
++#include <stdbool.h>
+
+ #define i7z_VERSION_INFO "svn-r93-(27-MAY-2013)"
+
+ //structure to store the information about the processor
+ #define proccpuinfo "/proc/cpuinfo"
+
+-#ifndef bool
+-#define bool int
+-#endif
+-#define false 0
+-#define true 1
+-
+ #define MAX_PROCESSORS 128
+ #define MAX_HI_PROCESSORS MAX_PROCESSORS
+ #define MAX_SK_PROCESSORS (MAX_PROCESSORS/4)
+--- a/cpuinfo.c
++++ b/cpuinfo.c
+@@ -2,10 +2,8 @@
+ #include "string.h"
+ #include "stdlib.h"
+ #include "assert.h"
++#include <stdbool.h>
+ #define MAX_PROCESSORS 32
+-#define bool int
+-#define false 0
+-#define true 1
+
+ #define MAX_HI_PROCESSORS MAX_PROCESSORS
+