added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,55 @@
From 5ed9bda8baf7465172a99ff86ed7f46397b06c7f Mon Sep 17 00:00:00 2001
From: Andrew Savchenko <bircoph@gmail.com>
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 <bircoph@gmail.com>
---
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

View File

@@ -0,0 +1,34 @@
From 5d879cb4f23c613e16b3f479ab09bbb5ff340201 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 6 Feb 2023 17:02:41 -0800
Subject: [PATCH] Replace std::bind2nd with generic lambda
std::bind2nd is gone in c++17, therefore stop using it and replace it
with generic lambda from c++14 onwards
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
libutil++/growable_vector.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libutil++/growable_vector.h b/libutil++/growable_vector.h
index 350246a..9846e1e 100644
--- a/libutil++/growable_vector.h
+++ b/libutil++/growable_vector.h
@@ -93,9 +93,9 @@ public:
/// return true if all elements have the default constructed value
bool zero() const {
- return std::find_if(container.begin(), container.end(),
- std::bind2nd(std::not_equal_to<T>(), T()))
- == container.end();
+ return std::find_if(begin(container), end(container),
+ [&](auto const& elem) {return elem != T();})
+ == end(container);
}
private:
--
2.39.1

View File

@@ -0,0 +1,28 @@
From 46f0aadf80d5e28f587149b6e90c3ba005971f6e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 2 Sep 2022 19:22:17 -0700
Subject: [PATCH] configure: Include unistd.h for getpid API
This fixes the check for perf events support in configure
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index e4f4024..3384628 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,7 @@ if test "$kernel_may_have_perf_events_support" = "yes"; then
#include <asm/unistd.h>
#include <sys/types.h>
#include <string.h>
+ #include <unistd.h>
]],
[[struct perf_event_attr attr;
pid_t pid;
--
2.37.3

View File

@@ -0,0 +1,40 @@
From 91bedd280b8a3fb4665db627559abba960be4212 Mon Sep 17 00:00:00 2001
From: Andrew Savchenko <bircoph@gmail.com>
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 <bircoph@gmail.com>
---
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

View File

@@ -0,0 +1,30 @@
From 864e02eab12cdc523b2dcd3f7b87a27abc16eefc Mon Sep 17 00:00:00 2001
From: Viktor Kleinik <vkleinik@cisco.com>
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 <vkleinik@cisco.com>
---
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

View File

@@ -0,0 +1,63 @@
From 7bef5b905abe36adfd4e4cc16bc830376f50e8f6 Mon Sep 17 00:00:00 2001
From: Viktor Kleinik <vkleinik@cisco.com>
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 <vkleinik@cisco.com>
---
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

View File

@@ -0,0 +1,31 @@
From 3539d2ab392d3a3eecffeddac989016063b23713 Mon Sep 17 00:00:00 2001
From: Marek Vasut <marex@denx.de>
Date: Tue, 9 Feb 2016 02:00:29 +0100
Subject: [PATCH 05/10] Add rmb() definition for NIOS2 architecture
Signed-off-by: Marek Vasut <marex@denx.de>
Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
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 <asm/unistd.h>
#define rmb() __insn_mf()
--
2.31.0

View File

@@ -0,0 +1,131 @@
From b126134f68f4a5bd826141be68337ac15a7c2c04 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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<const sym
bol_entry *const *>'
| { 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 <raj.khem@gmail.com>
---
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

View File

@@ -0,0 +1,23 @@
From fd35c343e67ca47f76d0769fce2881d5f7a027a9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <ross.burton@intel.com>
---
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 <libgen.h>]])

View File

@@ -0,0 +1,30 @@
From 33e945f31fee2d74a392eb79025c9477e12b590d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <raj.khem@gmail.com>
---
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 <linux/limits.h>
#include <linux/perf_event.h>
#include <dirent.h>
#include <stdio.h>
--
2.31.0

View File

@@ -0,0 +1,113 @@
From 3a942cfd7d2e92667313e189930f7d1733cf40d4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <dave.lerner@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
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

View File

@@ -0,0 +1,46 @@
From 60fb7579bac738809b1776dbcd95ccacf7413c57 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <dave.lerner@windriver.com>
---
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 <comma
<emphasis>must</emphasis> stop it in a controlled manner in order to process
the profile data it has collected. Use <code>kill -SIGINT &lt;operf-PID&gt;</code>
for this purpose. It is recommended that when running <command>operf</command>
- with this option, your current working directory should be <filename>/root</filename> or a subdirectory
- of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users.
+ with this option, your current working directory should be <filename>~root</filename> or a subdirectory
+ of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users.
</para></listitem>
</varlistentry>
<varlistentry>
--- a/doc/oprofile.html
+++ b/doc/oprofile.html
@@ -1552,8 +1552,8 @@ Following is a description of the <span
<span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process
the profile data it has collected. Use <code class="code">kill -SIGINT &lt;operf-PID&gt;</code>
for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span>
- with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory
- of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users.
+ with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory
+ of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users.
</p>
</dd>
<dt>

View File

@@ -0,0 +1,581 @@
dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
dnl see if autoconf.h defines the option
AC_DEFUN([AX_KERNEL_OPTION], [
SAVE_CFLAGS=$CFLAGS
CFLAGS="-I$KINC -O2 -D__KERNEL__"
AC_TRY_COMPILE( [#include <linux/config.h>],
[
#ifndef $1
break_me_hard(\\\);
#endif
],[$2],[$3],)
CFLAGS=$SAVE_CFLAGS
])
dnl Handle the 2.4 module inside module/
AC_DEFUN([AX_CONFIG_MODULE],
[
if test ! -f $KINC/linux/autoconf.h; then
AC_MSG_ERROR([no suitably configured kernel include tree found])
fi
dnl --- Get Linux kernel version and compile parameters ---
AC_SUBST(KVERS)
AC_MSG_CHECKING([for kernel version])
dnl it's like this to handle mandrake's fubar version.h - bug #471448
eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
AC_MSG_RESULT([$KVERS])
case "$KVERS" in
2.2.*|2.4.*) ;;
*) AC_MSG_ERROR([Unsupported kernel version])
esac
dnl Check for the minimal kernel version supported
AC_MSG_CHECKING([kernel version])
AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
dnl linux/spinlock.h added at some point in past
AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
if test -f $KINC/linux/spinlock.h; then
EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for rtc_lock])
gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
if test "$?" -eq 0; then
EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
arch="unknown"
AC_MSG_CHECKING(for x86-64 architecture)
AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
AX_MSG_RESULT_YN($x8664)
BUILD_HAMMER=no
if test "$x8664" -eq 1; then
arch="x86"
BUILD_HAMMER=yes
else
AC_MSG_CHECKING(for x86 architecture)
AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
AX_MSG_RESULT_YN($x86)
test "$x86" = 1 && arch="x86"
if test "$arch" = "unknown"; then
AC_MSG_CHECKING(for ia64 architecture)
AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
AX_MSG_RESULT_YN($ia64)
test "$ia64" = 1 && arch="ia64"
fi
fi
AC_SUBST(BUILD_HAMMER)
test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
dnl check to see if kernel verion appropriate for arch
AC_MSG_CHECKING(arch/kernel version combination)
case "$arch" in
ia64)
AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
AC_MSG_ERROR([unsupported arch/kernel])) ;;
*) AC_MSG_RESULT([ok])
esac
dnl for now we do not support PREEMPT patch
AC_MSG_CHECKING([for preempt patch])
AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
AX_MSG_RESULT_YN([$preempt])
test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
AC_SUBST(KINC)
MODINSTALLDIR=/lib/modules/$KVERS
OPROFILE_MODULE_ARCH=$arch
AC_SUBST(OPROFILE_MODULE_ARCH)
]
)
dnl AX_MSG_RESULT_YN(a)
dnl results "yes" iff a==1, "no" else
AC_DEFUN([AX_MSG_RESULT_YN], [x=no
test "x$1" = "x1" && x=yes
AC_MSG_RESULT($x)])
dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
AC_DEFUN([AX_MALLOC_ATTRIBUTE],
[
AC_MSG_CHECKING([whether malloc attribute is understood])
SAVE_CFLAGS=$CFLAGS
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE(,[
void monkey() __attribute__((malloc));
],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
CFLAGS=$SAVE_CFLAGS
]
)
dnl builtin_expect is used in module we can't add that in config.h
AC_DEFUN([AX_BUILTIN_EXPECT],
[
AC_MSG_CHECKING([whether __builtin_expect is understood])
SAVE_CFLAGS=$CFLAGS
CFLAGS="-Werror $CFLAGS"
AC_TRY_LINK(,[
int i;
if (__builtin_expect(i, 0)) { }
],
AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
AC_MSG_RESULT([no]);)
CFLAGS=$SAVE_CFLAGS
]
)
dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
AC_DEFUN([AX_EXTRA_DIRS],
[
AC_ARG_WITH(extra-includes,
[ --with-extra-includes=DIR add extra include paths],
use_extra_includes="$withval",
use_extra_includes=NO
)
if test -n "$use_extra_includes" && \
test "$use_extra_includes" != "NO"; then
ac_save_ifs=$IFS
IFS=':'
for dir in $use_extra_includes; do
extra_includes="$extra_includes -I$dir"
done
IFS=$ac_save_ifs
CPPFLAGS="$CPPFLAGS $extra_includes"
fi
AC_ARG_WITH(extra-libs,
[ --with-extra-libs=DIR add extra library paths],
use_extra_libs=$withval,
use_extra_libs=NO
)
if test -n "$use_extra_libs" && \
test "$use_extra_libs" != "NO"; then
ac_save_ifs=$IFS
IFS=':'
for dir in $use_extra_libs; do
extra_libraries="$extra_libraries -L$dir"
done
IFS=$ac_save_ifs
LDFLAGS="$LDFLAGS $extra_libraries"
fi
]
)
dnl AX_POPT_CONST - check popt prototype
AC_DEFUN([AX_POPT_CONST],
[
AC_MSG_CHECKING([popt prototype])
SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-Werror $CXXFLAGS"
AC_TRY_COMPILE([#include <popt.h>],
[
int c; char **v;
poptGetContext(0, c, v, 0, 0);
],
AC_MSG_RESULT([takes char **]);,
AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
CXXFLAGS="$SAVE_CXXFLAGS"
]
)
dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
AC_DEFUN([AX_CHECK_SSTREAM],
[
AC_MSG_CHECKING([whether to use included sstream])
AC_TRY_COMPILE([#include <sstream>], [],
AC_MSG_RESULT([no]);,
AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
]
)
dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
dnl exec action-if-true if typedef_name is a typedef to type else exec
dnl action-if-false
dnl currently work only with type typedef'ed in stddef.h
AC_DEFUN([AX_CHECK_TYPEDEF], [
dnl AC_LANG_PUSH(C) not in autoconf 2.13
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS=$CFLAGS
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE(
[
#include <stddef.h>
],
[
typedef void (*fct1)($1);
typedef void (*fct2)($2);
fct1 f1 = 0;
fct2 f2 = 0;
if (f1 == f2) {}
],
[$3],[$4])
CFLAGS=$SAVE_CFLAGS
AC_LANG_RESTORE
])
dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
dnl set var_name to the typedef name of $1 which must be in canditate_list
dnl else produce a fatal error
AC_DEFUN([AX_TYPEDEFED_NAME], [
AC_MSG_CHECKING([type of $1])
for f in $2; do
AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
if test -n "${$3}"; then
break
fi
done
if test -n "${$3}"; then
AC_MSG_RESULT([${$3}])
else
AC_MSG_ERROR([not found])
fi
])
dnl find a binary in the path
AC_DEFUN([QT_FIND_PATH],
[
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(qt_cv_path_$1,
[
qt_cv_path_$1="NONE"
if test -n "$$2"; then
qt_cv_path_$1="$$2";
else
dirs="$3"
qt_save_IFS=$IFS
IFS=':'
for dir in $PATH; do
dirs="$dirs $dir"
done
IFS=$qt_save_IFS
for dir in $dirs; do
if test -x "$dir/$1"; then
if test -n "$5"; then
evalstr="$dir/$1 $5 2>&1 "
if eval $evalstr; then
qt_cv_path_$1="$dir/$1"
break
fi
else
qt_cv_path_$1="$dir/$1"
break
fi
fi
done
fi
])
if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
AC_MSG_RESULT(not found)
$4
else
AC_MSG_RESULT($qt_cv_path_$1)
$2=$qt_cv_path_$1
fi
])
dnl Find the uic compiler on the path or in qt_cv_dir
AC_DEFUN([QT_FIND_UIC],
[
QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
if test -z "$ac_uic" -a "$FATAL" = 1; then
AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
fi
])
dnl Find the right moc in path/qt_cv_dir
AC_DEFUN([QT_FIND_MOC],
[
QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
if test -n "$ac_moc1" -a -n "$ac_moc2"; then
dnl found both. Prefer Qt3's if it exists else moc2
$ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
if test "$?" = 0; then
ac_moc=$ac_moc1;
else
ac_moc=$ac_moc2;
fi
else
if test -n "$ac_moc1"; then
ac_moc=$ac_moc1;
else
ac_moc=$ac_moc2;
fi
fi
if test -z "$ac_moc" -a "$FATAL" = 1; then
AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
fi
])
dnl check a particular libname
AC_DEFUN([QT_TRY_LINK],
[
SAVE_LIBS="$LIBS"
LIBS="$LIBS $1"
AC_TRY_LINK([
#include <qglobal.h>
#include <qstring.h>
],
[
QString s("mangle_failure");
#if (QT_VERSION < 221)
break_me_(\\\);
#endif
],
qt_cv_libname=$1,
)
LIBS="$SAVE_LIBS"
])
dnl check we can do a compile
AC_DEFUN([QT_CHECK_COMPILE],
[
AC_MSG_CHECKING([for Qt library name])
AC_CACHE_VAL(qt_cv_libname,
[
AC_LANG_CPLUSPLUS
SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
for libname in -lqt-mt -lqt3 -lqt2 -lqt;
do
QT_TRY_LINK($libname)
if test -n "$qt_cv_libname"; then
break;
fi
done
CXXFLAGS=$SAVE_CXXFLAGS
])
if test -z "$qt_cv_libname"; then
AC_MSG_RESULT([failed])
if test "$FATAL" = 1 ; then
AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
fi
else
AC_MSG_RESULT([$qt_cv_libname])
fi
])
dnl get Qt version we're using
AC_DEFUN([QT_GET_VERSION],
[
AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
[
AC_LANG_CPLUSPLUS
SAVE_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
#include "confdefs.h"
#include <qglobal.h>
"%%%"QT_VERSION_STR"%%%"
EOF
lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep '^"%%%"' 2>/dev/null | \
sed -e 's/"%%%"//g' -e 's/"//g'`
rm -f conftest.$ac_ext
CPPFLAGS=$SAVE_CPPFLAGS
])
QT_VERSION=$lyx_cv_qtversion
AC_SUBST(QT_VERSION)
])
dnl start here
AC_DEFUN([QT_DO_IT_ALL],
[
dnl Please leave this alone. I use this file in
dnl oprofile.
FATAL=0
AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ],
[ qt_cv_dir=`eval echo "$withval"/` ])
AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ],
[ qt_cv_includes=`eval echo "$withval"` ])
AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.],
[ qt_cv_libraries=`eval echo "$withval"` ])
dnl pay attention to $QTDIR unless overridden
if test -z "$qt_cv_dir"; then
qt_cv_dir=$QTDIR
fi
dnl derive inc/lib if needed
if test -n "$qt_cv_dir"; then
if test -z "$qt_cv_includes"; then
qt_cv_includes=$qt_cv_dir/include
fi
if test -z "$qt_cv_libraries"; then
qt_cv_libraries=$qt_cv_dir/lib
fi
fi
dnl flags for compilation
QT_INCLUDES=
QT_LDFLAGS=
if test -n "$qt_cv_includes"; then
QT_INCLUDES="-I$qt_cv_includes"
fi
if test -n "$qt_cv_libraries"; then
QT_LDFLAGS="-L$qt_cv_libraries"
fi
AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_LDFLAGS)
QT_FIND_MOC
MOC=$ac_moc
AC_SUBST(MOC)
QT_FIND_UIC
UIC=$ac_uic
AC_SUBST(UIC)
QT_CHECK_COMPILE
QT_LIB=$qt_cv_libname;
AC_SUBST(QT_LIB)
if test -n "$qt_cv_libname"; then
QT_GET_VERSION
fi
])
dnl AX_CXXFLAGS_OPTIONS(var-name, option)
dnl add option to var-name if $CXX support it.
AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
AC_MSG_CHECKING([whether ${CXX} support precompiled header])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
SAVE_CXXFLAGS=$CXXFLAGS
dnl we consider than if -Winvalid-pch is accepted pch will works ...
CXXFLAGS=-Winvalid-pch
dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
dnl the fact than some pch will be invalid for the given compilation option
AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
CXXFLAGS=$SAVE_CXXFLAGS
AC_LANG_RESTORE
])
dnl AX_CHECK_DOCBOOK
AC_DEFUN([AX_CHECK_DOCBOOK], [
# It's just rude to go over the net to build
XSLTPROC_FLAGS=--nonet
DOCBOOK_ROOT=
if test ! -f /etc/xml/catalog; then
for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
do
if test -d "$i"; then
DOCBOOK_ROOT=$i
fi
done
# Last resort - try net
if test -z "$DOCBOOK_ROOT"; then
XSLTPROC_FLAGS=
fi
else
XML_CATALOG=/etc/xml/catalog
CAT_ENTRY_START='<!--'
CAT_ENTRY_END='-->'
fi
AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
XSLTPROC_WORKS=no
if test -n "$XSLTPROC"; then
AC_MSG_CHECKING([whether xsltproc works])
if test -n "$XML_CATALOG"; then
DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
else
DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
fi
$XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<book id="test">
</book>
END
if test "$?" = 0; then
XSLTPROC_WORKS=yes
fi
AC_MSG_RESULT($XSLTPROC_WORKS)
fi
AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
AC_SUBST(XML_CATALOG)
AC_SUBST(XSLTPROC_FLAGS)
AC_SUBST(DOCBOOK_ROOT)
AC_SUBST(CAT_ENTRY_START)
AC_SUBST(CAT_ENTRY_END)
])
dnl AX_CFLAGS_OPTIONS(var-name, option)
dnl add option to var-name if $CC support it.
AC_DEFUN([AX_CFLAGS_OPTION], [
AC_MSG_CHECKING([whether ${CC} $2 is understood])
AC_LANG_SAVE
AC_LANG_C
SAVE_CFLAGS=$CFLAGS
CFLAGS=$2
AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
CFLAGS=$SAVE_CFLAGS
AC_LANG_RESTORE
])
dnl AX_CXXFLAGS_OPTIONS(var-name, option)
dnl add option to var-name if $CXX support it.
AC_DEFUN([AX_CXXFLAGS_OPTION], [
AC_MSG_CHECKING([whether ${CXX} $2 is understood])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS=$2
AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
CXXFLAGS=$SAVE_CXXFLAGS
AC_LANG_RESTORE
])
dnl AX_COPY_IF_CHANGE(source, dest)
dnl copy source to dest if they don't compare equally or if dest doesn't exist
AC_DEFUN([AX_COPY_IF_CHANGE], [
if test -r $2; then
if cmp $1 $2 > /dev/null; then
echo $2 is unchanged
else
cp -f $1 $2
fi
else
cp -f $1 $2
fi
])

View File

@@ -0,0 +1,19 @@
#!/bin/sh
saved_dir=$PWD
for dir in */tests ; do
cd $dir
for atest in * ; do
if [ \( -x $atest \) -a \( -f $atest \) ] ; then
./$atest > ${atest}.stdout 2> ${atest}.stderr
if [ $? = 0 ] ; then
echo "PASS: $dir $atest"
rm ${atest}.stdout ${atest}.stderr
else
echo "FAIL: ${dir}/${atest}"
fi
fi
done
cd $saved_dir
done

View File

@@ -0,0 +1,77 @@
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 = "LGPL-2.1-or-later & GPL-2.0-only"
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 \
file://0001-configure-Include-unistd.h-for-getpid-API.patch \
file://0001-Replace-std-bind2nd-with-generic-lambda.patch \
"
SRC_URI[sha256sum] = "7ba06f99d7c188389d20d1d5e53ee690c7733f87aa9af62bd664fa0ca235a412"
UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\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"