Skip to contentSkip to conversation

meta-python: Add python-pyflame recipe

PATCH In review Andrew Jeffery 3 participants 16 messages May 10, 2018 – Sep 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 meta-python: Add python-pyflame recipe

---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12 ++++++++++++
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame.inc
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb
meta-python/recipes-devtools/python/python-pyflame.inc new file +12 -0
new file mode 100644
index 000000000000..3b84a7e8f8e3
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -0
new file mode 100644
index 000000000000..96f03305f883
@@ -0,0 +1 @@
+require python-pyflame.inc
Signature · 1 line
2.14.1
#1 lore raw

PATCH v2 2/3 meta-python: Port python-pyflame to 32-bit ARM

---
 ...ract-over-user_regs_struct-name-which-dif.patch | 69 ++++++++++++++++++++++
 .../python/python-pyflame_1.6.6.bb                 |  2 +
 2 files changed, 71 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame-1.6.6/0001-ptrace-Abstract-over-user_regs_struct-name-which-dif.patch
meta-python/recipes-devtools/python/python-pyflame-1.6.6/0001-ptrace-Abstract-over-user_regs_struct-name-which-dif.patch new file +69 -0
new file mode 100644
index 000000000000..09c4394c2a4b
@@ -0,0 +1,69 @@
+From 2ef124e235a47dd4742813cf80e11a89cf4f02f8 Mon Sep 17 00:00:00 2001
+From: Andrew Jeffery <[email protected]>
+Date: Thu, 3 May 2018 12:35:31 +0930
+Subject: [PATCH] ptrace: Abstract over user_regs_struct name, which differs on
+ ARM32
+
+Signed-off-by: Andrew Jeffery <[email protected]>
+---
+ src/ptrace.cc |  6 +++---
+ src/ptrace.h  | 10 ++++++++--
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/ptrace.cc b/src/ptrace.cc
+index 485f58e4d82e..610fabb3b8e8 100644
+--- a/src/ptrace.cc
++++ b/src/ptrace.cc
+@@ -122,8 +122,8 @@ void PtraceInterrupt(pid_t pid) {
+   DoWait(pid);
+ }
+ 
+-struct user_regs_struct PtraceGetRegs(pid_t pid) {
+-  struct user_regs_struct regs;
++user_regs_struct PtraceGetRegs(pid_t pid) {
++  user_regs_struct regs;
+   if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
+     std::ostringstream ss;
+     ss << "Failed to PTRACE_GETREGS: " << strerror(errno);
+@@ -132,7 +132,7 @@ struct user_regs_struct PtraceGetRegs(pid_t pid) {
+   return regs;
+ }
+ 
+-void PtraceSetRegs(pid_t pid, struct user_regs_struct regs) {
++void PtraceSetRegs(pid_t pid, user_regs_struct regs) {
+   if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
+     std::ostringstream ss;
+     ss << "Failed to PTRACE_SETREGS: " << strerror(errno);
+diff --git a/src/ptrace.h b/src/ptrace.h
+index 7083be1c4dfd..d6af8bf9f83a 100644
+--- a/src/ptrace.h
++++ b/src/ptrace.h
+@@ -23,6 +23,12 @@
+ 
+ #include "./config.h"
+ 
++#if defined(__arm__)
++typedef struct user_regs user_regs_struct;
++#else
++typedef struct user_regs_struct user_regs_struct;
++#endif
++
+ namespace pyflame {
+ 
+ int DoWait(pid_t pid, int options = 0);
+@@ -39,10 +45,10 @@ void PtraceSeize(pid_t pid);
+ void PtraceInterrupt(pid_t pid);
+ 
+ // get regs from a process
+-struct user_regs_struct PtraceGetRegs(pid_t pid);
++user_regs_struct PtraceGetRegs(pid_t pid);
+ 
+ // set regs in a process
+-void PtraceSetRegs(pid_t pid, struct user_regs_struct regs);
++void PtraceSetRegs(pid_t pid, user_regs_struct regs);
+ 
+ // poke a long word into an address
+ void PtracePoke(pid_t pid, unsigned long addr, long data);
+-- 
+2.14.1
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb +2 -0
index 96f03305f883..7a6d3b09962f 100644
@@ -1 +1,3 @@
 require python-pyflame.inc
+
+SRC_URI += "file://0001-ptrace-Abstract-over-user_regs_struct-name-which-dif.patch"
Signature · 1 line
2.14.1
#2 lore raw

PATCH v2 3/3 meta-python: Make python-pyflame cope with prelinked ELFs

In reply to Andrew Jeffery
---
 ...mbol-Account-for-prelinked-shared-objects.patch | 134 +++++++++++++++++++++
 .../python/python-pyflame_1.6.6.bb                 |   1 +
 2 files changed, 135 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame-1.6.6/0001-symbol-Account-for-prelinked-shared-objects.patch
meta-python/recipes-devtools/python/python-pyflame-1.6.6/0001-symbol-Account-for-prelinked-shared-objects.patch new file +134 -0
new file mode 100644
index 000000000000..3eefc9cb9830
@@ -0,0 +1,134 @@
+From 007965d341349679607699d005c4af811b2c419a Mon Sep 17 00:00:00 2001
+From: Andrew Jeffery <[email protected]>
+Date: Fri, 4 May 2018 11:23:53 +0930
+Subject: [PATCH] symbol: Account for prelinked shared objects
+
+Some projects, such as those derived from Yocto, tend to prelink their
+binaries and libraries to reduce runtime overhead. Currently this trips
+up pyflame in its symbol address calculations, and leads to ptrace
+failures due to spurious addresses:
+
+   $ pyflame -t python -c "print 'foo'"
+   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
+   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
+   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
+   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
+   Unexpected ptrace(2) exception: Failed to PTRACE_PEEKDATA (pid 1482, addr 0x9f9b1d70): Input/output error
+   ...
+
+Add support for reading a prelinked base p_vaddr out of the ELF and
+adjust the PyAddresses values accordingly.
+
+Signed-off-by: Andrew Jeffery <[email protected]>
+---
+ src/symbol.cc | 15 +++++++++++++++
+ src/symbol.h  | 29 ++++++++++++++++++++++++++++-
+ 2 files changed, 43 insertions(+), 1 deletion(-)
+
+diff --git a/src/symbol.cc b/src/symbol.cc
+index 125174efeeb5..39c3e8132dd1 100644
+--- a/src/symbol.cc
++++ b/src/symbol.cc
+@@ -166,6 +166,17 @@ PyABI ELF::WalkTable(int sym, int str, PyAddresses *addrs) {
+   return abi;
+ }
+ 
++addr_t ELF::GetBaseAddress() {
++  int32_t phnum = hdr()->e_phnum;
++  int32_t i;
++  for (i = 0; i < phnum && phdr(i)->p_type != PT_LOAD; i++) {
++  }
++  if (i == phnum) {
++    throw FatalException("Failed to find PT_LOAD entry in program headers");
++  }
++  return phdr(i)->p_vaddr;
++}
++
+ PyAddresses ELF::GetAddresses(PyABI *abi) {
+   PyAddresses addrs;
+   PyABI detected_abi = WalkTable(dynsym_, dynstr_, &addrs);
+@@ -176,6 +187,10 @@ PyAddresses ELF::GetAddresses(PyABI *abi) {
+   if (abi != nullptr) {
+     *abi = detected_abi;
+   }
++  // Handle prelinked shared objects
++  if (hdr()->e_type == ET_DYN) {
++    return addrs - GetBaseAddress();
++  }
+   return addrs;
+ }
+ }  // namespace pyflame
+diff --git a/src/symbol.h b/src/symbol.h
+index 124853bcc1c1..bb92b9a2604b 100644
+--- a/src/symbol.h
++++ b/src/symbol.h
+@@ -28,15 +28,19 @@
+ 
+ #if USE_ELF64
+ #define ehdr_t Elf64_Ehdr
++#define phdr_t Elf64_Phdr
+ #define shdr_t Elf64_Shdr
+ #define dyn_t Elf64_Dyn
+ #define sym_t Elf64_Sym
++#define addr_t Elf64_Addr
+ #define ARCH_ELFCLASS ELFCLASS64
+ #else
+ #define ehdr_t Elf32_Ehdr
++#define phdr_t Elf32_Phdr
+ #define shdr_t Elf32_Shdr
+ #define dyn_t Elf32_Dyn
+ #define sym_t Elf32_Sym
++#define addr_t Elf32_Addr
+ #define ARCH_ELFCLASS ELFCLASS32
+ #endif
+ 
+@@ -67,8 +71,18 @@ struct PyAddresses {
+         interp_head_hint(0),
+         pie(false) {}
+ 
++  PyAddresses operator-(const unsigned long base) const {
++    PyAddresses res(*this);
++    res.tstate_addr = this->tstate_addr == 0 ? 0 : this->tstate_addr - base;
++    res.interp_head_addr =
++        this->interp_head_addr == 0 ? 0 : this->interp_head_addr - base;
++    res.interp_head_fn_addr =
++        this->interp_head_fn_addr == 0 ? 0 : this->interp_head_fn_addr - base;
++    return res;
++  }
++
+   PyAddresses operator+(const unsigned long base) const {
+-    PyAddresses res;
++    PyAddresses res(*this);
+     res.tstate_addr = this->tstate_addr == 0 ? 0 : this->tstate_addr + base;
+     res.interp_head_addr =
+         this->interp_head_addr == 0 ? 0 : this->interp_head_addr + base;
+@@ -113,6 +127,9 @@ class ELF {
+   // ABI.
+   PyAddresses GetAddresses(PyABI *abi);
+ 
++  // Extract the base load address from the Program Header table
++  addr_t GetBaseAddress();
++
+  private:
+   void *addr_;
+   size_t length_;
+@@ -122,6 +139,16 @@ class ELF {
+     return reinterpret_cast<const ehdr_t *>(addr_);
+   }
+ 
++  inline const phdr_t *phdr(int idx) const {
++    if (idx < 0) {
++      std::ostringstream ss;
++      ss << "Illegal phdr index: " << idx;
++      throw FatalException(ss.str());
++    }
++    return reinterpret_cast<const phdr_t *>(p() + hdr()->e_phoff +
++                                            idx * hdr()->e_phentsize);
++  }
++
+   inline const shdr_t *shdr(int idx) const {
+     if (idx < 0) {
+       std::ostringstream ss;
+-- 
+2.14.1
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb +1 -0
index 7a6d3b09962f..abf3ed7fee71 100644
@@ -1,3 +1,4 @@
 require python-pyflame.inc
 
 SRC_URI += "file://0001-ptrace-Abstract-over-user_regs_struct-name-which-dif.patch"
+SRC_URI += "file://0001-symbol-Account-for-prelinked-shared-objects.patch"
Signature · 1 line
2.14.1
#3 lore raw
In reply to Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the following two?

Cheers,

Andrew

Quoted 38 lines
---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12 ++++++++++++
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame.inc
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb
(quoted diff) renamed from meta-python/recipes-devtools/python/python-pyflame.inc +0 -0

meta-python/recipes-devtools/python/python-pyflame.inc new file mode 100644
index 000000000000..3b84a7e8f8e3

meta-python/recipes-devtools/python/python-pyflame.inc new file +5 -0
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/

LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

meta-python/recipes-devtools/python/python-pyflame.inc new file +7 -0
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -0
new file mode 100644
index 000000000000..96f03305f883
@@ -0,0 +1 @@
+require python-pyflame.inc
Signature · 1 line
2.14.1
#4 lore raw
Quoted 5 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the following two?

There was a review comment for you to adress, see

https://patchwork.openembedded.org/patch/150467/

if you have addressed that please send a v3 for whole series.

Quoted 47 lines

Cheers,

Andrew

Quoted 36 lines
---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12 ++++++++++++
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame.inc
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb
(quoted diff) renamed from meta-python/recipes-devtools/python/python-pyflame.inc +0 -0

meta-python/recipes-devtools/python/python-pyflame.inc new file mode 100644
index 000000000000..3b84a7e8f8e3

meta-python/recipes-devtools/python/python-pyflame.inc new file +5 -0
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/

LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

meta-python/recipes-devtools/python/python-pyflame.inc new file +7 -0
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -1
new file mode 100644
index 000000000000..96f03305f883
@@ -0,0 +1 @@
+require python-pyflame.inc
--
Quoted 2 lines

2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#5 lore raw
Quoted 4 lines · Khem Raj
Quoted 3 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery
Quoted 8 lines
Quoted 2 lines

Ping - is there anything I need to revise for this patch or the following two?

There was a review comment for you to adress, see

https://patchwork.openembedded.org/patch/150467/

if you have addressed that please send a v3 for whole series.

That comment is on v1 of the series. This is v2, and I have reworked the recipe to simply clone the git repo instead of grab the tarball to avoid the issue that was pointed out.

Thanks,

Andrew

#6 lore raw
Quoted 13 lines · Andrew Jeffery
Quoted 5 lines · Khem Raj
Quoted 4 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the

following two?

Quoted 4 lines
Quoted 1 line

There was a review comment for you to adress, see

Quoted 8 lines
Quoted 3 lines

https://patchwork.openembedded.org/patch/150467/

if you have addressed that please send a v3 for whole series.

That comment is on v1 of the series. This is v2, and I have reworked the recipe to simply clone the git repo instead of grab the tarball to avoid the issue that was pointed out.

Ok thanks I think the v2 seems to be missing in patchwork that’s the reason it will go missed i wonder if you resend than patchwork will catch it

Quoted 5 lines

Thanks,

Andrew

#7 lore raw
Quoted 19 lines · Khem Raj
Quoted 17 lines · Andrew Jeffery
Quoted 5 lines · Khem Raj
Quoted 4 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the

following two?

Quoted 7 lines
Quoted 1 line

There was a review comment for you to adress, see

https://patchwork.openembedded.org/patch/150467/

if you have addressed that please send a v3 for whole series.

Quoted 7 lines
Quoted 4 lines

That comment is on v1 of the series. This is v2, and I have reworked the recipe to simply clone the git repo instead of grab the tarball to avoid the issue that was pointed out.

Ok thanks I think the v2 seems to be missing in patchwork that’s the reason it will go missed i wonder if you resend than patchwork will catch it

Someone has archived the patches. Here they are:

https://patchwork.openembedded.org/project/oe/patches/?submitter=12303&state=*&q=v2&archive=both&delegate=

Cheers,

Andrew

#8 lore raw
In reply to Andrew Jeffery

fails to build on qemumips

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:125:41: error: return type 'user_regs_struct {aka struct user_regs_struct}' is incomplete

|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                                          ^
| ../../git/src/ptrace.cc:125:18: error: ambiguating new declaration
of 'void pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                   ^~~~~~~~~~~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:48:18: note: old declaration
'user_regs_struct pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid);
|                   ^~~~~~~~~~~~~
| ../../git/src/ptrace.cc:126:20: error: aggregate 'user_regs_struct
regs' has incomplete type and cannot be defined
|    user_regs_struct regs;
|                     ^~~~
| ../../git/src/ptrace.cc: In function 'void
pyflame::PtraceSetRegs(pid_t, user_regs_struct)':
| ../../git/src/ptrace.cc:135:48: error: 'regs' has incomplete type
|  void PtraceSetRegs(pid_t pid, user_regs_struct regs) {
|                                                 ^~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:29:16: note: forward declaration of
'user_regs_struct {aka struct user_regs_struct}'
|  typedef struct user_regs_struct user_regs_struct;
|                 ^~~~~~~~~~~~~~~~
| make[2]: *** [ptrace.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| make[2]: Leaving directory

`/mnt/jenkins/workspace/OpenEmbedded/build/tmp/work/mips32r2-bec-linux/python-pyflame/1.6.6-r0/build/src'

Quoted 52 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the following two?

Cheers,

Andrew

Quoted 36 lines
---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12 ++++++++++++
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame.inc
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb
(quoted diff) renamed from meta-python/recipes-devtools/python/python-pyflame.inc +0 -0

meta-python/recipes-devtools/python/python-pyflame.inc new file mode 100644
index 000000000000..3b84a7e8f8e3

meta-python/recipes-devtools/python/python-pyflame.inc new file +5 -0
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/

LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

meta-python/recipes-devtools/python/python-pyflame.inc new file +7 -0
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -1
new file mode 100644
index 000000000000..96f03305f883
@@ -0,0 +1 @@
+require python-pyflame.inc
--
Quoted 2 lines

2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#9 lore raw

Hi Khem,

Thanks for testing.

Quoted 2 lines · Khem Raj

fails to build on qemumips

Do I have to support MIPS for the recipe to be acceptable? Is there some way we can limit the recipe to architectures for which the software is known to work?

Andrew

Quoted 88 lines

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:125:41: error: return type 'user_regs_struct {aka struct user_regs_struct}' is incomplete

|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                                          ^
| ../../git/src/ptrace.cc:125:18: error: ambiguating new declaration
of 'void pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                   ^~~~~~~~~~~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:48:18: note: old declaration
'user_regs_struct pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid);
|                   ^~~~~~~~~~~~~
| ../../git/src/ptrace.cc:126:20: error: aggregate 'user_regs_struct
regs' has incomplete type and cannot be defined
|    user_regs_struct regs;
|                     ^~~~
| ../../git/src/ptrace.cc: In function 'void
pyflame::PtraceSetRegs(pid_t, user_regs_struct)':
| ../../git/src/ptrace.cc:135:48: error: 'regs' has incomplete type
|  void PtraceSetRegs(pid_t pid, user_regs_struct regs) {
|                                                 ^~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:29:16: note: forward declaration of
'user_regs_struct {aka struct user_regs_struct}'
|  typedef struct user_regs_struct user_regs_struct;
|                 ^~~~~~~~~~~~~~~~
| make[2]: *** [ptrace.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| make[2]: Leaving directory

`/mnt/jenkins/workspace/OpenEmbedded/build/tmp/work/mips32r2-bec-linux/ python-pyflame/1.6.6-r0/build/src'

Quoted 52 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the following two?

Cheers,

Andrew

Quoted 36 lines
---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12 ++++++++++++
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame.inc
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb
(quoted diff) renamed from meta-python/recipes-devtools/python/python-pyflame.inc +0 -0

meta-python/recipes-devtools/python/python-pyflame.inc new file mode 100644
index 000000000000..3b84a7e8f8e3

meta-python/recipes-devtools/python/python-pyflame.inc new file +5 -0
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/

LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

meta-python/recipes-devtools/python/python-pyflame.inc new file +7 -0
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -1
new file mode 100644
index 000000000000..96f03305f883
@@ -0,0 +1 @@
+require python-pyflame.inc
--
Quoted 2 lines

2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#10 lore raw
Quoted 9 lines · Andrew Jeffery

Hi Khem,

Thanks for testing.

Quoted 2 lines · Khem Raj

fails to build on qemumips

Do I have to support MIPS for the recipe to be acceptable? Is there some way we can limit the recipe to architectures for which the software is known to work?

Ideally we tend to support the core architectures and mips is one of them, so unless there is a very basic
reason e.g. missing support etc. we tend to fix the problems, so I would suggest to see if it can be fixed preferably
if not then we should cite the reason and probably we can add mips to incompatible hosts but that is last resort
once a recipe goes in it becomes a maintenance work and I would like to make it as light as possible.

#11 lore raw
Quoted 6 lines · Khem Raj
Quoted 5 lines · Andrew Jeffery

Hi Khem,

Thanks for testing.

On Fri, 1 Jun 2018, at 02:18, Khem Raj wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

fails to build on qemumips

Do I have to support MIPS for the recipe to be acceptable? Is there some way we can limit the recipe to architectures for which the software is known to work?

Ideally we tend to support the core architectures and mips is one of them, so unless there is a very basic
reason e.g. missing support etc. we tend to fix the problems,

Doesn't the fact that the source doesn't build indicate missing support?

I don't know what C library you were building against, but glibc for mips doesn't contain a definition for struct user_regs{,_struct} in sysdeps/unix/sysv/linux/mips/sys/user.h. It's a bit nasty, as the header very clearly states that user.h is purely for gdb, but pyflame is making use of it anyway. Patch 2/3 fixes the pyflame source for 32-bit ARM, where the struct has a different name, but at least it's present. I haven't investigated whether we could pull in the appropriate header from the kernel instead of libc, but again because ARM can be made to work with relatively little effort I hadn't bothered.

Quoted 5 lines

so I would suggest to see if it can be fixed preferably
if not then we should cite the reason and probably we can add mips to incompatible hosts but that is last resort
once a recipe goes in it becomes a maintenance work and I would like to make it as light as possible.

I could go down the path of working this out for mips, but fixing mips falls outside the scope of what I was doing at the time (I'm several yaks deep here), and given the problem is external to pyflame itself I'm not terribly motivated to fix it.

So I feel at this point it's either blacklist mips or we leave the recipe out of tree.

As an alternative to making mips work, can I assist with the associated maintenance hassle in some way?

Cheers,

Andrew

#12 lore raw
Quoted 27 lines · Andrew Jeffery
Quoted 6 lines · Khem Raj
Quoted 5 lines · Andrew Jeffery

Hi Khem,

Thanks for testing.

On Fri, 1 Jun 2018, at 02:18, Khem Raj wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

fails to build on qemumips

Do I have to support MIPS for the recipe to be acceptable? Is there some way we can limit the recipe to architectures for which the software is known to work?

Ideally we tend to support the core architectures and mips is one of them, so unless there is a very basic
reason e.g. missing support etc. we tend to fix the problems,

Doesn't the fact that the source doesn't build indicate missing support?

I don't know what C library you were building against, but glibc for mips doesn't contain a definition for struct user_regs{,_struct} in sysdeps/unix/sysv/linux/mips/sys/user.h. It's a bit nasty, as the header very clearly states that user.h is purely for gdb, but pyflame is making use of it anyway. Patch 2/3 fixes the pyflame source for 32-bit ARM, where the struct has a different name, but at least it's present. I haven't investigated whether we could pull in the appropriate header from the kernel instead of libc, but again because ARM can be made to work with relatively little effort I hadn't bothered.

Quoted 5 lines

so I would suggest to see if it can be fixed preferably
if not then we should cite the reason and probably we can add mips to incompatible hosts but that is last resort
once a recipe goes in it becomes a maintenance work and I would like to make it as light as possible.

Quoted 6 lines

I could go down the path of working this out for mips, but fixing mips falls outside the scope of what I was doing at the time (I'm several yaks deep here), and given the problem is external to pyflame itself I'm not terribly motivated to fix it.

So I feel at this point it's either blacklist mips or we leave the recipe out of tree.

As an alternative to making mips work, can I assist with the associated maintenance hassle in some way?

we can add it with exclusions for mips/musl and I think we will have similar problems with ppc as well but I do not have test results for that

you should report this issue upstream and probably add a comment so we remember why it was excluded.

Quoted 3 lines

Cheers,

Andrew

#13 lore raw
In reply to Khem Raj

Hi,

it also fails for aarch64:

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:127:14: error: 'PTRACE_GETREGS' was not declared in this scope

|    if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
| ../../git/src/ptrace.cc:127:14: note: suggested alternative:
'PTRACE_GETREGSET'
|    if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
|               PTRACE_GETREGSET
| ../../git/src/ptrace.cc: In function 'void pyflame::PtraceSetRegs(pid_t,
user_regs_struct)':
| ../../git/src/ptrace.cc:136:14: error: 'PTRACE_SETREGS' was not declared
in this scope
|    if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
| ../../git/src/ptrace.cc:136:14: note: suggested alternative:
'PTRACE_SETREGSET'
|    if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
|               PTRACE_SETREGSET
| Makefile:524: recipe for target 'ptrace.o' failed
| make[2]: *** [ptrace.o] Error 1

I don't plan to use it, so I'm ok with aarch64 removal from compatible archs if the fix turns to be complicated.

Cheers,

Quoted 102 lines · Khem Raj

fails to build on qemumips

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:125:41: error: return type 'user_regs_struct {aka struct user_regs_struct}' is incomplete

|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                                          ^
| ../../git/src/ptrace.cc:125:18: error: ambiguating new declaration
of 'void pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                   ^~~~~~~~~~~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:48:18: note: old declaration
'user_regs_struct pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid);
|                   ^~~~~~~~~~~~~
| ../../git/src/ptrace.cc:126:20: error: aggregate 'user_regs_struct
regs' has incomplete type and cannot be defined
|    user_regs_struct regs;
|                     ^~~~
| ../../git/src/ptrace.cc: In function 'void
pyflame::PtraceSetRegs(pid_t, user_regs_struct)':
| ../../git/src/ptrace.cc:135:48: error: 'regs' has incomplete type
|  void PtraceSetRegs(pid_t pid, user_regs_struct regs) {
|                                                 ^~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:29:16: note: forward declaration of
'user_regs_struct {aka struct user_regs_struct}'
|  typedef struct user_regs_struct user_regs_struct;
|                 ^~~~~~~~~~~~~~~~
| make[2]: *** [ptrace.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| make[2]: Leaving directory

`/mnt/jenkins/workspace/OpenEmbedded/build/tmp/work/mips32r2-bec-linux/python-pyflame/1.6.6-r0/build/src'

Quoted 4 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the

following two?

Quoted 7 lines

Cheers,

Andrew

Quoted 2 lines
---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12

++++++++++++

Quoted 3 lines
Quoted 3 lines
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644

meta-python/recipes-devtools/python/python-pyflame.inc

Quoted 1 line
Quoted 1 line
 create mode 100644 meta-python/recipes-devtools/python/

python-pyflame_1.6.6.bb

Quoted 17 lines
Quoted 14 lines
(quoted diff) renamed from meta-python/recipes-devtools/python/python-pyflame.inc +0 -0

meta-python/recipes-devtools/python/python-pyflame.inc new file mode 100644
index 000000000000..3b84a7e8f8e3

meta-python/recipes-devtools/python/python-pyflame.inc new file +5 -0
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/

LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

meta-python/recipes-devtools/python/python-pyflame.inc

Quoted 3 lines
meta-python/recipes-devtools/python/python-pyflame.inc new file +3 -0
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}

<http://github.com/uber/pyflame.git;protocol=https;tag=v$%7BPV%7D>"

Quoted 5 lines

Review

Quoted 5 lines
meta-python/recipes-devtools/python/python-pyflame.inc new file +4 -0
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
(quoted diff) +0 -0

python-pyflame_1.6.6.bb

Quoted 7 lines
Quoted 7 lines

b/meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file mode 100644
index 000000000000..96f03305f883

meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -0
@@ -0,0 +1 @@
+require python-pyflame.inc
Quoted 8 lines
Quoted 3 lines

--
2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#14 lore raw
Quoted 24 lines · Martin Jansa

Hi,

it also fails for aarch64:

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:127:14: error: 'PTRACE_GETREGS' was not declared in this scope
|    if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
| ../../git/src/ptrace.cc:127:14: note: suggested alternative: 'PTRACE_GETREGSET'
|    if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
|               PTRACE_GETREGSET
| ../../git/src/ptrace.cc: In function 'void pyflame::PtraceSetRegs(pid_t, user_regs_struct)':
| ../../git/src/ptrace.cc:136:14: error: 'PTRACE_SETREGS' was not declared in this scope
|    if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
| ../../git/src/ptrace.cc:136:14: note: suggested alternative: 'PTRACE_SETREGSET'
|    if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
|               PTRACE_SETREGSET
| Makefile:524: recipe for target 'ptrace.o' failed
| make[2]: *** [ptrace.o] Error 1
Quoted 2 lines

I don't plan to use it, so I'm ok with aarch64 removal from compatible archs if the fix turns to be complicated.

Lets exclude it if it does not build. Care to send a patch ?

Quoted 98 lines

Cheers,

Quoted 95 lines · Khem Raj

fails to build on qemumips

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:125:41: error: return type 'user_regs_struct {aka struct user_regs_struct}' is incomplete

|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                                          ^
| ../../git/src/ptrace.cc:125:18: error: ambiguating new declaration
of 'void pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid) {
|                   ^~~~~~~~~~~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:48:18: note: old declaration
'user_regs_struct pyflame::PtraceGetRegs(pid_t)'
|  user_regs_struct PtraceGetRegs(pid_t pid);
|                   ^~~~~~~~~~~~~
| ../../git/src/ptrace.cc:126:20: error: aggregate 'user_regs_struct
regs' has incomplete type and cannot be defined
|    user_regs_struct regs;
|                     ^~~~
| ../../git/src/ptrace.cc: In function 'void
pyflame::PtraceSetRegs(pid_t, user_regs_struct)':
| ../../git/src/ptrace.cc:135:48: error: 'regs' has incomplete type
|  void PtraceSetRegs(pid_t pid, user_regs_struct regs) {
|                                                 ^~~~
| In file included from ../../git/src/ptrace.cc:15:0:
| ../../git/src/./ptrace.h:29:16: note: forward declaration of
'user_regs_struct {aka struct user_regs_struct}'
|  typedef struct user_regs_struct user_regs_struct;
|                 ^~~~~~~~~~~~~~~~
| make[2]: *** [ptrace.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| make[2]: Leaving directory

`/mnt/jenkins/workspace/OpenEmbedded/build/tmp/work/mips32r2-bec-linux/python-pyflame/1.6.6-r0/build/src'

Quoted 44 lines · Andrew Jeffery
Quoted 1 line · Andrew Jeffery

Ping - is there anything I need to revise for this patch or the following two?

Cheers,

Andrew

Quoted 35 lines
---
 meta-python/recipes-devtools/python/python-pyflame.inc      | 12 ++++++++++++
 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame.inc
 create mode 100644 meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb
(quoted diff) renamed from meta-python/recipes-devtools/python/python-pyflame.inc +0 -0

meta-python/recipes-devtools/python/python-pyflame.inc new file mode 100644
index 000000000000..3b84a7e8f8e3

meta-python/recipes-devtools/python/python-pyflame.inc new file +5 -0
@@ -0,0 +1,12 @@
+SUMMARY = "Pyflame: A Ptracing Profiler For Python"
+HOMEPAGE = "https://github.com/uber/pyflame"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/

LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"

meta-python/recipes-devtools/python/python-pyflame.inc new file +7 -0
+DEPENDS = "python"
+
+SRC_URI = "git://github.com/uber/pyflame.git;protocol=https;tag=v${PV}"
+S = "${WORKDIR}/git"
+
+inherit pkgconfig autotools
+
meta-python/recipes-devtools/python/python-pyflame_1.6.6.bb new file +1 -0
new file mode 100644
index 000000000000..96f03305f883
@@ -0,0 +1 @@
+require python-pyflame.inc
Quoted 8 lines
Quoted 3 lines

--
2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#15 lore raw

PATCH 1/1 python-pyflame: skip for aarch64 as well

In reply to Martin Jansa

* fails with:

| ../../git/src/ptrace.cc: In function 'user_regs_struct pyflame::PtraceGetRegs(pid_t)':
| ../../git/src/ptrace.cc:127:14: error: 'PTRACE_GETREGS' was not declared in this scope
|    if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
| ../../git/src/ptrace.cc:127:14: note: suggested alternative: 'PTRACE_GETREGSET'
|    if (ptrace(PTRACE_GETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
|               PTRACE_GETREGSET
| ../../git/src/ptrace.cc: In function 'void pyflame::PtraceSetRegs(pid_t, user_regs_struct)':
| ../../git/src/ptrace.cc:136:14: error: 'PTRACE_SETREGS' was not declared in this scope
|    if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
| ../../git/src/ptrace.cc:136:14: note: suggested alternative: 'PTRACE_SETREGSET'
|    if (ptrace(PTRACE_SETREGS, pid, 0, &regs)) {
|               ^~~~~~~~~~~~~~
|               PTRACE_SETREGSET
| Makefile:524: recipe for target 'ptrace.o' failed
| make[2]: *** [ptrace.o] Error 1
---
 meta-python/recipes-devtools/python/python-pyflame.inc | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-devtools/python/python-pyflame.inc +1 -0
index 3914028ec3..340aab74ef 100644
@@ -12,3 +12,4 @@ inherit pkgconfig autotools
 
 COMPATIBLE_HOST_libc-musl_class-target = "null"
 COMPATIBLE_HOST_mipsarch_class-target = "null"
+COMPATIBLE_HOST_aarch64_class-target = "null"
Signature · 1 line
2.17.1