diff options
author | Lukas Larsson <[email protected]> | 2013-05-31 11:06:56 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2013-05-31 11:11:16 +0200 |
commit | df4fe8fac6425a85c5366e540b588b6e084ca798 (patch) | |
tree | 0268066840508ced6b79caba4eaf5c23ce15a0e0 /erts/emulator/beam/erl_bif_info.c | |
parent | 9427db3cd66f840ade9649513d914271b0981bf4 (diff) | |
parent | fb4440038ea305929d7f46c0ea651994b412483f (diff) | |
download | otp-df4fe8fac6425a85c5366e540b588b6e084ca798.tar.gz otp-df4fe8fac6425a85c5366e540b588b6e084ca798.tar.bz2 otp-df4fe8fac6425a85c5366e540b588b6e084ca798.zip |
Merge branch 'lukas/erts/gc_stat_contention/OTP-10271' into maint
* lukas/erts/gc_stat_contention/OTP-10271:
Replace gc stat lock with sched spec data
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rwxr-xr-x | erts/emulator/beam/erl_bif_info.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c index 54eefe8d12..1744afbae1 100755 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -59,6 +59,7 @@ static Export* alloc_info_trap = NULL; static Export* alloc_sizes_trap = NULL; static Export *gather_sched_wall_time_res_trap; +static Export *gather_gc_info_res_trap; #define DECL_AM(S) Eterm AM_ ## S = am_atom_put(#S, sizeof(#S) - 1) @@ -3103,18 +3104,10 @@ BIF_RETTYPE statistics_1(BIF_ALIST_1) res = TUPLE2(hp, cs, SMALL_ZERO); BIF_RET(res); } else if (BIF_ARG_1 == am_garbage_collection) { - Uint hsz = 4; - ErtsGCInfo gc_info; - Eterm gcs; - Eterm recl; - erts_gc_info(&gc_info); - (void) erts_bld_uint(NULL, &hsz, gc_info.garbage_collections); - (void) erts_bld_uint(NULL, &hsz, gc_info.reclaimed); - hp = HAlloc(BIF_P, hsz); - gcs = erts_bld_uint(&hp, NULL, gc_info.garbage_collections); - recl = erts_bld_uint(&hp, NULL, gc_info.reclaimed); - res = TUPLE3(hp, gcs, recl, SMALL_ZERO); - BIF_RET(res); + res = erts_gc_info_request(BIF_P); + if (is_non_value(res)) + BIF_RET(am_undefined); + BIF_TRAP1(gather_gc_info_res_trap, BIF_P, res); } else if (BIF_ARG_1 == am_reductions) { Uint reds; Uint diff; @@ -4082,6 +4075,8 @@ erts_bif_info_init(void) alloc_sizes_trap = erts_export_put(am_erlang, am_alloc_sizes, 1); gather_sched_wall_time_res_trap = erts_export_put(am_erlang, am_gather_sched_wall_time_result, 1); + gather_gc_info_res_trap + = erts_export_put(am_erlang, am_gather_gc_info_result, 1); process_info_init(); os_info_init(); } |