Skip to content

Instantly share code, notes, and snippets.

View lpgauth's full-sized avatar
😄
busy building cool stuff

Louis-Philippe Gauthier lpgauth

😄
busy building cool stuff
View GitHub Profile
anchor (rebar3) $ rm -rf _build/test/
anchor (rebar3) $ make eunit
Running rebar3 eunit...
===> Verifying dependencies...
===> Linking /Users/lpgauth/Git/anchor/_build/default/lib/edown to /Users/lpgauth/Git/anchor/_build/test/lib/edown
===> Compiling anchor
===> Performing EUnit tests...
=ERROR REPORT==== 1-Jul-2015::10:14:10 ===
[anchor] tcp closed
cat /proc/interrupts
echo 2 > /proc/irq/130/smp_affinity
echo 4 > /proc/irq/131/smp_affinity
echo 8 > /proc/irq/132/smp_affinity
echo 16 > /proc/irq/133/smp_affinity
echo 32 > /proc/irq/134/smp_affinity
Erlang/OTP 17 [erts-6.3] [source-575abc1] [64-bit] [smp:32:32] [async-threads:10] [hipe] [kernel-poll:false] [lock-counting]
Eshell V6.3 (abort with ^G)
1> lcnt:start(), lcnt:rt_opt({copy_save, true}), lcnt:clear(), timer:sleep(1000), lcnt:collect(), lcnt:conflicts(), lcnt:clear(), lcnt:stop().
lock id #tries #collisions collisions [%] time [us] duration [%]
----- --- ------- ------------ --------------- ---------- -------------
pollset 1 56872 15399 27.0766 429155 42.1222
drv_ev_state 16 139194 4855 3.4879 345582 33.9194
timeofday 1 55357 6164 11.1350 116585 11.4430
timer_wheel 1 42773 1767 4.1311 91477 8.9786
Code Coverage:
marina : 100
marina_app : 100
marina_backlog : 100
marina_body : 84%
marina_buffer : 80%
marina_cache : 100
marina_frame : 93%
marina_queue : 60%
marina_request : 94%
beam/erl_lock_count.c:155:lcnt_thread_data_alloc(): Internal error: Lock counter failed to allocate memory!
@lpgauth
lpgauth / gist:e85efa59b96726af235d
Created February 23, 2015 16:54
otp17-hipe-mfait-rwlock.patch
(rtb-gateway@***.bloomdigital.com)85> lcnt:start(), lcnt:rt_opt({copy_save, true}), lcnt:clear(), timer:sleep(250), lcnt:collect(), lcnt:conflicts().
lock id #tries #collisions collisions [%] time [us] duration [%]
----- --- ------- ------------ --------------- ---------- -------------
pollset 1 24256 6071 25.0289 170652 65.8227
drv_ev_state 16 30178 1486 4.9241 117592 45.3568
run_queue 28 308489 10163 3.2944 109278 42.1500
timeofday 1 24499 3263 13.3189 32380 12.4894
timer_wheel 1 16898 862 5.1012 12341 4.7601
proc_status 11621 127163 146 0.1148 4896 1.8885
proc_main 11621 122045 3719 3.0472 4422 1.7056
@lpgauth
lpgauth / remote-shell.sh
Last active August 29, 2015 14:14
Bash script to open remote erlang shell on firewalled box
#!/bin/bash
if [ $# -ne 3 ]; then
echo "Usage: $0 hostname name cookie";
exit 1;
fi
HOST="$1"
NAME="$2"
COOKIE="$3"
erl -sbt tnnps
Erlang/OTP 17 [DEVELOPMENT] [erts-6.2.1] [source-e61f384] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V6.2.1 (abort with ^G)
1> erlang:system_info(scheduler_bind_type).
unbound
@lpgauth
lpgauth / gist:78f81fabbea0f959759d
Last active December 26, 2021 13:54
generating json (erlang)
-module(json_fun).
-export([
test/0
]).
-record(my_api, {
name,
age,
cars
@lpgauth
lpgauth / gist:011eb10dd0cce07d19ee
Last active August 29, 2015 14:09
tcpdump until beam.smp segfaults
tcpdump = fork do
exec "tcpdump -n -C 100 -W 5 -i eno1 -w beam"
end
Process.detach(tcpdump)
f = File.open("/var/log/messages", "r")
f.seek(0, IO::SEEK_END)
while true
select([f])