From 04e2f6b543c3f47a2b88256f7476d2eb746bf176 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 18 Mar 2021 00:26:09 -0700 Subject: oprofile: Upgrade to 1.4.0 release Drop upstreamed patches Backport musl fix and deterministic build patches from master Release notes - https://oprofile.sourceforge.io/release-notes/oprofile-1.4.0 Signed-off-by: Khem Raj --- meta-oe/recipes-kernel/oprofile/oprofile.inc | 67 ----------- ...Add-rmb-definition-for-NIOS2-architecture.patch | 30 ----- .../oprofile/0001-Fix-build-with-musl.patch | 55 +++++++++ .../oprofile/0001-Use-new-bfd-APIs-from-2.34.patch | 79 ------------- ...-replace-sym_iterator-0-with-sym_iterator.patch | 131 --------------------- ...002-Fix-configure-when-bin-sh-is-not-bash.patch | 40 +++++++ ...C-preprocessor-variable-to-improve-reprod.patch | 30 +++++ ...Use-BUILD_DATE-to-improve-reproducibility.patch | 63 ++++++++++ ...Add-rmb-definition-for-NIOS2-architecture.patch | 31 +++++ ...-replace-sym_iterator-0-with-sym_iterator.patch | 131 +++++++++++++++++++++ ...esn-t-want-GNU-levels-of-automake-strictn.patch | 23 ++++ ...0008-include-linux-limits.h-for-MAX_INPUT.patch | 30 +++++ ...ning-check-tests-on-host-if-cross-compili.patch | 113 ++++++++++++++++++ ...termine-the-root-home-directory-dynamical.patch | 46 ++++++++ .../oprofile/oprofile/automake-foreign.patch | 12 -- .../oprofile/oprofile/include_limits.patch | 17 --- .../recipes-kernel/oprofile/oprofile/musl.patch | 46 -------- .../oprofile/oprofile-cross-compile-tests.patch | 98 --------------- .../oprofile/oprofile/root-home-dir.patch | 44 ------- meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb | 13 -- meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb | 75 ++++++++++++ 21 files changed, 637 insertions(+), 537 deletions(-) delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile.inc delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0002-Fix-configure-when-bin-sh-is-not-bash.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0003-Define-the-C-preprocessor-variable-to-improve-reprod.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0004-Use-BUILD_DATE-to-improve-reproducibility.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0005-Add-rmb-definition-for-NIOS2-architecture.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0006-replace-sym_iterator-0-with-sym_iterator.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0007-oprofile-doesn-t-want-GNU-levels-of-automake-strictn.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0008-include-linux-limits.h-for-MAX_INPUT.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/0010-oprofile-Determine-the-root-home-directory-dynamical.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/include_limits.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/musl.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch delete mode 100644 meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb create mode 100644 meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb (limited to 'meta-oe/recipes-kernel') diff --git a/meta-oe/recipes-kernel/oprofile/oprofile.inc b/meta-oe/recipes-kernel/oprofile/oprofile.inc deleted file mode 100644 index 0863a8fd3..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile.inc +++ /dev/null @@ -1,67 +0,0 @@ -SUMMARY = "System-Wide Profiler" -DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \ -of profiling all running code at low overhead." -HOMEPAGE = "http://oprofile.sourceforge.net/news/" -BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191" - -LICENSE = "LGPLv2.1+ & GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \ - " -SECTION = "devel" - -DEPENDS = "popt binutils" -RDEPENDS_${PN} = "binutils-symlinks" - -FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}" -FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la" -FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a" - -SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ - file://acinclude.m4 \ - file://automake-foreign.patch \ - file://oprofile-cross-compile-tests.patch \ - file://run-ptest \ - file://root-home-dir.patch \ - file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \ - file://0001-replace-sym_iterator-0-with-sym_iterator.patch \ - file://0001-Use-new-bfd-APIs-from-2.34.patch \ - file://include_limits.patch \ -" -UPSTREAM_CHECK_REGEX = "oprofile-(?P\d+(\.\d+)+)/" -UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" - -SRC_URI_append_libc-musl = " file://musl.patch \ -" - -inherit autotools pkgconfig ptest - -EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC=" -do_configure () { - cp ${WORKDIR}/acinclude.m4 ${S}/ - autotools_do_configure -} - -EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests" -do_compile_ptest() { - oe_runmake check -} - -do_install_ptest() { - subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests " - for tooltest in ${subdirs} - do - find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH} - done - - # needed by some libop tests - cp -r events ${D}${PTEST_PATH} - - # needed by libregex regex_test - cp libregex/stl.pat ${D}${PTEST_PATH}/libregex - cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests - - # needed by litutil++ file_manip_tests - cp ${S}/libutil++/tests/file_manip_tests.cpp \ - libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests -} diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch deleted file mode 100644 index ae8562a23..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 34b0d9b1a32fb404a30327a7ae8931c7c75583bf Mon Sep 17 00:00:00 2001 -From: Marek Vasut -Date: Tue, 9 Feb 2016 02:00:29 +0100 -Subject: [PATCH] Add rmb() definition for NIOS2 architecture - -Signed-off-by: Marek Vasut -Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ] ---- - libperf_events/operf_utils.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h -index 32954cc..8270e53 100644 ---- a/libperf_events/operf_utils.h -+++ b/libperf_events/operf_utils.h -@@ -178,6 +178,11 @@ void op_release_resources(void); - #define cpu_relax() asm volatile("" ::: "memory") - #endif - -+#ifdef __nios2__ -+#define rmb() asm volatile("" ::: "memory") -+#define cpu_relax() asm volatile("" ::: "memory") -+#endif -+ - #ifdef __tile__ - #include - #define rmb() __insn_mf() --- -2.7.0 - diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch new file mode 100644 index 000000000..61191220e --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-build-with-musl.patch @@ -0,0 +1,55 @@ +From 5ed9bda8baf7465172a99ff86ed7f46397b06c7f Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko +Date: Sat, 5 Sep 2020 14:41:30 +0300 +Subject: [PATCH 01/10] Fix build with musl + +--Signature=_Sat__5_Sep_2020_14_41_30_+0300_B.qpPPwu83bbA.32 +Content-Type: text/plain; charset=US-ASCII +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +When musl is used instead of glibc, oprofile build fails because it +uses glibc-specific FTW extension: FTW_ACTIONRETVAL for custom +__delete_old_previous_sample_data return codes and FTW_STOP, +FTW_CONTINUE for such return codes. Musl supports only POSIX ftw, so +build fails. + +However, this extension is not really needed by oprofile, because +FTW_SKIP_* are not used and {FTW_STOP,FTW_CONTINUE} can be handled +by standard return codes {1,0} (more precisely standard defines +{!0,0}, but in glibc FTW_STOP = 1, so I keep this value). + +Upstream-Status: Backport [https://sourceforge.net/p/oprofile/oprofile/ci/5ed9bda8baf7465172a99ff86ed7f46397b06c7f/] +Signed-off-by: Andrew Savchenko +--- + pe_profiling/operf.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp +index 06a0ea3c..00834409 100644 +--- a/pe_profiling/operf.cpp ++++ b/pe_profiling/operf.cpp +@@ -860,9 +860,9 @@ static int __delete_old_previous_sample_data(const char *fpath, + { + if (remove(fpath)) { + perror("sample data removal error"); +- return FTW_STOP; ++ return 1; + } else { +- return FTW_CONTINUE; ++ return 0; + } + } + +@@ -897,7 +897,7 @@ static void convert_sample_data(void) + return; + + if (!operf_options::append) { +- int flags = FTW_DEPTH | FTW_ACTIONRETVAL; ++ int flags = FTW_DEPTH; + errno = 0; + if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 && + errno != ENOENT) { +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch deleted file mode 100644 index faf56d116..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 34745fb066a266ae6bbb15d08466d4d2cb6a2110 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 20 Feb 2020 08:11:04 -0800 -Subject: [PATCH] Use new bfd APIs from 2.34+ - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - libutil++/bfd_support.cpp | 10 +++++----- - opjitconv/create_bfd.c | 6 +++--- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp -index fa904839..e53a1530 100644 ---- a/libutil++/bfd_support.cpp -+++ b/libutil++/bfd_support.cpp -@@ -137,7 +137,7 @@ static bool get_build_id(bfd * ibfd, unsigned char * build_id) - } - } - -- bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect); -+ bfd_size_type buildid_sect_size = bfd_section_size(sect); - char * contents = (char *) xmalloc(buildid_sect_size); - errno = 0; - if (!bfd_get_section_contents(ibfd, sect, -@@ -188,7 +188,7 @@ bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32) - if (sect == NULL) - return false; - -- bfd_size_type debuglink_size = bfd_section_size(ibfd, sect); -+ bfd_size_type debuglink_size = bfd_section_size(sect); - char * contents = (char *) xmalloc(debuglink_size); - cverb << vbfd - << ".gnu_debuglink section has size " << debuglink_size << endl; -@@ -346,7 +346,7 @@ void fixup_linenr(bfd * abfd, asection * section, asymbol ** syms, - // first restrict the search on a sensible range of vma, 16 is - // an intuitive value based on epilog code look - size_t max_search = 16; -- size_t section_size = bfd_section_size(abfd, section); -+ size_t section_size = bfd_section_size(section); - if (pc + max_search > section_size) - max_search = section_size - pc; - -@@ -819,10 +819,10 @@ find_nearest_line(bfd_info const & b, op_bfd_symbol const & sym, - else - pc = (sym.value() + offset) - sym.filepos(); - -- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) -+ if ((bfd_section_flags(section) & SEC_ALLOC) == 0) - goto fail; - -- if (pc >= bfd_section_size(abfd, section)) -+ if (pc >= bfd_section_size(section)) - goto fail; - - ret = bfd_find_nearest_line(abfd, section, syms, pc, &cfilename, -diff --git a/opjitconv/create_bfd.c b/opjitconv/create_bfd.c -index 48db143b..5c0e9152 100644 ---- a/opjitconv/create_bfd.c -+++ b/opjitconv/create_bfd.c -@@ -86,12 +86,12 @@ asection * create_section(bfd * abfd, char const * section_name, - bfd_perror("bfd_make_section"); - goto error; - } -- bfd_set_section_vma(abfd, section, vma); -- if (bfd_set_section_size(abfd, section, size) == FALSE) { -+ bfd_set_section_vma(section, vma); -+ if (bfd_set_section_size(section, size) == FALSE) { - bfd_perror("bfd_set_section_size"); - goto error; - } -- if (bfd_set_section_flags(abfd, section, flags) == FALSE) { -+ if (bfd_set_section_flags(section, flags) == FALSE) { - bfd_perror("bfd_set_section_flags"); - goto error; - } --- -2.25.1 - diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch deleted file mode 100644 index 5fd23f809..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch +++ /dev/null @@ -1,131 +0,0 @@ -From b7c1a2e2b0f4657fe291324ca409224f3321c9ff Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 12 Feb 2019 11:58:34 -0800 -Subject: [PATCH] replace (sym_iterator)0 with sym_iterator() - -clang/libc++ find this error - -libpp/xml_utils.cpp:409:43: error: calling a private constructor of class 'std::__1::__wrap_iter' -| { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;} -| ^ -| - -default constructed iterator isn't supposed to be used for anything - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - libpp/xml_utils.cpp | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/libpp/xml_utils.cpp b/libpp/xml_utils.cpp -index 3de41e5..f45d3ae 100644 ---- a/libpp/xml_utils.cpp -+++ b/libpp/xml_utils.cpp -@@ -73,7 +73,7 @@ void dump_symbol(string const & prefix, sym_iterator it, bool want_nl = true) - - void dump_symbols(string const & prefix, sym_iterator b, sym_iterator e) - { -- if (b == (sym_iterator)0) -+ if (b == sym_iterator()) - return; - - for (sym_iterator it = b; it != e; ++it) -@@ -167,7 +167,7 @@ string xml_utils::get_profile_header(string cpu_name, double const speed) - } - - str << init_attr(CPU_NAME, cpu_type) << endl; -- if (processor.size() > 0) -+ if (processor.size() > 0) - str << init_attr(PROCESSOR, string(processor)) << endl; - if (nr_cpus > 1) str << init_attr(SEPARATED_CPUS, nr_cpus) << endl; - str << init_attr(MHZ, speed) << endl; -@@ -320,11 +320,11 @@ void xml_utils::build_subclasses(ostream & out) - (*sc_ptr)[new_index].subclass_name = subclass_name; - out << open_element(CLASS, true); - out << init_attr(NAME, subclass_name); -- if (nr_cpus > 1) -+ if (nr_cpus > 1) - out << init_attr(CPU_NUM, pclass.ptemplate.cpu); -- if (nr_events > 1) -+ if (nr_events > 1) - out << init_attr(EVENT_NUM, event); -- if (has_nonzero_masks) -+ if (has_nonzero_masks) - out << init_attr(EVENT_MASK, pclass.ptemplate.unitmask); - out << close_element(); - } -@@ -406,7 +406,7 @@ xml_utils::output_summary_data(ostream & out, count_array_t const & summary, siz - class module_info { - public: - module_info() -- { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;} -+ { lo = hi = 0; name = ""; begin = end = sym_iterator();} - void dump(); - void build_module(string const & n, sym_iterator it, - size_t l, size_t h); -@@ -540,21 +540,21 @@ void module_info::add_to_summary(count_array_t const & counts) - - void module_info::set_begin(sym_iterator b) - { -- if (begin == (sym_iterator)0) -+ if (begin == sym_iterator()) - begin = b; - } - - - void module_info::set_end(sym_iterator e) - { -- if (end == (sym_iterator)0) -+ if (end == sym_iterator()) - end = e; - } - - - bool module_info::is_closed(string const & n) - { -- return (name == n) && end != (sym_iterator)0; -+ return (name == n) && end != sym_iterator(); - } - - -@@ -585,7 +585,7 @@ void module_info::output_summary(ostream & out) - - void module_info::output_symbols(ostream & out, bool is_module) - { -- if (begin == (sym_iterator)0) -+ if (begin == sym_iterator()) - return; - - for (sym_iterator it = begin; it != end; ++it) -@@ -606,7 +606,7 @@ void binary_info::close_binary(sym_iterator it) - void binary_info::dump() - { - cverb << vxml << "app_name=" << name << endl; -- if (begin != (sym_iterator)0) -+ if (begin != sym_iterator()) - dump_symbols(" ", begin, end); - - for (size_t i = 0; i < nr_modules; ++i) -@@ -648,7 +648,7 @@ add_module_symbol(string const & module, string const & app, - // mark end of enclosing binary symbols if there have been any - // NOTE: it is possible for the binary's symbols to follow its - // module symbols -- if (begin != (sym_iterator)0 && end == (sym_iterator)0) -+ if (begin != sym_iterator() && end == sym_iterator()) - set_end(it); - - // build the new module -@@ -718,7 +718,7 @@ summarize_processes(extra_images const & extra_found_images) - { - // add modules to the appropriate threads in the process hierarchy - for (sym_iterator it = symbols_begin ; it != symbols_end; ++it) { -- string binary = get_image_name((*it)->app_name, -+ string binary = get_image_name((*it)->app_name, - image_name_storage::int_filename, extra_found_images); - string module = get_image_name((*it)->image_name, - image_name_storage::int_filename, extra_found_images); --- -2.20.1 - diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0002-Fix-configure-when-bin-sh-is-not-bash.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0002-Fix-configure-when-bin-sh-is-not-bash.patch new file mode 100644 index 000000000..2ffdc8ae5 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0002-Fix-configure-when-bin-sh-is-not-bash.patch @@ -0,0 +1,40 @@ +From 91bedd280b8a3fb4665db627559abba960be4212 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko +Date: Sat, 5 Sep 2020 14:40:07 +0300 +Subject: [PATCH 02/10] Fix configure when /bin/sh is not bash + +--Signature=_Sat__5_Sep_2020_14_40_08_+0300_w+XY/NnD8_G.Kd1s +Content-Type: text/plain; charset=US-ASCII +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +When /bin/sh used by autoconf is not bash, e.g. dash, configure +fails because it uses bash-specific equality operator "==". + +Fix this problem by replacing "==" with POSIX "=" which is +sufficient for test where it is being used. + +Upstream-Status: Backport [https://sourceforge.net/p/oprofile/oprofile/ci/91bedd280b8a3fb4665db627559abba960be4212/] +Signed-off-by: Andrew Savchenko +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 05609f6e..f5fcd17d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -466,8 +466,8 @@ AX_COPY_IF_CHANGE(doc/xsl/catalog-1.xml, doc/xsl/catalog.xml) + + if ! test "x$enable_account_check" = "xyes"; then + : +-elif test "`getent passwd oprofile 2>/dev/null`" == "" || \ +- test "`getent group oprofile 2>/dev/null`" == ""; then ++elif test "`getent passwd oprofile 2>/dev/null`" = "" || \ ++ test "`getent group oprofile 2>/dev/null`" = ""; then + if test `id -u` != "0"; then + echo "Warning: The user account 'oprofile:oprofile' does not exist on the system." + echo " To profile JITed code, this special user account must exist." +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0003-Define-the-C-preprocessor-variable-to-improve-reprod.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0003-Define-the-C-preprocessor-variable-to-improve-reprod.patch new file mode 100644 index 000000000..923c39ae1 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0003-Define-the-C-preprocessor-variable-to-improve-reprod.patch @@ -0,0 +1,30 @@ +From 864e02eab12cdc523b2dcd3f7b87a27abc16eefc Mon Sep 17 00:00:00 2001 +From: Viktor Kleinik +Date: Sun, 7 Mar 2021 17:07:44 +0000 +Subject: [PATCH 03/10] Define the C preprocessor variable to improve reproducibility + +Define the C preprocessor variable BUILD_DATE, which can be used +as source for reproducible build date in case when +SOURCE_DATE_EPOCH environment variable is set. + +Upstream-Status: Backport [https://sourceforge.net/p/oprofile/oprofile/ci/864e02eab12cdc523b2dcd3f7b87a27abc16eefc/] +Signed-off-by: Viktor Kleinik +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index f5fcd17d..dc447f89 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -31,6 +31,7 @@ if test -n "$SOURCE_DATE_EPOCH" ; then + fi + dnl for the man page + DATE="`date $dateopt '+%a %d %B %Y'`" ++AC_DEFINE_UNQUOTED([BUILD_DATE], ["$DATE"], [Use reproducible build date]) + AC_SUBST(DATE) + + # Since we should not permanently alter user environment variables, we'll +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0004-Use-BUILD_DATE-to-improve-reproducibility.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0004-Use-BUILD_DATE-to-improve-reproducibility.patch new file mode 100644 index 000000000..0fcca2b68 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0004-Use-BUILD_DATE-to-improve-reproducibility.patch @@ -0,0 +1,63 @@ +From 7bef5b905abe36adfd4e4cc16bc830376f50e8f6 Mon Sep 17 00:00:00 2001 +From: Viktor Kleinik +Date: Sun, 7 Mar 2021 17:22:26 +0000 +Subject: [PATCH 04/10] Use BUILD_DATE to improve reproducibility + +The C preprocessor variable BUILD_DATE contains the actual +build date or some reproducible value. It depends on whether +SOURCE_DATE_EPOCH environment variable was set previously or not. +In this way, reproducibility can be improved when needed. + +Upstream-Status: Backport [https://sourceforge.net/p/oprofile/oprofile/ci/864e02eab12cdc523b2dcd3f7b87a27abc16eefc/] +Signed-off-by: Viktor Kleinik +--- + libutil/op_version.c | 2 +- + pe_counting/ocount.cpp | 4 ++-- + pe_profiling/operf.cpp | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libutil/op_version.c b/libutil/op_version.c +index 99a844e4..a257e9c4 100644 +--- a/libutil/op_version.c ++++ b/libutil/op_version.c +@@ -19,6 +19,6 @@ void show_version(char const * app_name) + { + /* Do not change the version format: it is documented in html doc */ + printf("%s: " PACKAGE " " VERSION " compiled on " +- __DATE__ " " __TIME__ "\n", app_name); ++ BUILD_DATE "\n", app_name); + exit(EXIT_SUCCESS); + } +diff --git a/pe_counting/ocount.cpp b/pe_counting/ocount.cpp +index 2470745d..ae89fe61 100644 +--- a/pe_counting/ocount.cpp ++++ b/pe_counting/ocount.cpp +@@ -660,8 +660,8 @@ static int _process_ocount_and_app_args(int argc, char * const argv[]) + __print_usage_and_exit(NULL); + break; + case 'v': +- cout << argv[0] << ": " << PACKAGE << " " << VERSION << " compiled on " << __DATE__ +- << " " << __TIME__ << endl; ++ cout << argv[0] << ": " << PACKAGE << " " << VERSION << " compiled on " ++ << BUILD_DATE << endl; + exit(EXIT_SUCCESS); + break; + default: +diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp +index 00834409..f0f9c209 100644 +--- a/pe_profiling/operf.cpp ++++ b/pe_profiling/operf.cpp +@@ -1342,8 +1342,8 @@ static int _process_operf_and_app_args(int argc, char * const argv[]) + __print_usage_and_exit(NULL); + break; + case 'v': +- cout << argv[0] << ": " << PACKAGE << " " << VERSION << " compiled on " << __DATE__ +- << " " << __TIME__ << endl; ++ cout << argv[0] << ": " << PACKAGE << " " << VERSION << " compiled on " ++ << BUILD_DATE << endl; + exit(EXIT_SUCCESS); + break; + default: +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0005-Add-rmb-definition-for-NIOS2-architecture.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0005-Add-rmb-definition-for-NIOS2-architecture.patch new file mode 100644 index 000000000..0fd850ff2 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0005-Add-rmb-definition-for-NIOS2-architecture.patch @@ -0,0 +1,31 @@ +From 3539d2ab392d3a3eecffeddac989016063b23713 Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Tue, 9 Feb 2016 02:00:29 +0100 +Subject: [PATCH 05/10] Add rmb() definition for NIOS2 architecture + +Signed-off-by: Marek Vasut +Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ] +Signed-off-by: Khem Raj +--- + libperf_events/operf_utils.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h +index 8afdbc22..8e17213e 100644 +--- a/libperf_events/operf_utils.h ++++ b/libperf_events/operf_utils.h +@@ -173,6 +173,11 @@ void op_release_resources(void); + #define cpu_relax() asm volatile("" ::: "memory") + #endif + ++#ifdef __nios2__ ++#define rmb() asm volatile("" ::: "memory") ++#define cpu_relax() asm volatile("" ::: "memory") ++#endif ++ + #ifdef __tile__ + #include + #define rmb() __insn_mf() +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0006-replace-sym_iterator-0-with-sym_iterator.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0006-replace-sym_iterator-0-with-sym_iterator.patch new file mode 100644 index 000000000..a8371f0af --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0006-replace-sym_iterator-0-with-sym_iterator.patch @@ -0,0 +1,131 @@ +From b126134f68f4a5bd826141be68337ac15a7c2c04 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 12 Feb 2019 11:58:34 -0800 +Subject: [PATCH 06/10] replace (sym_iterator)0 with sym_iterator() + +clang/libc++ find this error + +libpp/xml_utils.cpp:409:43: error: calling a private constructor of class 'std::__1::__wrap_iter' +| { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;} +| ^ +| + +default constructed iterator isn't supposed to be used for anything + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libpp/xml_utils.cpp | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/libpp/xml_utils.cpp b/libpp/xml_utils.cpp +index 3de41e58..f45d3ae2 100644 +--- a/libpp/xml_utils.cpp ++++ b/libpp/xml_utils.cpp +@@ -73,7 +73,7 @@ void dump_symbol(string const & prefix, sym_iterator it, bool want_nl = true) + + void dump_symbols(string const & prefix, sym_iterator b, sym_iterator e) + { +- if (b == (sym_iterator)0) ++ if (b == sym_iterator()) + return; + + for (sym_iterator it = b; it != e; ++it) +@@ -167,7 +167,7 @@ string xml_utils::get_profile_header(string cpu_name, double const speed) + } + + str << init_attr(CPU_NAME, cpu_type) << endl; +- if (processor.size() > 0) ++ if (processor.size() > 0) + str << init_attr(PROCESSOR, string(processor)) << endl; + if (nr_cpus > 1) str << init_attr(SEPARATED_CPUS, nr_cpus) << endl; + str << init_attr(MHZ, speed) << endl; +@@ -320,11 +320,11 @@ void xml_utils::build_subclasses(ostream & out) + (*sc_ptr)[new_index].subclass_name = subclass_name; + out << open_element(CLASS, true); + out << init_attr(NAME, subclass_name); +- if (nr_cpus > 1) ++ if (nr_cpus > 1) + out << init_attr(CPU_NUM, pclass.ptemplate.cpu); +- if (nr_events > 1) ++ if (nr_events > 1) + out << init_attr(EVENT_NUM, event); +- if (has_nonzero_masks) ++ if (has_nonzero_masks) + out << init_attr(EVENT_MASK, pclass.ptemplate.unitmask); + out << close_element(); + } +@@ -406,7 +406,7 @@ xml_utils::output_summary_data(ostream & out, count_array_t const & summary, siz + class module_info { + public: + module_info() +- { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;} ++ { lo = hi = 0; name = ""; begin = end = sym_iterator();} + void dump(); + void build_module(string const & n, sym_iterator it, + size_t l, size_t h); +@@ -540,21 +540,21 @@ void module_info::add_to_summary(count_array_t const & counts) + + void module_info::set_begin(sym_iterator b) + { +- if (begin == (sym_iterator)0) ++ if (begin == sym_iterator()) + begin = b; + } + + + void module_info::set_end(sym_iterator e) + { +- if (end == (sym_iterator)0) ++ if (end == sym_iterator()) + end = e; + } + + + bool module_info::is_closed(string const & n) + { +- return (name == n) && end != (sym_iterator)0; ++ return (name == n) && end != sym_iterator(); + } + + +@@ -585,7 +585,7 @@ void module_info::output_summary(ostream & out) + + void module_info::output_symbols(ostream & out, bool is_module) + { +- if (begin == (sym_iterator)0) ++ if (begin == sym_iterator()) + return; + + for (sym_iterator it = begin; it != end; ++it) +@@ -606,7 +606,7 @@ void binary_info::close_binary(sym_iterator it) + void binary_info::dump() + { + cverb << vxml << "app_name=" << name << endl; +- if (begin != (sym_iterator)0) ++ if (begin != sym_iterator()) + dump_symbols(" ", begin, end); + + for (size_t i = 0; i < nr_modules; ++i) +@@ -648,7 +648,7 @@ add_module_symbol(string const & module, string const & app, + // mark end of enclosing binary symbols if there have been any + // NOTE: it is possible for the binary's symbols to follow its + // module symbols +- if (begin != (sym_iterator)0 && end == (sym_iterator)0) ++ if (begin != sym_iterator() && end == sym_iterator()) + set_end(it); + + // build the new module +@@ -718,7 +718,7 @@ summarize_processes(extra_images const & extra_found_images) + { + // add modules to the appropriate threads in the process hierarchy + for (sym_iterator it = symbols_begin ; it != symbols_end; ++it) { +- string binary = get_image_name((*it)->app_name, ++ string binary = get_image_name((*it)->app_name, + image_name_storage::int_filename, extra_found_images); + string module = get_image_name((*it)->image_name, + image_name_storage::int_filename, extra_found_images); +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0007-oprofile-doesn-t-want-GNU-levels-of-automake-strictn.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0007-oprofile-doesn-t-want-GNU-levels-of-automake-strictn.patch new file mode 100644 index 000000000..5f9ff1b96 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0007-oprofile-doesn-t-want-GNU-levels-of-automake-strictn.patch @@ -0,0 +1,23 @@ +From fd35c343e67ca47f76d0769fce2881d5f7a027a9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 18 Mar 2021 00:48:34 -0700 +Subject: [PATCH 07/10] oprofile doesn't want GNU-levels of automake strictness + so tell it to be "foreign". + +Upstream-Status: Pending +Signed-off-by: Ross Burton +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -13,7 +13,7 @@ AC_PREREQ(2.13) + + AC_INIT([OProfile], [1.4.0]) + AC_CONFIG_SRCDIR([libop/op_config.h]) +-AM_INIT_AUTOMAKE ++AM_INIT_AUTOMAKE([foreign]) + AC_CONFIG_HEADERS(config.h) + + AC_CHECK_DECLS([basename], [], [], [[#include ]]) diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0008-include-linux-limits.h-for-MAX_INPUT.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0008-include-linux-limits.h-for-MAX_INPUT.patch new file mode 100644 index 000000000..32e79a0a4 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0008-include-linux-limits.h-for-MAX_INPUT.patch @@ -0,0 +1,30 @@ +From 33e945f31fee2d74a392eb79025c9477e12b590d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 18 Mar 2021 00:49:48 -0700 +Subject: [PATCH 08/10] include linux/limits.h for MAX_INPUT + +Fixes +op_pe_utils.cpp:533:19: error: 'MAX_INPUT' was not declared in this scope + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + libpe_utils/op_pe_utils.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libpe_utils/op_pe_utils.cpp b/libpe_utils/op_pe_utils.cpp +index 1ca4ce3a..c5d16a56 100644 +--- a/libpe_utils/op_pe_utils.cpp ++++ b/libpe_utils/op_pe_utils.cpp +@@ -11,6 +11,7 @@ + * + */ + ++#include + #include + #include + #include +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch new file mode 100644 index 000000000..e47882c9f --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch @@ -0,0 +1,113 @@ +From 3a942cfd7d2e92667313e189930f7d1733cf40d4 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 18 Mar 2021 00:59:20 -0700 +Subject: [PATCH 09/10] Prevent running check tests on host if cross compiling + +This patch enables running the 'make check' tests on the target +in a cross-compiled environment. If not cross-compiling, then 'make + check' builds and executes the tests; no change from this patch. +In a cross-compiling environment, the make variable CROSS_COMPILE is +set which bypasses assiging tests to the makekfile variable TESTS. +Since TESTS is empty, the 'make check' process never tries to run the +tests on the hosts. On the target, the tests must be run manually. + +Also, in the libutil++ tests, a makefile variable SRCDIR is passed into +the compilation phase, pointing to the runtime location of the test +'file-manip-tests'. The mechanism used for a host test, based on +'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the +makefile takes the path of SRCDIR from the build environment and not +from an expression based on the host path 'topdir'. + +Upstream-Status: Pending + +Signed-off-by: Dave Lerner +Signed-off-by: Khem Raj +--- + configure.ac | 1 + + libdb/tests/Makefile.am | 2 ++ + libop/tests/Makefile.am | 2 ++ + libregex/tests/Makefile.am | 2 ++ + libutil++/tests/Makefile.am | 4 ++++ + libutil/tests/Makefile.am | 2 ++ + 6 files changed, 13 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 520b18ed..108a84e4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -386,6 +386,7 @@ AC_ARG_ENABLE(account-check, + enable_account_check=$enableval, enable_account_check=yes) + + AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes") ++AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes") + + AC_SUBST(OP_CFLAGS) + AC_SUBST(OP_CXXFLAGS) +diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am +index 8a69003f..c933baf6 100644 +--- a/libdb/tests/Makefile.am ++++ b/libdb/tests/Makefile.am +@@ -13,4 +13,6 @@ check_PROGRAMS = db_test + db_test_SOURCES = db_test.c + db_test_LDADD = ../libodb.a ../../libutil/libutil.a + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am +index 8a79eb5d..6b90e997 100644 +--- a/libop/tests/Makefile.am ++++ b/libop/tests/Makefile.am +@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS} + mangle_tests_SOURCES = mangle_tests.c + mangle_tests_LDADD = ${COMMON_LIBS} + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} utf8_checker.sh ++endif +diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am +index 6f19838f..43e84946 100644 +--- a/libregex/tests/Makefile.am ++++ b/libregex/tests/Makefile.am +@@ -18,4 +18,6 @@ java_test_LDADD = \ + + EXTRA_DIST = mangled-name.in + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am +index 51af0313..dd63fbe2 100644 +--- a/libutil++/tests/Makefile.am ++++ b/libutil++/tests/Makefile.am +@@ -1,7 +1,9 @@ + + REALPATH= readlink -f + ++if ! CROSS_COMPILE + SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ ) ++endif + + AM_CPPFLAGS = \ + -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@ +@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS} + utility_tests_SOURCES = utility_tests.cpp + utility_tests_LDADD = ${COMMON_LIBS} + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am +index dfcd6eca..d8b51892 100644 +--- a/libutil/tests/Makefile.am ++++ b/libutil/tests/Makefile.am +@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a + string_tests_SOURCES = string_tests.c + string_tests_LDADD = ../libutil.a + ++if ! CROSS_COMPILE + TESTS = ${check_PROGRAMS} ++endif +-- +2.31.0 + diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0010-oprofile-Determine-the-root-home-directory-dynamical.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0010-oprofile-Determine-the-root-home-directory-dynamical.patch new file mode 100644 index 000000000..03ee5155c --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0010-oprofile-Determine-the-root-home-directory-dynamical.patch @@ -0,0 +1,46 @@ +From 60fb7579bac738809b1776dbcd95ccacf7413c57 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 18 Mar 2021 01:02:49 -0700 +Subject: [PATCH 10/10] oprofile: Determine the root home directory dynamically + +This commit detects the root home directory dynamically with changes to +the oprofile gui app source. + +The commit replaces an earlier fix that detected and adjusted a +'non-standard' root home directory at build time. The advantage of this +patch is that the oprofile tools are adjusted to the current run-time +path to ~root, not the build time path. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Dave Lerner +--- + doc/oprofile.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/doc/oprofile.xml ++++ b/doc/oprofile.xml +@@ -647,8 +647,8 @@ Following is a description of the must stop it in a controlled manner in order to process + the profile data it has collected. Use kill -SIGINT <operf-PID> + for this purpose. It is recommended that when running operf +- with this option, your current working directory should be /root or a subdirectory +- of /root to avoid storing sample data files in locations accessible by regular users. ++ with this option, your current working directory should be ~root or a subdirectory ++ of ~root to avoid storing sample data files in locations accessible by regular users. + + + +--- a/doc/oprofile.html ++++ b/doc/oprofile.html +@@ -1552,8 +1552,8 @@ Following is a description of the must stop it in a controlled manner in order to process + the profile data it has collected. Use kill -SIGINT <operf-PID> + for this purpose. It is recommended that when running operf +- with this option, your current working directory should be /root or a subdirectory +- of /root to avoid storing sample data files in locations accessible by regular users. ++ with this option, your current working directory should be ~root or a subdirectory ++ of ~root to avoid storing sample data files in locations accessible by regular users. +

+ +
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch deleted file mode 100644 index b9bb6c577..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch +++ /dev/null @@ -1,12 +0,0 @@ -oprofile doesn't want GNU-levels of automake strictness so tell it to be "foreign". - -Upstream-Status: Pending -Signed-off-by: Ross Burton - -diff --git a/configure.ac b/configure.ac -index 5740585..cf6c316 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -16 +16 @@ AC_CONFIG_SRCDIR([libop/op_config.h]) --AM_INIT_AUTOMAKE -+AM_INIT_AUTOMAKE([foreign]) diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/include_limits.patch b/meta-oe/recipes-kernel/oprofile/oprofile/include_limits.patch deleted file mode 100644 index 5aabfe78e..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/include_limits.patch +++ /dev/null @@ -1,17 +0,0 @@ -include linux/limits.h for MAX_INPUT - -Fixes -op_pe_utils.cpp:533:19: error: 'MAX_INPUT' was not declared in this scope - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- a/libpe_utils/op_pe_utils.cpp -+++ b/libpe_utils/op_pe_utils.cpp -@@ -11,6 +11,7 @@ - * - */ - -+#include - #include - #include - #include diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch b/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch deleted file mode 100644 index 51db40845..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch +++ /dev/null @@ -1,46 +0,0 @@ -Fix glibc-isms so that oprofile builds with musl. - -Patch taken from openwrt (https://github.com/openwrt-mirror/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch) - -Upstream-Status: Pending -Signed-off-by: Ross Burton - ---- a/pe_profiling/operf.cpp -+++ b/pe_profiling/operf.cpp -@@ -857,11 +857,14 @@ static int __delete_old_previous_sample_ - int tflag __attribute__((unused)), - struct FTW *ftwbuf __attribute__((unused))) - { -+ int err; -+ - if (remove(fpath)) { -+ err = errno; - perror("sample data removal error"); -- return FTW_STOP; -+ return err; - } else { -- return FTW_CONTINUE; -+ return 0; - } - } - -@@ -896,7 +899,7 @@ static void convert_sample_data(void) - return; - - if (!operf_options::append) { -- int flags = FTW_DEPTH | FTW_ACTIONRETVAL; -+ int flags = FTW_DEPTH; - errno = 0; - if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 && - errno != ENOENT) { ---- a/libop/op_events.c -+++ b/libop/op_events.c -@@ -83,7 +83,7 @@ static int parse_hex(char const * str) - static u64 parse_long_hex(char const * str) - { - u64 value; -- if (sscanf(str, "%Lx", &value) != 1) -+ if (sscanf(str, "0x%llx", &value) != 1) - parse_error("expected long hexadecimal value"); - - fflush(stderr); diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch deleted file mode 100644 index aefa9548e..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch +++ /dev/null @@ -1,98 +0,0 @@ -Prevent running check tests on host if cross compiling - -This patch enables running the 'make check' tests on the target -in a cross-compiled environment. If not cross-compiling, then 'make - check' builds and executes the tests; no change from this patch. -In a cross-compiling environment, the make variable CROSS_COMPILE is -set which bypasses assiging tests to the makekfile variable TESTS. -Since TESTS is empty, the 'make check' process never tries to run the -tests on the hosts. On the target, the tests must be run manually. - -Also, in the libutil++ tests, a makefile variable SRCDIR is passed into -the compilation phase, pointing to the runtime location of the test -'file-manip-tests'. The mechanism used for a host test, based on -'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the -makefile takes the path of SRCDIR from the build environment and not -from an expression based on the host path 'topdir'. - -Upstream-Status: Pending - -Signed-off-by: Dave Lerner - -diff --git a/configure.ac b/configure.ac -index 41ece64..ce5a16f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check, - enable_account_check=$enableval, enable_account_check=yes) - - AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes") -+AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes") - - AC_SUBST(OP_CFLAGS) - AC_SUBST(OP_CXXFLAGS) -diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am -index 8a69003..d820090 100644 ---- a/libdb/tests/Makefile.am -+++ b/libdb/tests/Makefile.am -@@ -13,4 +13,6 @@ check_PROGRAMS = db_test - db_test_SOURCES = db_test.c - db_test_LDADD = ../libodb.a ../../libutil/libutil.a - -+if ! CROSS_COMPILE - TESTS = ${check_PROGRAMS} -+endif -diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am -index 8a79eb5..6d417c4 100644 ---- a/libop/tests/Makefile.am -+++ b/libop/tests/Makefile.am -@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS} - mangle_tests_SOURCES = mangle_tests.c - mangle_tests_LDADD = ${COMMON_LIBS} - -+if ! CROSS_COMPILE - TESTS = ${check_PROGRAMS} utf8_checker.sh -+endif -diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am -index 6f19838..1d176f9 100644 ---- a/libregex/tests/Makefile.am -+++ b/libregex/tests/Makefile.am -@@ -18,4 +18,6 @@ java_test_LDADD = \ - - EXTRA_DIST = mangled-name.in - -+if ! CROSS_COMPILE - TESTS = ${check_PROGRAMS} -+endif -diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am -index 51af031..a01ea2d 100644 ---- a/libutil++/tests/Makefile.am -+++ b/libutil++/tests/Makefile.am -@@ -1,7 +1,9 @@ - - REALPATH= readlink -f - -+if ! CROSS_COMPILE - SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ ) -+endif - - AM_CPPFLAGS = \ - -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@ -@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS} - utility_tests_SOURCES = utility_tests.cpp - utility_tests_LDADD = ${COMMON_LIBS} - -+if ! CROSS_COMPILE - TESTS = ${check_PROGRAMS} -+endif -diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am -index dfcd6ec..e8831b5 100644 ---- a/libutil/tests/Makefile.am -+++ b/libutil/tests/Makefile.am -@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a - string_tests_SOURCES = string_tests.c - string_tests_LDADD = ../libutil.a - -+if ! CROSS_COMPILE - TESTS = ${check_PROGRAMS} -+endif diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch deleted file mode 100644 index 3eaf6a794..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch +++ /dev/null @@ -1,44 +0,0 @@ -oprofile: Determine the root home directory dynamically - -This commit detects the root home directory dynamically with changes to -the oprofile gui app source. - -The commit replaces an earlier fix that detected and adjusted a -'non-standard' root home directory at build time. The advantage of this -patch is that the oprofile tools are adjusted to the current run-time -path to ~root, not the build time path. - -Upstream-Status: Inappropriate [OE specific] - -Signed-off-by: Dave Lerner - -Index: oprofile-1.0.0/doc/oprofile.html -=================================================================== ---- oprofile-1.0.0.orig/doc/oprofile.html 2014-11-03 17:55:31.511034857 +0000 -+++ oprofile-1.0.0/doc/oprofile.html 2014-11-03 17:57:26.415037988 +0000 -@@ -1563,8 +1563,8 @@ - must stop it in a controlled manner in order to process - the profile data it has collected. Use kill -SIGINT <operf-PID> - for this purpose. It is recommended that when running operf -- with this option, your current working directory should be /root or a subdirectory -- of /root to avoid storing sample data files in locations accessible by regular users. -+ with this option, your current working directory should be ~root or a subdirectory -+ of ~root to avoid storing sample data files in locations accessible by regular users. -

- -
-Index: oprofile-1.0.0/doc/oprofile.xml -=================================================================== ---- oprofile-1.0.0.orig/doc/oprofile.xml 2014-11-03 17:55:31.515034857 +0000 -+++ oprofile-1.0.0/doc/oprofile.xml 2014-11-03 17:58:03.719039005 +0000 -@@ -654,8 +654,8 @@ - must stop it in a controlled manner in order to process - the profile data it has collected. Use kill -SIGINT <operf-PID> - for this purpose. It is recommended that when running operf -- with this option, your current working directory should be /root or a subdirectory -- of /root to avoid storing sample data files in locations accessible by regular users. -+ with this option, your current working directory should be ~root or a subdirectory -+ of ~root to avoid storing sample data files in locations accessible by regular users. - - - diff --git a/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb b/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb deleted file mode 100644 index 8242a835f..000000000 --- a/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb +++ /dev/null @@ -1,13 +0,0 @@ -require oprofile.inc - -COMPATIBLE_HOST_riscv64 = "null" -COMPATIBLE_HOST_riscv32 = "null" - -DEPENDS_append_powerpc64 = " libpfm4" -DEPENDS_append_powerpc64le = " libpfm4" - -SRC_URI[md5sum] = "bd998df5521ebedae31e71cd3fb6200b" -SRC_URI[sha256sum] = "95ded8bde1ec39922f0af015981a67aec63e025a501e4dc04cd65d38f73647e6" - -S = "${WORKDIR}/oprofile-${PV}" - diff --git a/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb b/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb new file mode 100644 index 000000000..7a1844682 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb @@ -0,0 +1,75 @@ +SUMMARY = "System-Wide Profiler" +DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \ +of profiling all running code at low overhead." +HOMEPAGE = "http://oprofile.sourceforge.net/news/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191" + +LICENSE = "LGPLv2.1+ & GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \ + " +SECTION = "devel" + +DEPENDS = "popt binutils" +DEPENDS_append_powerpc64 = " libpfm4" +DEPENDS_append_powerpc64le = " libpfm4" + +COMPATIBLE_HOST_riscv64 = "null" +COMPATIBLE_HOST_riscv32 = "null" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ + file://acinclude.m4 \ + file://run-ptest \ + file://0001-Fix-build-with-musl.patch \ + file://0002-Fix-configure-when-bin-sh-is-not-bash.patch \ + file://0003-Define-the-C-preprocessor-variable-to-improve-reprod.patch \ + file://0004-Use-BUILD_DATE-to-improve-reproducibility.patch \ + file://0005-Add-rmb-definition-for-NIOS2-architecture.patch \ + file://0006-replace-sym_iterator-0-with-sym_iterator.patch \ + file://0007-oprofile-doesn-t-want-GNU-levels-of-automake-strictn.patch \ + file://0008-include-linux-limits.h-for-MAX_INPUT.patch \ + file://0009-Prevent-running-check-tests-on-host-if-cross-compili.patch \ + file://0010-oprofile-Determine-the-root-home-directory-dynamical.patch \ +" +SRC_URI[sha256sum] = "7ba06f99d7c188389d20d1d5e53ee690c7733f87aa9af62bd664fa0ca235a412" + +UPSTREAM_CHECK_REGEX = "oprofile-(?P\d+(\.\d+)+)/" +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" + +inherit autotools pkgconfig ptest + +EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC=" +do_configure () { + cp ${WORKDIR}/acinclude.m4 ${S}/ + autotools_do_configure +} + +EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests" +do_compile_ptest() { + oe_runmake check +} + +do_install_ptest() { + subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests " + for tooltest in ${subdirs} + do + find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH} + done + + # needed by some libop tests + cp -r events ${D}${PTEST_PATH} + + # needed by libregex regex_test + cp libregex/stl.pat ${D}${PTEST_PATH}/libregex + cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests + + # needed by litutil++ file_manip_tests + cp ${S}/libutil++/tests/file_manip_tests.cpp \ + libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests +} + +RDEPENDS_${PN} = "binutils-symlinks" + +FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}" +FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la" +FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a" -- cgit v1.2.3-54-g00ecf