Permalink
Browse files

Merge branch 'egil/fix-port-io-statistics/OTP-10073' into maint

* egil/fix-port-io-statistics/OTP-10073:
  erts: Add port-I/O statistics for active once/true
  • Loading branch information...
2 parents 57dffc2 + babe4b0 commit 50176a20c64ccd98a5d534b3c388593ff654fc8e @psyeugenic psyeugenic committed Apr 30, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 erts/emulator/beam/io.c
View
@@ -3260,6 +3260,8 @@ driver_deliver_term(ErlDrvPort port,
Uint size = ptr[1];
Uint offset = ptr[2];
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) size);
+
if (size <= ERL_ONHEAP_BIN_LIMIT) {
ErlHeapBin* hbp = (ErlHeapBin *) hp;
hp += heap_bin_size(size);
@@ -3291,6 +3293,9 @@ driver_deliver_term(ErlDrvPort port,
case ERL_DRV_BUF2BINARY: { /* char*, size */
byte *bufp = (byte *) ptr[0];
Uint size = (Uint) ptr[1];
+
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) size);
+
if (size <= ERL_ONHEAP_BIN_LIMIT) {
ErlHeapBin* hbp = (ErlHeapBin *) hp;
hp += heap_bin_size(size);
@@ -3327,6 +3332,7 @@ driver_deliver_term(ErlDrvPort port,
}
case ERL_DRV_STRING: /* char*, length */
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) ptr[1]);
mess = buf_to_intlist(&hp, (char*)ptr[0], ptr[1], NIL);
ptr += 2;
break;

0 comments on commit 50176a2

Please sign in to comment.