File 2211-erts-Remove-the-aio-dtrace-and-lttng-probes.patch of Package erlang
From 6812bb5e4b4c974169f9a428752bc73b3ba8e4f8 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Tue, 3 Sep 2019 17:28:52 +0200
Subject: [PATCH 1/2] erts: Remove the aio dtrace and lttng probes
Since file IO does not go via the async threads any more these probes
are not really usefull so we remove them rather than have to maintain
them.
---
erts/emulator/beam/erl_async.c | 38 -------------------------------------
erts/emulator/beam/erlang_dtrace.d | 33 --------------------------------
erts/emulator/beam/erlang_lttng.h | 29 ----------------------------
erts/emulator/test/lttng_SUITE.erl | 10 ----------
lib/runtime_tools/doc/src/LTTng.xml | 17 -----------------
5 files changed, 127 deletions(-)
diff --git a/erts/emulator/beam/erl_async.c b/erts/emulator/beam/erl_async.c
index 44655ad5df..d160cda4df 100644
--- a/erts/emulator/beam/erl_async.c
+++ b/erts/emulator/beam/erl_async.c
@@ -254,25 +254,6 @@ static ERTS_INLINE void async_add(ErtsAsync *a, ErtsAsyncQ* q)
#endif
erts_thr_q_enqueue(&q->thr_q, a);
-#ifdef USE_LTTNG_VM_TRACEPOINTS
- if (LTTNG_ENABLED(aio_pool_put)) {
- lttng_decl_portbuf(port_str);
- lttng_portid_to_str(a->port, port_str);
- LTTNG2(aio_pool_put, port_str, -1);
- }
-#endif
-#ifdef USE_VM_PROBES
- if (DTRACE_ENABLED(aio_pool_add)) {
- DTRACE_CHARBUF(port_str, 16);
-
- erts_snprintf(port_str, sizeof(DTRACE_CHARBUF_NAME(port_str)),
- "%T", a->port);
- /* DTRACE TODO: Get the queue length from erts_thr_q_enqueue() ? */
- len = -1;
- DTRACE2(aio_pool_add, port_str, len);
- }
- gcc_optimizer_hack++;
-#endif
}
static ERTS_INLINE ErtsAsync *async_get(ErtsThrQ_t *q,
@@ -293,25 +274,6 @@ static ERTS_INLINE ErtsAsync *async_get(ErtsThrQ_t *q,
erts_thr_q_get_finalize_dequeue_data(q, &a->q.fin_deq);
if (saved_fin_deq)
erts_thr_q_append_finalize_dequeue_data(&a->q.fin_deq, &fin_deq);
-#ifdef USE_LTTNG_VM_TRACEPOINTS
- if (LTTNG_ENABLED(aio_pool_get)) {
- lttng_decl_portbuf(port_str);
- int length = erts_thr_q_length_dirty(q);
- lttng_portid_to_str(a->port, port_str);
- LTTNG2(aio_pool_get, port_str, length);
- }
-#endif
-#ifdef USE_VM_PROBES
- if (DTRACE_ENABLED(aio_pool_get)) {
- DTRACE_CHARBUF(port_str, 16);
-
- erts_snprintf(port_str, sizeof(DTRACE_CHARBUF_NAME(port_str)),
- "%T", a->port);
- /* DTRACE TODO: Get the length from erts_thr_q_dequeue() ? */
- len = -1;
- DTRACE2(aio_pool_get, port_str, len);
- }
-#endif
return a;
}
diff --git a/erts/emulator/beam/erlang_dtrace.d b/erts/emulator/beam/erlang_dtrace.d
index 8792138d53..ba520e7c5d 100644
--- a/erts/emulator/beam/erlang_dtrace.d
+++ b/erts/emulator/beam/erlang_dtrace.d
@@ -617,29 +617,6 @@ provider erlang {
probe driver__stop_select(char *name);
- /* Async driver pool */
-
- /**
- * Show the post-add length of the async driver thread pool member's queue.
- *
- * NOTE: The port name is not available: additional lock(s) must
- * be acquired in order to get the port name safely in an SMP
- * environment. The same is true for the aio__pool_get probe.
- *
- * @param port the Port (string form)
- * @param new queue length
- */
- probe aio_pool__add(char *, int);
-
- /**
- * Show the post-get length of the async driver thread pool member's queue.
- *
- * @param port the Port (string form)
- * @param new queue length
- */
- probe aio_pool__get(char *, int);
-
-
/*
* The set of probes called by the erlang tracer nif backend. In order
* to receive events on these you both have to enable tracing in erlang
@@ -677,16 +654,6 @@ provider erlang {
* "1) you don't need the 'l' printf() modifiers with DTrace ever"
*/
-/*
- * NOTE: For file_drv_return + SMP + R14B03 (and perhaps other
- * releases), the sched-thread-id will be the same as the
- * work-thread-id: erl_async.c's async_main() function
- * will call the asynchronous invoke function and then
- * immediately call the drivers ready_async function while
- * inside the same I/O worker pool thread.
- * For R14B03's source, see erl_async.c lines 302-317.
- */
-
/*
* The set of probes for use by Erlang code ... moved to here from
* lib/runtime_tools/c_src/dtrace_user.d until a more portable solution
diff --git a/erts/emulator/beam/erlang_lttng.h b/erts/emulator/beam/erlang_lttng.h
index 9b93d77f6e..e5fc56d3ec 100644
--- a/erts/emulator/beam/erlang_lttng.h
+++ b/erts/emulator/beam/erlang_lttng.h
@@ -292,35 +292,6 @@ TRACEPOINT_EVENT(
)
)
-/* Async pool */
-
-TRACEPOINT_EVENT(
- org_erlang_otp,
- aio_pool_get,
- TP_ARGS(
- char*, port,
- int, length
- ),
- TP_FIELDS(
- ctf_string(port, port)
- ctf_integer(int, length, length)
- )
-)
-
-TRACEPOINT_EVENT(
- org_erlang_otp,
- aio_pool_put,
- TP_ARGS(
- char*, port,
- int, length
- ),
- TP_FIELDS(
- ctf_string(port, port)
- ctf_integer(int, length, length)
- )
-)
-
-
/* Memory Allocator */
TRACEPOINT_EVENT(
diff --git a/erts/emulator/test/lttng_SUITE.erl b/erts/emulator/test/lttng_SUITE.erl
index f19047ba71..c3d846d8b5 100644
--- a/erts/emulator/test/lttng_SUITE.erl
+++ b/erts/emulator/test/lttng_SUITE.erl
@@ -88,8 +88,6 @@ end_per_testcase(Case, _Config) ->
%% org_erlang_otp:carrier_pool_put
%% org_erlang_otp:carrier_destroy
%% org_erlang_otp:carrier_create
-%% org_erlang_otp:aio_pool_put
-%% org_erlang_otp:aio_pool_get
%% org_erlang_otp:driver_control
%% org_erlang_otp:driver_call
%% org_erlang_otp:driver_finish
@@ -429,8 +427,6 @@ txt() ->
"%% org_erlang_otp:carrier_pool_put\n"
"%% org_erlang_otp:carrier_destroy\n"
"%% org_erlang_otp:carrier_create\n"
- "%% org_erlang_otp:aio_pool_put\n"
- "%% org_erlang_otp:aio_pool_get\n"
"%% org_erlang_otp:driver_control\n"
"%% org_erlang_otp:driver_call\n"
"%% org_erlang_otp:driver_finish\n"
@@ -464,12 +460,6 @@ have_carriers(Alloc) ->
_ -> true
end.
-have_async_threads() ->
- Tps = erlang:system_info(thread_pool_size),
- if Tps =:= 0 -> false;
- true -> true
- end.
-
%% lttng
lttng_stop_and_view(Config) ->
Path = proplists:get_value(priv_dir, Config),
diff --git a/lib/runtime_tools/doc/src/LTTng.xml b/lib/runtime_tools/doc/src/LTTng.xml
index 89cbc805d8..85adbcc616 100644
--- a/lib/runtime_tools/doc/src/LTTng.xml
+++ b/lib/runtime_tools/doc/src/LTTng.xml
@@ -450,23 +450,6 @@ $ make </code>
<p>Example:</p>
<code type="none">driver_control: { cpu_id = 3 }, { pid = "<0.32767.8191>", port = "#Port<0.0>", driver = "forker", command = 83, bytes = 32 }</code>
- <p><em>aio_pool_get</em></p>
- <list type="bulleted">
- <item><c>port : string</c> :: Port ID. Ex. <c>"#Port<0.1031>"</c></item>
- <item><c>length : integer</c> :: Async queue length. Ex. <c>0</c></item>
- </list>
- <p>Example:</p>
- <code type="none">aio_pool_get: { cpu_id = 4 }, { port = "#Port<0.3614>", length = 0 }</code>
-
- <p><em>aio_pool_put</em></p>
- <list type="bulleted">
- <item><c>port : string</c> :: Port ID. Ex. <c>"#Port<0.1031>"</c></item>
- <item><c>length : integer</c> :: Async queue length. Ex. <c>-1</c></item>
- </list>
- <p>Async queue length is not defined for <c>put</c> operations.</p>
- <p>Example:</p>
- <code type="none">aio_pool_put: { cpu_id = 3 }, { port = "#Port<0.3614>", length = -1 }</code>
-
<p><em>carrier_create</em></p>
<list type="bulleted">
<item><c>type : string</c> :: Carrier type. Ex. <c>"ets_alloc"</c></item>
--
2.16.4