Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephane Eranian and committed by
Arnaldo Carvalho de Melo
8ee46460 e9c4bcdd

+44
+2
tools/build/Makefile.feature
··· 46 46 libpython \ 47 47 libpython-version \ 48 48 libslang \ 49 + libcrypto \ 49 50 libunwind \ 50 51 pthread-attr-setaffinity-np \ 51 52 stackprotector-all \ ··· 88 87 libperl \ 89 88 libpython \ 90 89 libslang \ 90 + libcrypto \ 91 91 libunwind \ 92 92 libdw-dwarf-unwind \ 93 93 zlib \
+4
tools/build/feature/Makefile
··· 23 23 test-libpython.bin \ 24 24 test-libpython-version.bin \ 25 25 test-libslang.bin \ 26 + test-libcrypto.bin \ 26 27 test-libunwind.bin \ 27 28 test-libunwind-debug-frame.bin \ 28 29 test-pthread-attr-setaffinity-np.bin \ ··· 105 104 106 105 $(OUTPUT)test-libslang.bin: 107 106 $(BUILD) -I/usr/include/slang -lslang 107 + 108 + $(OUTPUT)test-libcrypto.bin: 109 + $(BUILD) -lcrypto 108 110 109 111 $(OUTPUT)test-gtk2.bin: 110 112 $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
+5
tools/build/feature/test-all.c
··· 129 129 # include "test-bpf.c" 130 130 #undef main 131 131 132 + #define main main_test_libcrypto 133 + # include "test-libcrypto.c" 134 + #undef main 135 + 132 136 int main(int argc, char *argv[]) 133 137 { 134 138 main_test_libpython(); ··· 162 158 main_test_lzma(); 163 159 main_test_get_cpuid(); 164 160 main_test_bpf(); 161 + main_test_libcrypto(); 165 162 166 163 return 0; 167 164 }
+17
tools/build/feature/test-libcrypto.c
··· 1 + #include <openssl/sha.h> 2 + #include <openssl/md5.h> 3 + 4 + int main(void) 5 + { 6 + MD5_CTX context; 7 + unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; 8 + unsigned char dat[] = "12345"; 9 + 10 + MD5_Init(&context); 11 + MD5_Update(&context, &dat[0], sizeof(dat)); 12 + MD5_Final(&md[0], &context); 13 + 14 + SHA1(&dat[0], sizeof(dat), &md[0]); 15 + 16 + return 0; 17 + }
+3
tools/perf/Makefile.perf
··· 58 58 # 59 59 # Define NO_LIBBIONIC if you do not want bionic support 60 60 # 61 + # Define NO_LIBCRYPTO if you do not want libcrypto (openssl) support 62 + # used for generating build-ids for ELFs generated by jitdump. 63 + # 61 64 # Define NO_LIBDW_DWARF_UNWIND if you do not want libdw support 62 65 # for dwarf backtrace post unwind. 63 66 #
+11
tools/perf/config/Makefile
··· 404 404 endif 405 405 endif 406 406 407 + ifndef NO_LIBCRYPTO 408 + ifneq ($(feature-libcrypto), 1) 409 + msg := $(warning No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev); 410 + NO_LIBCRYPTO := 1 411 + else 412 + CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT 413 + EXTLIBS += -lcrypto 414 + $(call detected,CONFIG_CRYPTO) 415 + endif 416 + endif 417 + 407 418 ifdef NO_NEWT 408 419 NO_SLANG=1 409 420 endif
+2
tools/perf/tests/make
··· 80 80 make_no_libbionic := NO_LIBBIONIC=1 81 81 make_no_auxtrace := NO_AUXTRACE=1 82 82 make_no_libbpf := NO_LIBBPF=1 83 + make_no_libcrypto := NO_LIBCRYPTO=1 83 84 make_tags := tags 84 85 make_cscope := cscope 85 86 make_help := help ··· 104 103 make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 105 104 make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 106 105 make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 106 + make_minimal += NO_LIBCRYPTO=1 107 107 108 108 # $(run) contains all available tests 109 109 run := make_pure