[beignet] 01/07: Make profiling work on multiarch systems

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Sat Jun 18 18:27:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit f70a7d6ded9b546883d3002f64338ca453e9b586
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Wed Jun 8 22:14:31 2016 +0100

    Make profiling work on multiarch systems
---
 debian/changelog                      |  6 ++++++
 debian/patches/profiling-32on64.patch | 40 +++++++++++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 3 files changed, 47 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 202a107..857b9fe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+beignet (1.1.2-3) UNRELEASED; urgency=medium
+
+  * Make profiling work on multiarch systems.
+
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Wed, 08 Jun 2016 22:10:03 +0100
+
 beignet (1.1.2-2) unstable; urgency=medium
 
   [ Andreas Beckmann ]
diff --git a/debian/patches/profiling-32on64.patch b/debian/patches/profiling-32on64.patch
new file mode 100644
index 0000000..0aed9ae
--- /dev/null
+++ b/debian/patches/profiling-32on64.patch
@@ -0,0 +1,40 @@
+Description: Fix profiling in i386 applications on amd64 kernel
+
+The profiling timestamp format depends on the kernel's architecture,
+which may not be the same as the application's.
+
+Origin: upstream
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95245
+Author: Yang Rong <rong.r.yang at intel.com>
+---
+ src/intel/intel_gpgpu.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c
+index 39b7e4d..db967e8 100644
+--- a/src/intel/intel_gpgpu.c
++++ b/src/intel/intel_gpgpu.c
+@@ -2243,11 +2243,15 @@ intel_gpgpu_read_ts_reg_gen7(drm_intel_bufmgr *bufmgr)
+      i386 system. It seems the kernel readq bug. So shift 32 bit in x86_64, and only remain
+      32 bits data in i386.
+   */
+-#ifdef __i386__
+-  return result & 0x0ffffffff;
+-#else
+-  return result >> 32;
+-#endif  /* __i386__  */
++  struct utsname buf;
++  uname(&buf);
++  /* In some systems, the user space is 32 bit, but kernel is 64 bit, so can't use the
++   * compiler's flag to determine the kernel'a architecture, use uname to get it. */
++  /* x86_64 in linux, amd64 in bsd */
++  if(strcmp(buf.machine, "x86_64") == 0 || strcmp(buf.machine, "amd64") == 0)
++    return result >> 32;
++  else
++    return result & 0x0ffffffff;
+ }
+ 
+ /* baytrail's result should clear high 4 bits */
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index fed7b6e..1004af4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ std-isnan-isinf.patch
 Enable-test-debug.patch
 llvm38-support.patch
 find-python35.patch
+profiling-32on64.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list