linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Stephane Eranian <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, dsahern@gmail.com,
	peterz@infradead.org, hpa@zytor.com, johnmccutchan@google.com,
	ak@linux.intel.com, mingo@kernel.org, namhyung@kernel.org,
	cel@us.ibm.com, jolsa@redhat.com, acme@redhat.com,
	eranian@google.com, sukadev@linux.vnet.ibm.com,
	pawel.moll@arm.com, sonnyrao@chromium.org,
	adrian.hunter@intel.com, tglx@linutronix.de
Subject: [tip:perf/core] perf build: Add libcrypto feature detection
Date: Tue, 9 Feb 2016 04:14:58 -0800	[thread overview]
Message-ID: <tip-8ee4646038e47d065d35703e3e343136c4cd42aa@git.kernel.org> (raw)
In-Reply-To: <1448874143-7269-3-git-send-email-eranian@google.com>

Commit-ID:  8ee4646038e47d065d35703e3e343136c4cd42aa
Gitweb:     http://git.kernel.org/tip/8ee4646038e47d065d35703e3e343136c4cd42aa
Author:     Stephane Eranian <eranian@google.com>
AuthorDate: Mon, 30 Nov 2015 10:02:21 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 5 Feb 2016 09:46:45 -0300

perf build: Add libcrypto feature detection

Will be used to generate build-ids in the jitdump code.

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Carl Love <cel@us.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John McCutchan <johnmccutchan@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sonny Rao <sonnyrao@chromium.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1448874143-7269-3-git-send-email-eranian@google.com
[ tools/perf/Makefile.perf comment about NO_LIBCRYPTO and added it to tests/make ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature         |  2 ++
 tools/build/feature/Makefile         |  4 ++++
 tools/build/feature/test-all.c       |  5 +++++
 tools/build/feature/test-libcrypto.c | 17 +++++++++++++++++
 tools/perf/Makefile.perf             |  3 +++
 tools/perf/config/Makefile           | 11 +++++++++++
 tools/perf/tests/make                |  2 ++
 7 files changed, 44 insertions(+)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 7bff2ea..6b77072 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -46,6 +46,7 @@ FEATURE_TESTS_BASIC :=			\
 	libpython			\
 	libpython-version		\
 	libslang			\
+	libcrypto			\
 	libunwind			\
 	pthread-attr-setaffinity-np	\
 	stackprotector-all		\
@@ -87,6 +88,7 @@ FEATURE_DISPLAY ?=			\
 	libperl				\
 	libpython			\
 	libslang			\
+	libcrypto			\
 	libunwind			\
 	libdw-dwarf-unwind		\
 	zlib				\
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index bf8f035..c5f4c41 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -23,6 +23,7 @@ FILES=					\
 	test-libpython.bin		\
 	test-libpython-version.bin	\
 	test-libslang.bin		\
+	test-libcrypto.bin		\
 	test-libunwind.bin		\
 	test-libunwind-debug-frame.bin	\
 	test-pthread-attr-setaffinity-np.bin	\
@@ -105,6 +106,9 @@ $(OUTPUT)test-libaudit.bin:
 $(OUTPUT)test-libslang.bin:
 	$(BUILD) -I/usr/include/slang -lslang
 
+$(OUTPUT)test-libcrypto.bin:
+	$(BUILD) -lcrypto
+
 $(OUTPUT)test-gtk2.bin:
 	$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
 
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 81025ca..e499a36 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -129,6 +129,10 @@
 # include "test-bpf.c"
 #undef main
 
+#define main main_test_libcrypto
+# include "test-libcrypto.c"
+#undef main
+
 int main(int argc, char *argv[])
 {
 	main_test_libpython();
@@ -158,6 +162,7 @@ int main(int argc, char *argv[])
 	main_test_lzma();
 	main_test_get_cpuid();
 	main_test_bpf();
+	main_test_libcrypto();
 
 	return 0;
 }
diff --git a/tools/build/feature/test-libcrypto.c b/tools/build/feature/test-libcrypto.c
new file mode 100644
index 0000000..bd79dc7
--- /dev/null
+++ b/tools/build/feature/test-libcrypto.c
@@ -0,0 +1,17 @@
+#include <openssl/sha.h>
+#include <openssl/md5.h>
+
+int main(void)
+{
+	MD5_CTX context;
+	unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH];
+	unsigned char dat[] = "12345";
+
+	MD5_Init(&context);
+	MD5_Update(&context, &dat[0], sizeof(dat));
+	MD5_Final(&md[0], &context);
+
+	SHA1(&dat[0], sizeof(dat), &md[0]);
+
+	return 0;
+}
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 0ef3d97..d404117 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -58,6 +58,9 @@ include config/utilities.mak
 #
 # Define NO_LIBBIONIC if you do not want bionic support
 #
+# Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support
+# used for generating build-ids for ELFs generated by jitdump.
+#
 # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support
 # for dwarf backtrace post unwind.
 #
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 0045a5d..f7aeaf3 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -404,6 +404,17 @@ ifndef NO_LIBAUDIT
   endif
 endif
 
+ifndef NO_LIBCRYPTO
+  ifneq ($(feature-libcrypto), 1)
+    msg := $(warning No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev);
+    NO_LIBCRYPTO := 1
+  else
+    CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
+    EXTLIBS += -lcrypto
+    $(call detected,CONFIG_CRYPTO)
+  endif
+endif
+
 ifdef NO_NEWT
   NO_SLANG=1
 endif
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 12dcae7..cac15d9 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -80,6 +80,7 @@ make_no_libaudit    := NO_LIBAUDIT=1
 make_no_libbionic   := NO_LIBBIONIC=1
 make_no_auxtrace    := NO_AUXTRACE=1
 make_no_libbpf	    := NO_LIBBPF=1
+make_no_libcrypto   := NO_LIBCRYPTO=1
 make_tags           := tags
 make_cscope         := cscope
 make_help           := help
@@ -103,6 +104,7 @@ make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
 make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
 make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
 make_minimal        += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
+make_minimal        += NO_LIBCRYPTO=1
 
 # $(run) contains all available tests
 run := make_pure

  parent reply	other threads:[~2016-02-09 12:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30  9:02 [PATCH v8 0/4] perf: add support for profiling jitted code Stephane Eranian
2015-11-30  9:02 ` [PATCH v8 1/4] perf tools: add Java demangling support Stephane Eranian
2016-02-09 12:14   ` [tip:perf/core] perf symbols: " tip-bot for Stephane Eranian
2015-11-30  9:02 ` [PATCH v8 2/4] perf inject: add jitdump mmap injection support Stephane Eranian
2016-01-22 20:44   ` Arnaldo Carvalho de Melo
2016-01-22 21:22     ` Stephane Eranian
     [not found]       ` <20160122215542.GK4034@kernel.org>
     [not found]         ` <20160122220929.GL4034@kernel.org>
2016-01-22 22:10           ` Arnaldo Carvalho de Melo
2016-02-04 21:53       ` Arnaldo Carvalho de Melo
2016-02-04 23:02         ` Stephane Eranian
2016-02-05 13:47           ` Arnaldo Carvalho de Melo
2016-02-05 13:51             ` Arnaldo Carvalho de Melo
2016-02-05 13:57               ` Arnaldo Carvalho de Melo
2016-02-05 14:24                 ` Arnaldo Carvalho de Melo
2016-02-08 18:53                   ` Stephane Eranian
2016-02-11 22:16                     ` Arnaldo Carvalho de Melo
2016-02-12 20:32                       ` Stephane Eranian
2016-02-12 20:43                         ` Arnaldo Carvalho de Melo
2016-02-15  2:16                           ` Stephane Eranian
2016-02-15 17:14                             ` Arnaldo Carvalho de Melo
2016-02-09 12:14   ` tip-bot for Stephane Eranian [this message]
2016-02-09 12:15   ` [tip:perf/core] perf inject: Make sure mmap records are ordered when injecting build_ids tip-bot for Arnaldo Carvalho de Melo
2016-02-09 12:15   ` [tip:perf/core] perf inject: Add jitdump mmap injection support tip-bot for Stephane Eranian
2015-11-30  9:02 ` [PATCH v8 3/4] perf tools: add JVMTI agent library Stephane Eranian
2016-02-09 12:16   ` [tip:perf/core] " tip-bot for Stephane Eranian
2015-11-30  9:02 ` [PATCH v8 4/4] perf/jit: add source line info support Stephane Eranian
2016-02-09 12:16   ` [tip:perf/core] perf jit: " tip-bot for Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-8ee4646038e47d065d35703e3e343136c4cd42aa@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=cel@us.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=johnmccutchan@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=peterz@infradead.org \
    --cc=sonnyrao@chromium.org \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).