Skip to contentSkip to conversation

Finer gperftools packaging

PATCH In review Anatol Belski 3 participants 5 messages Jul 21, 2019 – Jul 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Finer gperftools packaging

This splits gperftools into

- gperftools script
- gperftools profiler and other libs
- libtcmalloc-minimal
- docs and other stuff

Especially the libctmalloc-minimal is what is useful if only an improved allocator needs to be used. The gperftools package stays otherwise fully backward compatible, as it depends on any necessary lib packages. Though, the lib packages can be installed separately, which allows for more flexibility and for cleaner image contents.

---
 .../gperftools/gperftools_2.7.bb              | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +23 -0
index c8b91278d..badf0d203 100644
@@ -28,3 +28,26 @@ COMPATIBLE_HOST_mipsarch_libc-glibc = "null"
 ARM_INSTRUCTION_SET_armv5 = "arm"
 ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm"
 
+PACKAGES = "${PN} ${PN}-dbg ${PN}-doc ${PN}-libs ${PN}-libs-dev ${PN}-libs-staticdev libtcmalloc-minimal"
+
+EXTRA_OECONF_append += " --enable-static"
+
+FILES_${PN} = "${bindir}/*"
+FILES_${PN}-doc = "${docdir} ${mandir}"
+FILES_${PN}-libs = "${libdir}/libprofiler*${SOLIBS} ${libdir}/libprofiler*${SOLIBS}\
+		${libdir}/libtcmalloc${SOLIBS} \
+		${libdir}/libtcmalloc_debug${SOLIBS} \
+		${libdir}/libtcmalloc_and_profiler*${SOLIBS}"
+FILES_${PN}-libs-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/lib*.la ${libdir}/pkgconfig"
+FILES_${PN}-libs-staticdev = "${libdir}/*.a"
+FILES_libtcmalloc-minimal = "${libdir}/libtcmalloc_minimal*${SOLIBS} ${libdir}/libtcmalloc_minimal_debug*${SOLIBS}"
+
+RDEPENDS_${PN} = "${PN}-libs (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs = "libtcmalloc-minimal (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs-dev = "${PN}-libs (= ${EXTENDPKGV}) libtcmalloc-minimal (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs-staticdev = "${PN}-libs-dev (= ${EXTENDPKGV})"
+
+SECTION_${$PN}-doc = "doc"
+SECTION_${PN}-libs-dev = "devel"
+SECTION_${PN}-libs-staticdev = "devel"
+
Signature · 1 line
2.17.1
#1 lore raw

Hi Anatol

Quoted 23 lines · Anatol Belski via Openembedded-devel

This splits gperftools into

- gperftools script
- gperftools profiler and other libs
- libtcmalloc-minimal
- docs and other stuff

Especially the libctmalloc-minimal is what is useful if only an improved allocator needs to be used. The gperftools package stays otherwise fully backward compatible, as it depends on any necessary lib packages. Though, the lib packages can be installed separately, which allows for more flexibility and for cleaner image contents.

---
  .../gperftools/gperftools_2.7.bb              | 23 +++++++++++++++++++
  1 file changed, 23 insertions(+)
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +0 -0
index c8b91278d..badf0d203 100644

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 32

Quoted 5 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +2 -0
@@ -28,3 +28,26 @@ COMPATIBLE_HOST_mipsarch_libc-glibc = "null"
  ARM_INSTRUCTION_SET_armv5 = "arm"
  ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm"
 
+PACKAGES = "${PN} ${PN}-dbg ${PN}-doc ${PN}-libs ${PN}-libs-dev ${PN}-libs-staticdev libtcmalloc-minimal"
+

some of these are default so instead of rewriting the variable completely lets add/delete whatever is needed

PACKAGE_BREFORE_PN += "libtcmalloc-minimal ${PN}-libs"

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 34

Quoted 2 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +2 -0
+EXTRA_OECONF_append += " --enable-static"
+

why do we need this ?

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 36

Quoted 2 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +2 -0
+FILES_${PN} = "${bindir}/*"
+FILES_${PN}-doc = "${docdir} ${mandir}"

we wont need these

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 40

Quoted 4 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +4 -0
+FILES_${PN}-libs = "${libdir}/libprofiler*${SOLIBS} ${libdir}/libprofiler*${SOLIBS}\
+		${libdir}/libtcmalloc${SOLIBS} \
+		${libdir}/libtcmalloc_debug${SOLIBS} \
+		${libdir}/libtcmalloc_and_profiler*${SOLIBS}"

do we need a separate libs package ? what does it give us ?

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 42

Quoted 2 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +2 -0
+FILES_${PN}-libs-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/lib*.la ${libdir}/pkgconfig"
+FILES_${PN}-libs-staticdev = "${libdir}/*.a"

not needed

Quoted 11 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +11 -0
+FILES_libtcmalloc-minimal = "${libdir}/libtcmalloc_minimal*${SOLIBS} ${libdir}/libtcmalloc_minimal_debug*${SOLIBS}"
+
+RDEPENDS_${PN} = "${PN}-libs (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs = "libtcmalloc-minimal (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs-dev = "${PN}-libs (= ${EXTENDPKGV}) libtcmalloc-minimal (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs-staticdev = "${PN}-libs-dev (= ${EXTENDPKGV})"
+
+SECTION_${$PN}-doc = "doc"
+SECTION_${PN}-libs-dev = "devel"
+SECTION_${PN}-libs-staticdev = "devel"
+
#2 lore raw

Hi Khem,

thanks for the review.

Quoted 34 lines · Khem Raj

Hi Anatol

Quoted 31 lines · Anatol Belski via Openembedded-devel

This splits gperftools into

- gperftools script
- gperftools profiler and other libs
- libtcmalloc-minimal
- docs and other stuff

Especially the libctmalloc-minimal is what is useful if only an improved
allocator needs to be used. The gperftools package stays otherwise fully
backward compatible, as it depends on any necessary lib packages. Though, the lib packages can be installed separately, which allows for
more flexibility and for cleaner image contents.

---
  .../gperftools/gperftools_2.7.bb              | 23
+++++++++++++++++++
  1 file changed, 23 insertions(+)
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +0 -0
index c8b91278d..badf0d203 100644
@@ -28,3 +28,26 @@ COMPATIBLE_HOST_mipsarch_libc-glibc = "null"
  ARM_INSTRUCTION_SET_armv5 = "arm"
  ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm"
 
Quoted 9 lines
Quoted 3 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +1 -0
+PACKAGES = "${PN} ${PN}-dbg ${PN}-doc ${PN}-libs ${PN}-libs-dev

${PN}-libs-staticdev libtcmalloc-minimal"
+

some of these are default so instead of rewriting the variable completely lets add/delete whatever is needed

PACKAGE_BREFORE_PN += "libtcmalloc-minimal ${PN}-libs"

Good tip, i'm going to rewrite this based on this and other tips you gave below, which will simplify a lot.

Quoted 9 lines

meta-oe/recipes-support/gperftools/gperftools_2.7.bb

Quoted 2 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +2 -0
+EXTRA_OECONF_append += " --enable-static"
+

why do we need this ?

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 36

Quoted 2 lines
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +2 -0
+FILES_${PN} = "${bindir}/*"
+FILES_${PN}-doc = "${docdir} ${mandir}"

we wont need these

Quoted 7 lines

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 40

Quoted 5 lines

+FILES_${PN}-libs = "${libdir}/libprofiler*${SOLIBS} ${libdir}/libprofiler*${SOLIBS}\

meta-oe/recipes-support/gperftools/gperftools_2.7.bb +3 -0
+		${libdir}/libtcmalloc${SOLIBS} \
+		${libdir}/libtcmalloc_debug${SOLIBS} \
+		${libdir}/libtcmalloc_and_profiler*${SOLIBS}"

do we need a separate libs package ? what does it give us ?

The point on this is a usual separation to allow libs to be used separately from binaries. It was a kind of a "collateral improvement" while being on it. Whereby in this case sure the pperf script is just a 175K perl script, so probably it's an overhead. So intsead, one would have just libtcmalloc-minimal separated, as it sure a huge win for C++ apps, and otherwise let gperftools and gperftools-[static]dev handle the rest. Would this be a better approach?

Thanks

Anatol

Quoted 19 lines
Quoted 3 lines

+FILES_${PN}-libs-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/lib*.la ${libdir}/pkgconfig" +FILES_${PN}-libs-staticdev = "${libdir}/*.a"

not needed

Quoted 14 lines

+FILES_libtcmalloc-minimal =
"${libdir}/libtcmalloc_minimal*${SOLIBS}
${libdir}/libtcmalloc_minimal_debug*${SOLIBS}"

meta-oe/recipes-support/gperftools/gperftools_2.7.bb +4 -0
+
+RDEPENDS_${PN} = "${PN}-libs (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs = "libtcmalloc-minimal (= ${EXTENDPKGV})"
+RDEPENDS_${PN}-libs-dev = "${PN}-libs (= ${EXTENDPKGV})

libtcmalloc-minimal (= ${EXTENDPKGV})"

meta-oe/recipes-support/gperftools/gperftools_2.7.bb +6 -0
+RDEPENDS_${PN}-libs-staticdev = "${PN}-libs-dev (= ${EXTENDPKGV})"
+
+SECTION_${$PN}-doc = "doc"
+SECTION_${PN}-libs-dev = "devel"
+SECTION_${PN}-libs-staticdev = "devel"
+
#3 lore raw
In reply to Khem Raj
Quoted 5 lines · Khem Raj

Review

Quoted 2 lines
(quoted diff) +2 -0
+EXTRA_OECONF_append += " --enable-static"
+

why do we need this ?

Overseen this. This is needed, because for some reason static libraries was not produced on ARM64 by default, while they was on AMD64. I'll put a comment for this line.

Thanks

Anatol

#4 lore raw
In reply to Khem Raj

Hi Khem,

Quoted 8 lines · Khem Raj

meta-oe/recipes-support/gperftools/gperftools_2.7.bb COMPATIBLE_HOST_mipsarch_libc-glibc = "null" · line 40

Quoted 5 lines

+FILES_${PN}-libs = "${libdir}/libprofiler*${SOLIBS} ${libdir}/libprofiler*${SOLIBS}\

meta-oe/recipes-support/gperftools/gperftools_2.7.bb +3 -0
+		${libdir}/libtcmalloc${SOLIBS} \
+		${libdir}/libtcmalloc_debug${SOLIBS} \
+		${libdir}/libtcmalloc_and_profiler*${SOLIBS}"

do we need a separate libs package ? what does it give us ?

I've submitted another patch

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

which only cares about the libtcmalloc-minimal.

I've tried your suggestion and indeed an extra lib package simply doesn't make sense, the only diff would be that the pprof script would be packaged separately.

Please abandon this one, small steps having libtcmalloc-minimal is good enough for C++ apps just using the allocator.

Thanks

Anatol