Index: head/java/Makefile =================================================================== --- head/java/Makefile (revision 437451) +++ head/java/Makefile (revision 437452) @@ -1,125 +1,126 @@ # $FreeBSD$ # COMMENT = Java language support SUBDIR += aparapi SUBDIR += avis SUBDIR += berkeley-db SUBDIR += bluej SUBDIR += bootstrap-openjdk SUBDIR += bouncycastle SUBDIR += bouncycastle15 SUBDIR += cacao SUBDIR += castor SUBDIR += classpath SUBDIR += cos SUBDIR += cryptix-jce SUBDIR += dbvis SUBDIR += eclipse SUBDIR += eclipse-EPIC SUBDIR += eclipse-cdt SUBDIR += eclipse-drjava SUBDIR += eclipse-ecj SUBDIR += eclipse-findbugs SUBDIR += eclipse-log4e SUBDIR += eclipse-lomboz SUBDIR += eclipse-pydev SUBDIR += eclipse-shelled SUBDIR += eclipse-windowbuilder SUBDIR += hamcrest SUBDIR += icedtea-web SUBDIR += infobus SUBDIR += intellij SUBDIR += intellij-fsnotifier SUBDIR += intellij-pty4j SUBDIR += intellij-pycharm SUBDIR += intellij-rubymine SUBDIR += intellij-ultimate SUBDIR += jad SUBDIR += jaf SUBDIR += jai SUBDIR += jakarta-bcel SUBDIR += jakarta-commons-beanutils SUBDIR += jakarta-commons-cli SUBDIR += jakarta-commons-codec SUBDIR += jakarta-commons-collections SUBDIR += jakarta-commons-dbcp SUBDIR += jakarta-commons-discovery SUBDIR += jakarta-commons-httpclient SUBDIR += jakarta-commons-lang SUBDIR += jakarta-commons-logging SUBDIR += jakarta-commons-pool SUBDIR += jakarta-commons-primitives SUBDIR += jakarta-oro SUBDIR += jakarta-regexp SUBDIR += jamvm SUBDIR += jasmin SUBDIR += java-checkstyle SUBDIR += java-cup SUBDIR += java-getopt SUBDIR += java-subversion SUBDIR += java-zoneinfo SUBDIR += java3d SUBDIR += javahelp SUBDIR += javamail SUBDIR += javavmwrapper SUBDIR += jaxen SUBDIR += jcalendar SUBDIR += jcckit SUBDIR += jcommon SUBDIR += jd-gui SUBDIR += jdbcpool SUBDIR += jdk8-doc SUBDIR += jdom SUBDIR += jflex SUBDIR += jfreechart SUBDIR += jgraph SUBDIR += jgrapht SUBDIR += jgraphx SUBDIR += jikes SUBDIR += jlex SUBDIR += jlint SUBDIR += jmf SUBDIR += jode SUBDIR += jomp SUBDIR += jrosetta SUBDIR += jta SUBDIR += jtiger SUBDIR += jump SUBDIR += junit SUBDIR += jxgrabkey SUBDIR += langspec + SUBDIR += lightweight-java-profiler SUBDIR += linux-oracle-jdk18 SUBDIR += linux-oracle-jre18 SUBDIR += mmake SUBDIR += mx4j SUBDIR += netbeans SUBDIR += netbeans-devel SUBDIR += netcomponents SUBDIR += netrexx SUBDIR += netty SUBDIR += openjdk6 SUBDIR += openjdk6-jre SUBDIR += openjdk7 SUBDIR += openjdk7-jre SUBDIR += openjdk8 SUBDIR += openjdk8-jre SUBDIR += openjfx8-devel SUBDIR += phpeclipse SUBDIR += proguard SUBDIR += sablevm SUBDIR += sablevm-classpath SUBDIR += servingxml SUBDIR += sigar SUBDIR += springframework SUBDIR += springframework31 SUBDIR += sqlitejdbc SUBDIR += trove4j SUBDIR += veditor SUBDIR += visualvm SUBDIR += wildfly10 SUBDIR += wildfly90 SUBDIR += xdoclet .include Index: head/java/lightweight-java-profiler/Makefile =================================================================== --- head/java/lightweight-java-profiler/Makefile (nonexistent) +++ head/java/lightweight-java-profiler/Makefile (revision 437452) @@ -0,0 +1,47 @@ +# Created by: Johannes Dieterich +# $FreeBSD$ + +PORTNAME= lightweight-java-profiler +PORTVERSION= g20170308 +CATEGORIES= java devel + +MAINTAINER= jmd@FreeBSD.org +COMMENT= Lightweight Java profiler which can be used for flamegraphs + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/COPYING + +BUILD_DEPENDS= bash>=0:shells/bash +RUN_DEPENDS= bash>=0:shells/bash + +ONLY_FOR_ARCHS= amd64 i386 +ONLY_FOR_ARCHS_REASON= assembly only available for x86 + +USE_GITHUB= yes +GH_ACCOUNT= inevity +GH_TAGNAME= e8041b5 + +USE_JAVA= yes +JAVA_VERSION= 1.8 + +USE_LDCONFIG= yes +USES= gmake shebangfix + +SHEBANG_FILES= Makefile + +MAKE_ENV= JAVA_HOME=${LOCALBASE}/openjdk8 + +.include + +.if ${ARCH} == "i386" +MAKE_ENV+= BITS=32 +.else +MAKE_ENV+= BITS=64 +.endif + +PLIST_FILES= lib/liblagent.so + +do-install: + ${INSTALL_LIB} ${WRKSRC}/build/liblagent.so ${STAGEDIR}/${LOCALBASE}/lib/liblagent.so + +.include Property changes on: head/java/lightweight-java-profiler/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/java/lightweight-java-profiler/distinfo =================================================================== --- head/java/lightweight-java-profiler/distinfo (nonexistent) +++ head/java/lightweight-java-profiler/distinfo (revision 437452) @@ -0,0 +1,3 @@ +TIMESTAMP = 1490927903 +SHA256 (inevity-lightweight-java-profiler-g20170308-e8041b5_GH0.tar.gz) = b5a64716586407ff69c3c77a0621e6b65e9580686ae9ec29b145becd65fa678e +SIZE (inevity-lightweight-java-profiler-g20170308-e8041b5_GH0.tar.gz) = 16120 Property changes on: head/java/lightweight-java-profiler/distinfo ___________________________________________________________________ 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/java/lightweight-java-profiler/files/patch-Makefile =================================================================== --- head/java/lightweight-java-profiler/files/patch-Makefile (nonexistent) +++ head/java/lightweight-java-profiler/files/patch-Makefile (revision 437452) @@ -0,0 +1,41 @@ +--- Makefile.orig 2017-03-31 01:58:22 UTC ++++ Makefile +@@ -1,7 +1,7 @@ +-SHELL:=/bin/bash ++SHELL:=/usr/bin/env bash + UNAME:=$(shell uname | tr '[A-Z]' '[a-z]') + +-BITS?=32 ++#BITS?=32 + ifeq ($(UNAME), darwin) + READLINK_ARGS:="" + PLATFORM_WARNINGS:=-Weverything -Wno-c++98-compat-pedantic -Wno-padded \ +@@ -23,6 +23,13 @@ else ifeq ($(UNAME), linux) + HEADERS:=include + CC=g++ + LDFLAGS=-Wl,--fatal-warnings ++else ifeq ($(UNAME), freebsd) ++ READLINK_ARGS:="" ++ PLATFORM_WARNINGS:=-Weverything -Wno-c++98-compat-pedantic -Wno-padded \ ++ -Wno-missing-prototypes ++ PLATFORM_COPTS:=-std=c++11 ++ HEADERS:=include ++ LDFLAGS=-Wl,-fatal_warnings + endif + + JAVA_HOME := $(shell \ +@@ -32,11 +39,11 @@ JAVA_HOME := $(shell \ + [[ -n "$${JAVA_HOME}" ]] || (echo "Cannot find JAVA_HOME" && exit) ; \ + echo $${JAVA_HOME}) + AGENT=liblagent.so +-LIBS=-ldl +-BUILD_DIR ?= $(shell mkdir build-$(BITS) 2> /dev/null ; echo build-$(BITS)) ++LIBS=-lc ++BUILD_DIR ?= $(shell mkdir build 2> /dev/null ; echo build) + SRC_DIR:=${PWD}/src + OPT?=-O2 +-GLOBAL_WARNINGS=-Wall -Werror -Wformat-security -Wno-char-subscripts \ ++GLOBAL_WARNINGS=-Wall -Wformat-security -Wno-char-subscripts \ + -Wno-sign-compare -Wno-strict-overflow -Wwrite-strings -Wnon-virtual-dtor \ + -Woverloaded-virtual + GLOBAL_COPTS=-fdiagnostics-show-option -fno-exceptions \ Property changes on: head/java/lightweight-java-profiler/files/patch-Makefile ___________________________________________________________________ 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/java/lightweight-java-profiler/files/patch-src_display.cc =================================================================== --- head/java/lightweight-java-profiler/files/patch-src_display.cc (nonexistent) +++ head/java/lightweight-java-profiler/files/patch-src_display.cc (revision 437452) @@ -0,0 +1,11 @@ +--- src/display.cc.orig 2015-04-15 08:00:23 UTC ++++ src/display.cc +@@ -20,7 +20,7 @@ void StackTracesPrinter::PrintStackTrace + if (traces[i].count != 0) { + total += traces[i].count; + count++; +- fprintf(file_, "%"PRIdPTR" ", traces[i].count); ++ fprintf(file_, "%" PRIdPTR" ", traces[i].count); + PrintStackTrace(&traces[i]); + fprintf(file_, "\n"); + } Property changes on: head/java/lightweight-java-profiler/files/patch-src_display.cc ___________________________________________________________________ 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/java/lightweight-java-profiler/files/patch-src_entry.cc =================================================================== --- head/java/lightweight-java-profiler/files/patch-src_entry.cc (nonexistent) +++ head/java/lightweight-java-profiler/files/patch-src_entry.cc (revision 437452) @@ -0,0 +1,20 @@ +--- src/entry.cc.orig 2015-04-15 08:00:23 UTC ++++ src/entry.cc +@@ -182,7 +182,7 @@ static void SetFileFromOption(char *equa + if (Globals::OutFile == NULL) { + fprintf(stderr, "Could not open file %s: ", file_name); + perror(NULL); +- exit(1); ++ _exit(1); + } + } + +@@ -207,7 +207,7 @@ static void ParseArguments(char *options + char path[PATH_MAX]; + if (getcwd(path, PATH_MAX) == NULL) { + fprintf(stderr, "cwd too long?\n"); +- exit(0); ++ _exit(0); + } + size_t pathlen = strlen(path); + strncat(path, "/", PATH_MAX - (pathlen++)); Property changes on: head/java/lightweight-java-profiler/files/patch-src_entry.cc ___________________________________________________________________ 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/java/lightweight-java-profiler/files/patch-src_globals.h =================================================================== --- head/java/lightweight-java-profiler/files/patch-src_globals.h (nonexistent) +++ head/java/lightweight-java-profiler/files/patch-src_globals.h (revision 437452) @@ -0,0 +1,23 @@ +--- src/globals.h.orig 2015-04-15 08:00:23 UTC ++++ src/globals.h +@@ -179,18 +179,13 @@ class Accessors { + #endif + }; + +-#if defined(__GNUC__) && (defined(i386) || defined(__x86_64)) + #if defined(__x86_64__) + #define __CAS_INSTR "lock; cmpxchgq %1,%2" + #define __ADD_INSTR "lock; xaddq %0,%1" +-#else // defined(__x86_64__) ++#else + #define __CAS_INSTR "lock; cmpxchgl %1,%2" + #define __ADD_INSTR "lock; xaddl %0,%1" +-#endif // defined(__x86_64__) +-#else // defined(__GNUC__) && (defined(i386) || defined(__x86_64)) +-#error \ +- "Cannot compile with non-x86. Add support for atomic ops, if you want it" +-#endif // defined(__GNUC__) && (defined(i386) || defined(__x86_64)) ++#endif + + inline intptr_t NoBarrier_CompareAndSwap(volatile intptr_t *ptr, + intptr_t old_value, Property changes on: head/java/lightweight-java-profiler/files/patch-src_globals.h ___________________________________________________________________ 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/java/lightweight-java-profiler/pkg-descr =================================================================== --- head/java/lightweight-java-profiler/pkg-descr (nonexistent) +++ head/java/lightweight-java-profiler/pkg-descr (revision 437452) @@ -0,0 +1,9 @@ +lightweight-java-profiler + +a lightweight Java profiler which can be used for flamegraphs + +The lightweight Java profiler acts as an agent library and generates +execution stacks. These can be fed into flamegraph utils to profile +Java applications at minimal cost. + +WWW: https://github.com/inevity/lightweight-java-profiler Property changes on: head/java/lightweight-java-profiler/pkg-descr ___________________________________________________________________ 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/java/lightweight-java-profiler/pkg-message =================================================================== --- head/java/lightweight-java-profiler/pkg-message (nonexistent) +++ head/java/lightweight-java-profiler/pkg-message (revision 437452) @@ -0,0 +1,3 @@ +To use the lightweight-java-profiler, you can invoke Java as follows: + +java -agentpath:path/to/liblagent.so[:file=fname] It will spit out stack traces into traces.txt (or into the optional fname passed to the agent). The current implementation samples every 1/100th of a second. It stores the first 3000 stack traces it encounters; additional stack traces will be ignored, but duplicate stack traces will continue to be counted indefinitely (or until the counter overflows, which will take a while). Property changes on: head/java/lightweight-java-profiler/pkg-message ___________________________________________________________________ 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