aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_thr_queue.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-08-19 17:43:33 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-04-06 17:23:56 +0200
commit8735e04e031284bd73d0cf5b9fddebf624623c02 (patch)
tree35842139482e1ffa5c9e42575a16473c2d4fdff7 /erts/emulator/beam/erl_thr_queue.c
parentd31e4e33ac73c0c3239a3bf8a2919165bbed9e88 (diff)
downloadotp-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.c32
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