Index: head/devel/android-tools-simpleperf/Makefile =================================================================== --- head/devel/android-tools-simpleperf/Makefile (revision 422318) +++ head/devel/android-tools-simpleperf/Makefile (revision 422319) @@ -1,60 +1,53 @@ # $FreeBSD$ PORTNAME= android-tools-simpleperf DISTVERSIONPREFIX= android- -DISTVERSION= n-preview-1-116 -DISTVERSIONSUFFIX= -gea4a5a4 +DISTVERSION= 7.0.0_r1 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org COMMENT= Android simpleperf tool -LICENSE= APACHE20 PD -LICENSE_COMB= multi -LICENSE_FILE_PD= ${WRKSRC}/lzma/NOTICE +LICENSE= APACHE20 BUILD_DEPENDS= llvm-config${LLVM_VER}:devel/llvm${LLVM_VER} USE_GITHUB= yes -GH_ACCOUNT= android:bionic,core jbeich:DEFAULT,lzma +GH_ACCOUNT= android:bionic,core jbeich GH_PROJECT= platform_bionic:bionic platform_system_core:core \ - platform_system_extras platform_external_lzma:lzma -GH_MYTAG= ${DISTVERSIONPREFIX}${DISTVERSION:C/-[0-9]*$//} -GH_TAGNAME= ${GH_MYTAG}-249-g5f1de52:bionic \ - ${GH_MYTAG}-554-g371e7ea170d7:core \ - ${GH_MYTAG}-6-ge43f249:lzma -GH_SUBDIR= bionic:bionic lzma:lzma + platform_system_extras +GH_SUBDIR= bionic:bionic USES= compiler:c++11-lib uidfix BUILD_WRKSRC= ${WRKSRC}/simpleperf INSTALL_WRKSRC= ${BUILD_WRKSRC} TEST_WRKSRC= ${BUILD_WRKSRC} MAKEFILE= ${FILESDIR}/Makefile MAKE_ENV= BINDIR="${PREFIX}/bin" LLVM_CONFIG="llvm-config${LLVM_VER}" ALL_TARGET= all TEST_TARGET= test LDFLAGS+= -Wl,--as-needed # avoid overlinking (llvm deps) PLIST_FILES= bin/simpleperf LLVM_VER?= 38 # XXX Move to DEFAULT_VERSIONS OPTIONS_DEFINE= TEST TEST_BUILD_DEPENDS= googletest>=1.6.0:devel/googletest TEST_ALL_TARGET= simpleperf_test post-extract: # Adjust paths relative to extras @(cd ${WRKSRC_core} && ${COPYTREE_SHARE} . ${WRKSRC}) post-patch: # XXX C++ exception with description "regex_error" thrown in the test body. @if [ ${OPSYS} = FreeBSD -a ${OSREL:R} -lt 10 ]; then \ ${REINPLACE_CMD} -Ee '/^TEST/\ s/ (LOG|PLOG|UNIMPLEMENTED)/ DISABLED_\1/' \ ${WRKSRC}/base/logging_test.cpp; \ fi pre-install-TEST-on: do-test .include Index: head/devel/android-tools-simpleperf/distinfo =================================================================== --- head/devel/android-tools-simpleperf/distinfo (revision 422318) +++ head/devel/android-tools-simpleperf/distinfo (revision 422319) @@ -1,8 +1,7 @@ -SHA256 (jbeich-platform_system_extras-android-n-preview-1-116-gea4a5a4_GH0.tar.gz) = 6bfedb3758797d21c901daff05f3b0a29785e5cee241ceeb9a14524e7166676d -SIZE (jbeich-platform_system_extras-android-n-preview-1-116-gea4a5a4_GH0.tar.gz) = 76583329 -SHA256 (android-platform_bionic-android-n-preview-1-249-g5f1de52_GH0.tar.gz) = f82cc222e0de014fa8752b622073af6be748136a5aefd498a171b34948cc5785 -SIZE (android-platform_bionic-android-n-preview-1-249-g5f1de52_GH0.tar.gz) = 3492411 -SHA256 (android-platform_system_core-android-n-preview-1-554-g371e7ea170d7_GH0.tar.gz) = 6672ae5e1088335f2f721b357f178163c19259abe38a8b307ebb0c8b37b291cb -SIZE (android-platform_system_core-android-n-preview-1-554-g371e7ea170d7_GH0.tar.gz) = 1536079 -SHA256 (jbeich-platform_external_lzma-android-n-preview-1-6-ge43f249_GH0.tar.gz) = 176f7ad8c41794e144da17d3263e4a95b13528b9a425e80882e9ee4cbe2e5f9a -SIZE (jbeich-platform_external_lzma-android-n-preview-1-6-ge43f249_GH0.tar.gz) = 704323 +TIMESTAMP = 1472009581 +SHA256 (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = ff2ea6db032da70374edcd6867bd11d765a475a32d732b983d0dad6ae16e209b +SIZE (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = 79621110 +SHA256 (android-platform_bionic-android-7.0.0_r1_GH0.tar.gz) = 60c75732796cffeff2006f63d556abb7af462939cdc710ff79edf56d26535d74 +SIZE (android-platform_bionic-android-7.0.0_r1_GH0.tar.gz) = 3514221 +SHA256 (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = faa44f626dfab9e604f509cc541a8e491e7e46a9de42df3a9c1e24c36fd9f8c4 +SIZE (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = 1570346 Index: head/devel/android-tools-simpleperf/files/patch-libcutils_threads.c =================================================================== --- head/devel/android-tools-simpleperf/files/patch-libcutils_threads.c (revision 422318) +++ head/devel/android-tools-simpleperf/files/patch-libcutils_threads.c (nonexistent) @@ -1,32 +0,0 @@ ---- libcutils/threads.c.orig 2015-06-17 22:20:38 UTC -+++ libcutils/threads.c -@@ -29,6 +29,14 @@ - #include - #elif defined(_WIN32) - #include -+#elif defined(__DragonFly__) -+#include -+#elif defined(__FreeBSD__) -+#include -+#elif defined(__NetBSD__) -+#include -+#else -+#include - #endif - - // No definition needed for Android because we'll just pick up bionic's copy. -@@ -40,6 +48,14 @@ pid_t gettid() { - return syscall(__NR_gettid); - #elif defined(_WIN32) - return GetCurrentThreadId(); -+#elif defined(__DragonFly__) -+ return lwp_gettid(); -+#elif defined(__NetBSD__) -+ return _lwp_self(); -+#elif defined(__FreeBSD__) -+ return pthread_getthreadid_np(); -+#else -+ return (intptr_t) pthread_self(); - #endif - } - #endif // __ANDROID__ Property changes on: head/devel/android-tools-simpleperf/files/patch-libcutils_threads.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-simpleperf/files/patch-liblog_logd__write.c =================================================================== --- head/devel/android-tools-simpleperf/files/patch-liblog_logd__write.c (revision 422318) +++ head/devel/android-tools-simpleperf/files/patch-liblog_logd__write.c (nonexistent) @@ -1,12 +0,0 @@ ---- liblog/logd_write.c.orig 2015-05-27 20:24:08 UTC -+++ liblog/logd_write.c -@@ -22,7 +22,9 @@ - #include - #endif - #include -+#if (FAKE_LOG_DEVICE == 0) - #include -+#endif - #include - #include - #include Property changes on: head/devel/android-tools-simpleperf/files/patch-liblog_logd__write.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-simpleperf/files/Makefile =================================================================== --- head/devel/android-tools-simpleperf/files/Makefile (revision 422318) +++ head/devel/android-tools-simpleperf/files/Makefile (revision 422319) @@ -1,126 +1,107 @@ # $FreeBSD$ PROG_CXX=simpleperf NO_MAN= BINDIR?=/usr/bin SRCS+= callchain.cpp SRCS+= cmd_dumprecord.cpp SRCS+= cmd_help.cpp SRCS+= cmd_report.cpp SRCS+= command.cpp SRCS+= dso.cpp SRCS+= event_attr.cpp SRCS+= event_type.cpp SRCS+= main.cpp SRCS+= perf_regs.cpp SRCS+= read_apk.cpp SRCS+= read_elf.cpp SRCS+= record.cpp SRCS+= record_file_reader.cpp SRCS+= sample_tree.cpp SRCS+= thread_tree.cpp SRCS+= utils.cpp TEST_SRCS+= cmd_report_test.cpp TEST_SRCS+= command_test.cpp TEST_SRCS+= gtest_main.cpp TEST_SRCS+= read_apk_test.cpp TEST_SRCS+= read_elf_test.cpp TEST_SRCS+= record_test.cpp TEST_SRCS+= sample_tree_test.cpp .PATH: ${.CURDIR}/nonlinux_support SRCS+= nonlinux_support.cpp # required by simpleperf .PATH: ${.CURDIR}/../base SRCS+= file.cpp SRCS+= logging.cpp SRCS+= stringprintf.cpp SRCS+= strings.cpp TEST_SRCS+= file_test.cpp TEST_SRCS+= logging_test.cpp TEST_SRCS+= stringprintf_test.cpp TEST_SRCS+= strings_test.cpp TEST_SRCS+= test_utils.cpp # required by base .PATH: ${.CURDIR}/../liblog +SRCS+= config_write.c SRCS+= fake_log_device.c -SRCS+= logd_write.c -CPPFLAGS.logd_write.c+= -DFAKE_LOG_DEVICE=1 +SRCS+= fake_writer.c +SRCS+= logger_lock.c +SRCS+= logger_name.c +SRCS+= logger_write.c +CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1 -# required by base -.PATH: ${.CURDIR}/../libcutils -SRCS+= threads.c - # required by libziparchive .PATH: ${.CURDIR}/../libutils SRCS+= FileMap.cpp # required by simpleperf .PATH: ${.CURDIR}/../libziparchive SRCS+= zip_archive.cc -# required by simpleperf -.PATH: ${.CURDIR}/../lzma/C -SRCS+= 7zCrc.c -SRCS+= 7zCrcOpt.c -SRCS+= Bra86.c -SRCS+= Bra.c -SRCS+= BraIA64.c -SRCS+= CpuArch.c -SRCS+= Delta.c -SRCS+= Lzma2Dec.c -SRCS+= LzmaDec.c -SRCS+= Sha256.c -SRCS+= Xz.c -SRCS+= XzCrc64.c -SRCS+= XzCrc64Opt.c -SRCS+= XzDec.c - -CPPFLAGS+= -D_7ZIP_ST CPPFLAGS+= -D_WITH_GETLINE CPPFLAGS+= -DUSE_BIONIC_UAPI_HEADERS CPPFLAGS+= -Doff64_t=off_t CPPFLAGS+= -Dftruncate64=ftruncate CPPFLAGS+= -Dlseek64=lseek CPPFLAGS+= -Dmmap64=mmap CPPFLAGS+= -Dpread64=pread CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/nonlinux_support/include CPPFLAGS+= -I${.CURDIR}/../include CPPFLAGS+= -I${.CURDIR}/../base/include CPPFLAGS+= -I${.CURDIR}/../bionic/libc/kernel -CPPFLAGS+= -I${.CURDIR}/../lzma/C CPPFLAGS+= $$(${LLVM_CONFIG} --cppflags) CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} CXXFLAGS+= -std=gnu++11 .ifndef COMPILE.c CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif TEST_CPPFLAGS+= $$(${GTEST_CONFIG} --cppflags) .for f in ${TEST_SRCS} CPPFLAGS.${f}+= ${TEST_CPPFLAGS} .endfor LDADD+= $$(${LLVM_CONFIG} --system-libs --libs --ldflags) TEST_LDADD+= $$(${GTEST_CONFIG} --libs --ldflags) TEST_OBJS+= ${TEST_SRCS:R:S/$/.o/} CLEANFILES+= ${PROG}_test ${TEST_OBJS} LLVM_CONFIG?= llvm-config GTEST_CONFIG?= gtest-config .include test: ${PROG}_test @for f in ${.ALLSRC}; do ./$$f -t ${.CURDIR}/testdata; done ${PROG}_test: ${OBJS:Nmain.o} ${TEST_OBJS} ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} Index: head/devel/android-tools-simpleperf/files/patch-base_file.cpp =================================================================== --- head/devel/android-tools-simpleperf/files/patch-base_file.cpp (revision 422318) +++ head/devel/android-tools-simpleperf/files/patch-base_file.cpp (revision 422319) @@ -1,10 +1,11 @@ ---- base/file.cpp.orig 2015-08-12 23:28:08 UTC +--- base/file.cpp.orig 2016-08-08 21:10:17 UTC +++ base/file.cpp -@@ -21,6 +21,7 @@ +@@ -21,6 +21,8 @@ #include #include ++#include // BUFSIZ +#include // strerror #include - #include "base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Index: head/devel/android-tools-simpleperf/files/patch-base_logging.cpp =================================================================== --- head/devel/android-tools-simpleperf/files/patch-base_logging.cpp (revision 422318) +++ head/devel/android-tools-simpleperf/files/patch-base_logging.cpp (revision 422319) @@ -1,48 +1,50 @@ ---- base/logging.cpp.orig 2015-08-12 23:28:08 UTC +--- base/logging.cpp.orig 2016-08-08 21:10:17 UTC +++ base/logging.cpp -@@ -23,12 +23,14 @@ - #include +@@ -25,7 +25,7 @@ + #include // For getprogname(3) or program_invocation_short_name. -#if defined(__ANDROID__) || defined(__APPLE__) +#if !defined(_WIN32) && !defined(__GLIBC__) #include #elif defined(__GLIBC__) #include +@@ -35,6 +35,8 @@ + #include #endif -+#include // strlen ++#include // strrchr +#include // fprintf #include #include #include -@@ -66,6 +68,14 @@ +@@ -71,6 +72,14 @@ #include #elif defined(_WIN32) #include +#elif defined(__DragonFly__) +#include +#elif defined(__FreeBSD__) +#include +#elif defined(__NetBSD__) +#include +#else +#include #endif - static pid_t GetThreadId() { -@@ -77,6 +89,14 @@ static pid_t GetThreadId() { + #if defined(_WIN32) +@@ -88,6 +97,14 @@ static thread_id GetThreadId() { return syscall(__NR_gettid); #elif defined(_WIN32) return GetCurrentThreadId(); +#elif defined(__DragonFly__) + return lwp_gettid(); +#elif defined(__NetBSD__) + return _lwp_self(); +#elif defined(__FreeBSD__) + return pthread_getthreadid_np(); +#else + return (intptr_t) pthread_self(); #endif } Index: head/devel/android-tools-simpleperf/files/patch-base_stringprintf__test.cpp =================================================================== --- head/devel/android-tools-simpleperf/files/patch-base_stringprintf__test.cpp (revision 422318) +++ head/devel/android-tools-simpleperf/files/patch-base_stringprintf__test.cpp (revision 422319) @@ -1,10 +1,10 @@ ---- base/stringprintf_test.cpp.orig 2015-08-12 23:28:08 UTC +--- base/stringprintf_test.cpp.orig 2015-09-17 22:58:36 UTC +++ base/stringprintf_test.cpp @@ -18,6 +18,7 @@ #include +#include #include TEST(StringPrintfTest, HexSizeT) { Index: head/devel/android-tools-simpleperf/files/patch-liblog_logger__write.c =================================================================== --- head/devel/android-tools-simpleperf/files/patch-liblog_logger__write.c (nonexistent) +++ head/devel/android-tools-simpleperf/files/patch-liblog_logger__write.c (revision 422319) @@ -0,0 +1,16 @@ +--- liblog/logger_write.c.orig 2016-04-16 00:01:39 UTC ++++ liblog/logger_write.c +@@ -15,12 +15,12 @@ + */ + + #include +-#include + #include + #include + #include + + #ifdef __BIONIC__ ++#include + #include + #endif + Property changes on: head/devel/android-tools-simpleperf/files/patch-liblog_logger__write.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-simpleperf/files/patch-simpleperf_gtest__main.cpp =================================================================== --- head/devel/android-tools-simpleperf/files/patch-simpleperf_gtest__main.cpp (nonexistent) +++ head/devel/android-tools-simpleperf/files/patch-simpleperf_gtest__main.cpp (revision 422319) @@ -0,0 +1,22 @@ +libc++ fails with higher default. + + [ RUN ] logging.LOG + base/logging_test.cpp:162: Failure + Expected: (output.length()) > (strlen("foobar")), actual: 0 vs 6 + [ FAILED ] logging.LOG (1 ms) + [ RUN ] logging.PLOG + base/logging_test.cpp:252: Failure + Expected: (output.length()) > (strlen("foobar")), actual: 0 vs 6 + [ FAILED ] logging.PLOG (0 ms) + +--- simpleperf/gtest_main.cpp 2016-06-28 07:04:19.000000000 +0000 ++++ simpleperf/gtest_main.cpp +@@ -137,7 +137,7 @@ class SavedPerfHardenProperty { + int main(int argc, char** argv) { + InitLogging(argv, android::base::StderrLogger); + testing::InitGoogleTest(&argc, argv); +- android::base::LogSeverity log_severity = android::base::WARNING; ++ android::base::LogSeverity log_severity = android::base::GetMinimumLogSeverity(); + + for (int i = 1; i < argc; ++i) { + if (strcmp(argv[i], "-t") == 0 && i + 1 < argc) { Property changes on: head/devel/android-tools-simpleperf/files/patch-simpleperf_gtest__main.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-simpleperf/pkg-descr =================================================================== --- head/devel/android-tools-simpleperf/pkg-descr (revision 422318) +++ head/devel/android-tools-simpleperf/pkg-descr (revision 422319) @@ -1,2 +1,7 @@ -simpleperf is a minimal Linux perf implementation for extracting -sampling information out of perf.data. +Simpleperf is a native profiling tool for Android. Its command-line +interface supports broadly the same options as the linux-tools perf, +but also supports various Android-specific improvements. + +This package only provides subcommands to read perf.data. + +WWW: https://android.googlesource.com/platform/prebuilts/simpleperf/