diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-08-19 17:43:33 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-06 17:23:56 +0200 |
commit | 8735e04e031284bd73d0cf5b9fddebf624623c02 (patch) | |
tree | 35842139482e1ffa5c9e42575a16473c2d4fdff7 /erts/emulator/beam/erl_thr_queue.c | |
parent | d31e4e33ac73c0c3239a3bf8a2919165bbed9e88 (diff) | |
download | otp-8735e04e031284bd73d0cf5b9fddebf624623c02.tar.gz otp-8735e04e031284bd73d0cf5b9fddebf624623c02.tar.bz2 otp-8735e04e031284bd73d0cf5b9fddebf624623c02.zip |
erts: Add lttng tracepoints for async pool queue
* aio_pool_get
* aio_pool_add
Diffstat (limited to 'erts/emulator/beam/erl_thr_queue.c')
-rw-r--r-- | erts/emulator/beam/erl_thr_queue.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_thr_queue.c b/erts/emulator/beam/erl_thr_queue.c index 7ff456b915..30c9d70c59 100644 --- a/erts/emulator/beam/erl_thr_queue.c +++ b/erts/emulator/beam/erl_thr_queue.c @@ -780,3 +780,35 @@ erts_thr_q_dequeue(ErtsThrQ_t *q) return res; #endif } + +#ifdef USE_LTTNG_VM_TRACEPOINTS +int +erts_thr_q_length_dirty(ErtsThrQ_t *q) +{ + int n = 0; +#ifndef USE_THREADS + void *res; + ErtsThrQElement_t *tmp; + + for (tmp = q->first; tmp != NULL; tmp = tmp->next) { + n++; + } +#else + ErtsThrQElement_t *e; + erts_aint_t inext; + + e = ErtsThrQDirtyReadEl(&q->head.head); + inext = erts_atomic_read_acqb(&e->next); + + while (inext != ERTS_AINT_NULL) { + e = (ErtsThrQElement_t *) inext; + if (e != &q->tail.data.marker) { + /* don't count marker */ + n++; + } + inext = erts_atomic_read_acqb(&e->next); + } +#endif + return n; +} +#endif |