Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 2 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,100 +35,32 @@ jobs:
- otp_version: 25

- otp_version: 24

- otp_version: 23

- otp_version: 22

- otp_version: 21
send_coverage: true
run_dialyzer: true

steps:
- uses: actions/checkout@v3

- if: matrix.old_rebar
run: echo "REBAR3=./rebar3" >> $GITHUB_ENV

- if: matrix.erl_hist
run: echo "XPROF_ERL_HIST=true" >> $GITHUB_ENV

- if: matrix.old_cowboy
run: echo "COWBOY_VERSION=1.1.2" >> $GITHUB_ENV

- name: Cache hex packages
uses: actions/cache@v3
with:
path: $HOME/.cache/rebar3
key: ${{ matrix.otp_version }}-rebar3-cache

# cowboy 2.7+ require OTP 20 and 2.11+ require OTP 24+. On OTP 19-23 pin to
# cowboy 2.6.3, last version that compiles fine on these old OTP versions.
- if: ${{ matrix.otp_version <= 23 && !matrix.old_cowboy }}
run: echo "COWBOY_VERSION=2.6.3" >> $GITHUB_ENV

- run: make test

- if: matrix.run_dialyzer
run: make dialyzer
timeout-minutes: 8

- if: matrix.send_coverage && success()
run: ./rebar3 as test coveralls send
run: make send_coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

# Same as the "test" job but for OTP 18-20, whose containers ship a glibc
# too old for the node20 runtime that actions/checkout and actions/cache
# now require. This job checks out with plain git and skips the cache.
test_legacy:
name: OTP ${{ matrix.otp_version }} (legacy)
runs-on: ubuntu-latest
container: erlang:${{ matrix.otp_version }}

strategy:
fail-fast: false
matrix:
include:
- otp_version: 20

- otp_version: 19

- otp_version: 19
erl_hist: true

- otp_version: 18
# old_rebar fails with "Package not found in registry: {<<"hdr_histogram">>,<<"0.5.0">>}."
# with hdr_histogram NIF: xprof_core_hist_SUITE: Segmentation fault (core dumped)
erl_hist: true
old_cowboy: true

steps:
- name: Checkout with git (avoids node-based actions on old glibc)
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git init -q
git remote add origin "https://github.com/${{ github.repository }}"
git fetch -q --depth 1 origin "${{ github.ref }}"
git checkout -q FETCH_HEAD

- if: matrix.old_rebar
run: echo "REBAR3=./rebar3" >> $GITHUB_ENV

- if: matrix.erl_hist
run: echo "XPROF_ERL_HIST=true" >> $GITHUB_ENV

- if: matrix.old_cowboy
run: echo "COWBOY_VERSION=1.1.2" >> $GITHUB_ENV

# cowboy 2.7+ require OTP 20 and 2.11+ require OTP 24+. On OTP 19-23 pin to
# cowboy 2.6.3, last version that compiles fine on these old OTP versions.
- if: ${{ matrix.otp_version <= 23 && !matrix.old_cowboy }}
run: echo "COWBOY_VERSION=2.6.3" >> $GITHUB_ENV

- run: make test

test_json_lib:
name: Test different json lib (${{ matrix.json_lib }} | OTP ${{ matrix.otp_version }})
runs-on: ubuntu-latest
Expand All @@ -138,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
otp_version: [21]
otp_version: [24]
json_lib: [jiffy, jsx, thoas]

steps:
Expand All @@ -150,11 +82,6 @@ jobs:
path: $HOME/.cache/rebar3
key: ${{ matrix.otp_version }}-rebar3-cache-json-lib

# cowboy 2.7+ require OTP 20 and 2.11+ require OTP 24+. On OTP 19-23 pin to
# cowboy 2.6.3, last version that compiles fine on these old OTP versions.
- if: ${{ matrix.otp_version <= 23 && !matrix.old_cowboy }}
run: echo "COWBOY_VERSION=2.6.3" >> $GITHUB_ENV

- run: make test_${{ matrix.json_lib }}

test_docs:
Expand Down Expand Up @@ -263,26 +190,15 @@ jobs:
elixir-version: ${{matrix.elixir}}
rebar3-version: ${{matrix.rebar3}}

- if: matrix.old_rebar
run: echo "REBAR3=./rebar3" >> $GITHUB_ENV

- if: matrix.erl_hist
run: echo "XPROF_ERL_HIST=true" >> $GITHUB_ENV

- if: matrix.old_cowboy
run: echo "COWBOY_VERSION=1.1.2" >> $GITHUB_ENV

- name: Cache hex packages
uses: actions/cache@v3
with:
path: $HOME/.cache/rebar3
key: ${{ matrix.otp_version }}-rebar3-cache

# cowboy 2.7+ require OTP 20 and 2.11+ require OTP 24+. On OTP 19-23 pin to
# cowboy 2.6.3, last version that compiles fine on these old OTP versions.
- if: ${{ matrix.otp_version <= 23 && !matrix.old_cowboy }}
run: echo "COWBOY_VERSION=2.6.3" >> $GITHUB_ENV

- run: make test

test_front_end:
Expand Down
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@ JS_PRIV=apps/xprof_gui/priv
BIN_DIR:=node_modules/.bin
REBAR3?=$(shell which rebar3 || echo ./rebar3)

# this will update cowboy version based on rebar.config overwriting the lock file
ifdef COWBOY_VERSION
MAYBE_UPDATE_COWBOY = $(REBAR3) upgrade cowboy
endif
ifdef XPROF_ERL_HIST
MAYBE_UNLOCK_HIST = $(REBAR3) unlock hdr_histogram
endif

compile:
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
$(REBAR3) compile

dev: dev_front_end dev_back_end

dev_back_end:
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
$(REBAR3) as dev compile, shell

Expand All @@ -37,28 +31,27 @@ build_prod_front_end:
cd $(JS_PRIV); npm run build

test: compile
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
$(REBAR3) as test do cover --reset, eunit -c, ct -c, cover --verbose

test_jiffy:
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
export XPROF_JSON_LIB=jiffy; \
$(REBAR3) as test_jiffy do compile, dialyzer, cover --reset, ct -c, cover --verbose

test_jsx:
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
export XPROF_JSON_LIB=jsx; \
$(REBAR3) as test_jsx do compile, dialyzer, cover --reset, ct -c, cover --verbose

test_thoas:
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
export XPROF_JSON_LIB=thoas; \
$(REBAR3) as test_thoas do compile, dialyzer, cover --reset, ct -c, cover --verbose

send_coveralls:
$(REBAR3) as test coveralls send

doc:
$(REBAR3) edoc

Expand All @@ -68,7 +61,6 @@ doc:
-e '1 s|\[!\[.*||' README.md > ./doc/src/readme.md

gen_ex_doc: ./doc/src/readme.md
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
$(REBAR3) as docs ex_doc --app xprof_core
$(REBAR3) as docs ex_doc --app xprof_gui
Expand All @@ -77,7 +69,6 @@ gen_ex_doc: ./doc/src/readme.md
$(REBAR3) as docs ex_doc --app xprof

dialyzer:
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
$(REBAR3) dialyzer

Expand All @@ -87,4 +78,4 @@ publish:
publish_docs: gen_ex_doc
$(REBAR3) as publish hex docs

.PHONY: compile dev dev_back_end dev_front_end npm bootstrap_front_end test_front_end build_prod_front_end test doc gen_ex_doc dialyzer publish publish_docs
.PHONY: compile dev dev_back_end dev_front_end npm bootstrap_front_end test_front_end build_prod_front_end test send_coveralls doc gen_ex_doc dialyzer publish publish_docs
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XProf [![Build Status](https://travis-ci.org/Appliscale/xprof.svg?branch=master)](https://travis-ci.org/Appliscale/xprof) [![Coverage Status](https://coveralls.io/repos/github/Appliscale/xprof/badge.svg?branch=master)](https://coveralls.io/github/Appliscale/xprof?branch=master) [![Hex.pm](https://img.shields.io/hexpm/v/xprof.svg?style=flat-square)](https://hex.pm/packages/xprof) [![Hex.pm](https://img.shields.io/hexpm/dt/xprof.svg?style=flat-square)](https://hex.pm/packages/xprof) [![Gitter](https://badges.gitter.im/Appliscale/xprof.svg)](https://gitter.im/Appliscale/xprof?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
XProf [![Coverage Status](https://coveralls.io/repos/github/Appliscale/xprof/badge.svg?branch=master)](https://coveralls.io/github/Appliscale/xprof?branch=master) [![Hex.pm](https://img.shields.io/hexpm/v/xprof.svg?style=flat-square)](https://hex.pm/packages/xprof) [![Hex.pm](https://img.shields.io/hexpm/dt/xprof.svg?style=flat-square)](https://hex.pm/packages/xprof) [![Gitter](https://badges.gitter.im/Appliscale/xprof.svg)](https://gitter.im/Appliscale/xprof?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
=====

*XProf* is a visual tracer and profiler that allows you to track execution of Elixir / Erlang
Expand Down Expand Up @@ -50,7 +50,7 @@ The preferred way is to add the `xprof` *Hex* package as a dependency to your re

{deps, [
...
{xprof, "2.0.0-rc.5"}
{xprof, "2.0.0"}
]}.
```

Expand All @@ -60,7 +60,7 @@ The preferred way is to add the `xprof` *Hex* package as a dependency to your re
defp deps do
[
...
{:xprof, "~> 2.0.0-rc.5"}
{:xprof, "~> 2.0.0"}
]
end
```
Expand All @@ -70,15 +70,15 @@ You can also fetch from the github repository (not recommended, only for develop
```erlang
{deps, [
...
{xprof_core, {git_subdir, "https://github.com/Appliscale/xprof.git", {tag, "2.0.0-rc.5"}, "apps/xprof_core"}},
{xprof_gui, {git_subdir, "https://github.com/Appliscale/xprof.git", {tag, "2.0.0-rc.5"}, "apps/xprof_gui"}},
{xprof, {git_subdir, "https://github.com/Appliscale/xprof.git", {tag, "2.0.0-rc.5"}, "apps/xprof"}}
{xprof_core, {git_subdir, "https://github.com/Appliscale/xprof.git", {tag, "2.0.0"}, "apps/xprof_core"}},
{xprof_gui, {git_subdir, "https://github.com/Appliscale/xprof.git", {tag, "2.0.0"}, "apps/xprof_gui"}},
{xprof, {git_subdir, "https://github.com/Appliscale/xprof.git", {tag, "2.0.0"}, "apps/xprof"}}
]}.
```

## Supported Versions

XProf currently supports Erlang/OTP 18 - 29 and Elixir 1.11-1.20.
XProf currently supports Erlang/OTP 24 - 29 and Elixir 1.11-1.20.
Newer OTP versions (if any) might work but are not tested.

## Syntax mode
Expand Down Expand Up @@ -138,12 +138,6 @@ library. If you have compilation problems you can choose to use a
native Erlang histogram implementation by defining the OS env var
`XPROF_ERL_HIST` when compiling `xprof_core`.

`COWBOY_VERSION` - By default XProf uses Cowboy version 2.x. This
version is only supported from Erlang/OTP 19 and is not backwards
compatible with older Cowboy versions. If for some reason you would
like to use Cowboy version 1.x you can define the OS env var
`COWBOY_VERSION=1` when compiling `xprof_gui`.

`XPROF_JSON_LIB` - By default XProf uses the `jsone` library. If you
would like to use a different json library you can define the OS env
var `XPROF_JSON_LIB` when compiling `xprof_gui`. It is assumed that
Expand All @@ -155,7 +149,6 @@ Examples

```
export XPROF_ERL_HIST=true
export COWBOY_VERSION=1
export XPROF_JSON_LIB='Elixir.Jason'
export XPROF_JSON_ENC_FUN='encode!'
```
Expand Down
2 changes: 1 addition & 1 deletion apps/xprof/src/xprof.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, xprof,
[{description, "Visual tracer and profiler for BEAM languages"}
,{vsn, "2.0.0-rc.5"}
,{vsn, "2.0.0"}
,{registered, []}
,{applications,
[kernel,
Expand Down
4 changes: 1 addition & 3 deletions apps/xprof_core/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
[{hdr_histogram, "~> 0.5"}
]}.

{erl_opts, [debug_info,
{platform_define, "^[^R1]", ceil_floor} %% from OTP 20
]}.
{erl_opts, [debug_info]}.
16 changes: 1 addition & 15 deletions apps/xprof_core/rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,4 @@ ErlHist =
end
end.

Rebar2 =
fun(Config0) ->
case erlang:function_exported(rebar3, main, 1) of
true -> % rebar3
Config0;
false -> % rebar 2.x or older
%% Only include app names for deps.
%% Top level app should declare source and version.
Deps = proplists:get_value(deps, Config0, []),
NewDeps = [element(1, Dep)||Dep <- Deps],
lists:keystore(deps, 1, Config0, {deps, NewDeps})
end
end.

Rebar2(ErlHist(CONFIG)).
ErlHist(CONFIG).
2 changes: 1 addition & 1 deletion apps/xprof_core/src/xprof_core.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, xprof_core,
[{description, "Visual BEAM tracer/profiler tracer core"}
,{vsn, "2.0.0-rc.5"}
,{vsn, "2.0.0"}
,{registered, []}
,{mod, {'xprof_core_app', []}}
,{applications,
Expand Down
Loading
Loading