[numatop] backport and rebase 1.0.1 patch

Dridi Boukelmoune dridi at fedoraproject.org
Mon Jun 30 18:59:02 UTC 2014


commit 134a7669af9bbf891ec923b0c6b62e744aa84d74
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Jun 30 20:11:38 2014 +0200

    backport and rebase 1.0.1 patch

 numatop.cpuid.patch |  140 +++++++++++++++++++++++++++++++++++++++++++++++++++
 numatop.spec        |    9 +++-
 2 files changed, 148 insertions(+), 1 deletions(-)
---
diff --git a/numatop.cpuid.patch b/numatop.cpuid.patch
new file mode 100644
index 0000000..6f2e370
--- /dev/null
+++ b/numatop.cpuid.patch
@@ -0,0 +1,140 @@
+diff --git i/common/os/os_util.c w/common/os/os_util.c
+index cd73aae..535f116 100644
+--- i/common/os/os_util.c
++++ w/common/os/os_util.c
+@@ -231,7 +231,7 @@ calibrate_cpuinfo(double *nsofclk, uint64_t *clkofsec)
+ 	*nsofclk = (double)NS_SEC / *clkofsec;
+ 
+ 	debug_print(NULL, 2, "calibrate_cpuinfo: nsofclk = %.4f, "
+-	    "clkofsec = %lu\n", *nsofclk, *clkofsec);
++	    "clkofsec = %"PRIu64"\n", *nsofclk, *clkofsec);
+ 
+ 	return (0);
+ }
+@@ -267,7 +267,7 @@ calibrate_cpufreq(double *nsofclk, uint64_t *clkofsec)
+ 	*nsofclk = (double)NS_SEC / *clkofsec;
+ 
+ 	debug_print(NULL, 2, "calibrate_cpufreq: nsofclk = %.4f, "
+-	    "clkofsec = %lu\n", *nsofclk, *clkofsec);
++	    "clkofsec = %"PRIu64"\n", *nsofclk, *clkofsec);
+ 
+ 	return (0);
+ }
+@@ -321,7 +321,7 @@ calibrate_by_tsc(double *nsofclk, uint64_t *clkofsec)
+ 	processor_unbind();
+ 
+ 	debug_print(NULL, 2, "calibrate_by_tsc: nsofclk = %.4f, "
+-	    "clkofsec = %lu\n", *nsofclk, *clkofsec);
++	    "clkofsec = %"PRIu64"\n", *nsofclk, *clkofsec);
+ }
+ 
+ void
+diff --git i/common/os/os_win.c w/common/os/os_win.c
+index b80bcdf..1fb1781 100644
+--- i/common/os/os_win.c
++++ w/common/os/os_win.c
+@@ -889,11 +889,11 @@ latnode_data_show(track_proc_t *proc, dyn_latnode_t *dyn, map_entry_t *entry,
+ 	win_size2str(dyn->size, size_str, sizeof (size_str));
+ 	if (lwp != NULL) {
+ 		(void) snprintf(content, sizeof (content),
+-		    "Memory area(%lX, %s), thread(%d)",
++		    "Memory area(%"PRIX64", %s), thread(%d)",
+ 		    dyn->addr, size_str, lwp->id);
+ 	} else {
+ 		(void) snprintf(content, sizeof (content),
+-		    "Memory area(%lX, %s), process(%d)",
++		    "Memory area(%"PRIX64", %s), process(%d)",
+ 		    dyn->addr, size_str, proc->pid);
+ 	}
+ 
+diff --git i/common/util.c w/common/util.c
+index cc75188..9dc3b71 100644
+--- i/common/util.c
++++ w/common/util.c
+@@ -126,7 +126,7 @@ debug_print(FILE *out, int level, const char *fmt, ...)
+ 			if (s_logfile != NULL) {
+ 				(void) pthread_mutex_lock(&s_debug_ctl.mutex);
+ 				(void) fprintf(s_logfile,
+-				    "%lu: ", current_ms() / 1000);
++				    "%"PRIu64": ", current_ms() / 1000);
+ 				va_start(ap, fmt);
+ 				(void) vfprintf(s_logfile, fmt, ap);
+ 				va_end(ap);
+@@ -137,7 +137,7 @@ debug_print(FILE *out, int level, const char *fmt, ...)
+ 		} else {
+ 			(void) pthread_mutex_lock(&s_debug_ctl.mutex);
+ 			(void) fprintf(out,
+-			    "%lu: ", current_ms() / 1000);
++			    "%"PRIu64": ", current_ms() / 1000);
+ 			va_start(ap, fmt);
+ 			(void) vfprintf(out, fmt, ap);
+ 			va_end(ap);
+@@ -319,6 +319,7 @@ static void
+ cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
+ 	unsigned int *edx)
+ {
++#if __x86_64
+ 	__asm volatile(
+ 	    "cpuid\n\t"
+ 	    :"=a" (*eax),
+@@ -326,6 +327,20 @@ cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
+ 	    "=c" (*ecx),
+ 	    "=d" (*edx)
+ 	    :"a" (*eax));
++#else
++	__asm volatile(
++	    "push %%ebx\n\t"
++	    "cpuid\n\t"
++	    "mov %%ebx, (%4)\n\t"
++	    "pop %%ebx"
++	    :"=a" (*eax),
++	    "=c" (*ecx),
++	    "=d" (*edx)
++	    :"0" (*eax),
++	    "S" (ebx)
++	    :"memory");
++#endif
++
+ }
+ 
+ /*
+diff --git i/common/win.c w/common/win.c
+index 3321a00..cb83397 100644
+--- i/common/win.c
++++ w/common/win.c
+@@ -1979,17 +1979,17 @@ win_size2str(uint64_t size, char *buf, int bufsize)
+ 	 * "buf" points to a big enough buffer.
+ 	 */
+ 	if ((i = (size / KB_BYTES)) < KB_BYTES) {
+-		(void) snprintf(buf, bufsize, "%luK", i);
++		(void) snprintf(buf, bufsize, "%"PRIu64"K", i);
+ 	} else if ((j = i / KB_BYTES) < KB_BYTES) {
+ 		if ((i % KB_BYTES) == 0) {
+-			(void) snprintf(buf, bufsize, "%luM", j);
++			(void) snprintf(buf, bufsize, "%"PRIu64"M", j);
+ 		} else {
+ 			(void) snprintf(buf, bufsize, "%.1fM",
+ 			    (double)i / (double)KB_BYTES);
+ 		}
+ 	} else {
+ 		if ((j % KB_BYTES) == 0) {
+-			(void) snprintf(buf, bufsize, "%luG", j / KB_BYTES);
++			(void) snprintf(buf, bufsize, "%"PRIu64"G", j / KB_BYTES);
+ 		} else {
+ 			(void) snprintf(buf, bufsize, "%.1fG",
+ 			    (double)j / (double)KB_BYTES);
+@@ -2314,12 +2314,12 @@ win_lat_data_show(track_proc_t *proc, dyn_lat_t *dyn, boolean_t *note_out)
+ 	if (lwp == NULL) {
+ 		(void) snprintf(content, sizeof (content),
+ 		    "Monitoring memory areas (pid: %d, "
+-		    "AVG.LAT: %luns, interval: %s)",
++		    "AVG.LAT: %"PRIu64"ns, interval: %s)",
+ 		    proc->pid, cyc2ns(lat), intval_buf);
+ 	} else {
+ 		(void) snprintf(content, sizeof (content),
+ 		    "Monitoring memory areas (lwpid: %d, "
+-		    "AVG.LAT: %luns, interval: %s)",
++		    "AVG.LAT: %"PRIu64"ns, interval: %s)",
+ 		    lwp->id, cyc2ns(lat), intval_buf);
+ 	}
+ 
diff --git a/numatop.spec b/numatop.spec
index 14472bf..ad7e79b 100644
--- a/numatop.spec
+++ b/numatop.spec
@@ -2,7 +2,7 @@
 
 Name:           numatop
 Version:        1.0.2
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Memory access locality characterization and analysis
 
 License:        BSD
@@ -10,6 +10,9 @@ URL:            https://01.org/numatop
 Source0:        https://01.org/sites/default/files/%{name}_linux_%{version}.tar.gz
 BuildRequires:  numactl-devel ncurses-devel
 
+# https://github.com/01org/numatop/pull/5
+Patch0:         numatop.cpuid.patch
+
 # no NUMA
 ExcludeArch:    %{arm} s390 s390x
 
@@ -25,6 +28,7 @@ NumaTOP supports the Intel Xeon processors.
 
 %prep
 %setup -q -n %{name}
+%patch0 -p1
 
 
 %build
@@ -44,6 +48,9 @@ make install PREFIXDIR=%{buildroot}%{_prefix} MANDIR=%{buildroot}%{_mandir}/man8
 
 
 %changelog
+* Mon Jun 30 2014 Dridi Boukelmoune <dridi.boukelmoune at gmail.com> - 1.0.2-3
+- Backport and rebase 1.0.1 patch
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.2-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list