From ab9c1f0412bd0d5a018f04cd22c08cac3e1f2612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 2 May 2016 17:03:29 +0200 Subject: runtime_tools: Document BEAM lttng tracepoints --- lib/runtime_tools/doc/src/LTTng.xml | 216 ++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) diff --git a/lib/runtime_tools/doc/src/LTTng.xml b/lib/runtime_tools/doc/src/LTTng.xml index eab1848e88..57c73469d1 100644 --- a/lib/runtime_tools/doc/src/LTTng.xml +++ b/lib/runtime_tools/doc/src/LTTng.xml @@ -239,6 +239,222 @@ $ make +
+ BEAM Tracepoints +

All tracepoints are in the domain of com_ericsson_otp

+

All Erlang types are the string equivalent in LTTng.

+ +

scheduler_poll

+ + scheduler : integer :: Scheduler ID. Ex. 1 + runnable : integer :: Runnable. Ex. 1 + +

Example:

+

scheduler_poll: { cpu_id = 4 }, { scheduler = 1, runnable = 1 }

+ +

driver_init

+ + driver : string :: Driver name. Ex. "efile" + major : integer :: Major version. Ex. 3 + minor : integer :: Minor version. Ex. 1 + flags : integer :: Flags. Ex. 1 + +

Example:

+

driver_init: { cpu_id = 2 }, { driver = "caller_drv", major = 3, minor = 3, flags = 1 }

+ +

driver_start

+ + pid : string :: Process ID. Ex. "<0.131.0>" + driver : string :: Driver name. Ex. "efile" + port : string :: Port ID. Ex. "#Port<0.1031>" + +

Example:

+

driver_start: { cpu_id = 2 }, { pid = "<0.198.0>", driver = "caller_drv", port = "#Port<0.3676>" }

+ +

driver_output

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + bytes : integer :: Size of data returned. Ex. 82 + +

Example:

+

driver_output: { cpu_id = 2 }, { pid = "<0.198.0>", port = "#Port<0.3677>", driver = "/bin/sh -s unix:cmd", bytes = 36 }

+ +

driver_outputv

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + bytes : integer :: Size of data returned. Ex. 82 + +

Example:

+

driver_outputv: { cpu_id = 5 }, { pid = "<0.194.0>", port = "#Port<0.3663>", driver = "tcp_inet", bytes = 3 }

+ +

driver_ready_input

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + +

Example:

+

driver_ready_input: { cpu_id = 5 }, { pid = "<0.189.0>", port = "#Port<0.3637>", driver = "inet_gethost 4 " }

+ +

driver_ready_output

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + +

Example:

+

driver_ready_output: { cpu_id = 5 }, { pid = "<0.194.0>", port = "#Port<0.3663>", driver = "tcp_inet" }

+ +

driver_timeout

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + +

Example:

+

driver_timeout: { cpu_id = 5 }, { pid = "<0.196.0>", port = "#Port<0.3664>", driver = "tcp_inet" }

+ +

driver_stop_select

+ + driver : string :: Driver name. Ex. "efile" + +

Example:

+

driver_stop_select: { cpu_id = 5 }, { driver = "unknown" }

+ +

driver_flush

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + +

Example:

+

driver_flush: { cpu_id = 7 }, { pid = "<0.204.0>", port = "#Port<0.3686>", driver = "tcp_inet" }

+ +

driver_stop

+ + pid : string :: Process ID. Ex. "<0.131.0>" + driver : string :: Driver name. Ex. "efile" + port : string :: Port ID. Ex. "#Port<0.1031>" + +

Example:

+

driver_stop: { cpu_id = 5 }, { pid = "[]", driver = "efile", port = "#Port<0.3673>" }

+ +

driver_process_exit

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + + +

driver_ready_async

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + +

Example:

+

driver_ready_async: { cpu_id = 3 }, { pid = "<0.181.0>", port = "#Port<0.3622>", driver = "efile" }

+ +

driver_call

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + command : integer :: Command integer. Ex. 1 + bytes : integer :: Size of data returned. Ex. 82 + +

Example:

+

driver_call: { cpu_id = 2 }, { pid = "<0.202.0>", port = "#Port<0.3676>", driver = "caller_drv", command = 0, bytes = 2 }

+ +

driver_control

+ + pid : string :: Process ID. Ex. "<0.131.0>" + port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile" + command : integer :: Command integer. Ex. 1 + bytes : integer :: Size of data returned. Ex. 82 + +

Example:

+

driver_control: { cpu_id = 3 }, { pid = "<0.32767.8191>", port = "#Port<0.0>", driver = "forker", command = 83, bytes = 32 }

+ +

aio_pool_get

+ + port : string :: Port ID. Ex. "#Port<0.1031>" + length : integer :: Async queue length. Ex. 0 + +

Example:

+

aio_pool_get: { cpu_id = 4 }, { port = "#Port<0.3614>", length = 0 }

+ +

aio_pool_add

+ + port : string :: Port ID. Ex. "#Port<0.1031>" + length : integer :: Async queue length. Ex. -1 + +

Async queue length is not defined for add operations.

+

Example:

+

aio_pool_add: { cpu_id = 3 }, { port = "#Port<0.3614>", length = -1 }

+ +

carrier_create

+ + type : string :: Carrier type. Ex. "ets_alloc" + instance : integer :: Allocator instance. Ex. 1 + size : integer :: Carrier size. Ex. 262144 + mbc_carriers : integer :: Number of multiblock carriers in instance. Ex. 3 + mbc_carriers_size : integer :: Total size of multiblock blocks carriers in instance. Ex. 1343488 + mbc_blocks : integer :: Number of multiblock blocks in instance. Ex. 122 + mbc_blocks_size : integer :: Total size of all multiblock blocks in instance. Ex. 285296 + sbc_carriers : integer :: Number of singleblock carriers in instance. Ex. 1 + sbc_carriers_size : integer :: Total size of singleblock blocks carriers in instance. Ex. 1343488 + sbc_blocks : integer :: Number of singleblocks in instance. Ex. 1 + sbc_blocks_size : integer :: Total size of all singleblock blocks in instance. Ex. 285296 + + +

Example:

+

carrier_create: { cpu_id = 2 }, { type = "ets_alloc", instance = 7, size = 2097152, mbc_carriers = 4, mbc_carriers_size = 3440640, mbc_blocks = 526, mbc_blocks_size = 1278576, sbc_carriers = 0, sbc_carriers_size = 0, sbc_blocks = 0, sbc_blocks_size = 0 }

+ +

carrier_destroy

+ + type : string :: Carrier type. Ex. "ets_alloc" + instance : integer :: Allocator instance. Ex. 1 + size : integer :: Carrier size. Ex. 262144 + mbc_carriers : integer :: Number of multiblock carriers in instance. Ex. 3 + mbc_carriers_size : integer :: Total size of multiblock blocks carriers in instance. Ex. 1343488 + mbc_blocks : integer :: Number of multiblock blocks in instance. Ex. 122 + mbc_blocks_size : integer :: Total size of all multiblock blocks in instance. Ex. 285296 + sbc_carriers : integer :: Number of singleblock carriers in instance. Ex. 1 + sbc_carriers_size : integer :: Total size of singleblock blocks carriers in instance. Ex. 1343488 + sbc_blocks : integer :: Number of singleblocks in instance. Ex. 1 + sbc_blocks_size : integer :: Total size of all singleblock blocks in instance. Ex. 285296 + + +

Example:

+

carrier_destroy: { cpu_id = 6 }, { type = "ets_alloc", instance = 7, size = 262144, mbc_carriers = 3, mbc_carriers_size = 3178496, mbc_blocks = 925, mbc_blocks_size = 2305336, sbc_carriers = 0, sbc_carriers_size = 0, sbc_blocks = 0, sbc_blocks_size = 0 }

+ +

carrier_pool_put

+ + type : string :: Carrier type. Ex. "ets_alloc" + instance : integer :: Allocator instance. Ex. 1 + size : integer :: Carrier size. Ex. 262144 + +

Example:

+

carrier_pool_put: { cpu_id = 3 }, { type = "ets_alloc", instance = 5, size = 1048576 }

+ +

carrier_pool_get

+ + type : string :: Carrier type. Ex. "ets_alloc" + instance : integer :: Allocator instance. Ex. 1 + size : integer :: Carrier size. Ex. 262144 + +

Example:

+

carrier_pool_get: { cpu_id = 7 }, { type = "ets_alloc", instance = 4, size = 3208 }

+ +
+ +
Examples
-- cgit v1.2.3 From 74eafcdaff43d7d84264110066c52fa01e65f159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 2 May 2016 17:36:33 +0200 Subject: erts: Change argument order for LTTng driver_stop * Be consistent. --- erts/emulator/beam/erlang_lttng.h | 6 +++--- erts/emulator/beam/io.c | 2 +- lib/runtime_tools/doc/src/LTTng.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erts/emulator/beam/erlang_lttng.h b/erts/emulator/beam/erlang_lttng.h index 43ceeda671..f7d751252d 100644 --- a/erts/emulator/beam/erlang_lttng.h +++ b/erts/emulator/beam/erlang_lttng.h @@ -218,13 +218,13 @@ TRACEPOINT_EVENT( driver_stop, TP_ARGS( char*, pid, - char*, driver, - char*, port + char*, port, + char*, driver ), TP_FIELDS( ctf_string(pid, pid) - ctf_string(driver, driver) ctf_string(port, port) + ctf_string(driver, driver) ) ) diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index b14ca77a04..5c2595c69d 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -3861,7 +3861,7 @@ terminate_port(Port *prt) lttng_decl_procbuf(proc_str); lttng_pid_to_str(connected_id, proc_str); lttng_port_to_str(prt, port_str); - LTTNG3(driver_stop, proc_str, drv->name, port_str); + LTTNG3(driver_stop, proc_str, port_str, drv->name); } #endif diff --git a/lib/runtime_tools/doc/src/LTTng.xml b/lib/runtime_tools/doc/src/LTTng.xml index 57c73469d1..0d970c487b 100644 --- a/lib/runtime_tools/doc/src/LTTng.xml +++ b/lib/runtime_tools/doc/src/LTTng.xml @@ -337,11 +337,11 @@ $ make

driver_stop

pid : string :: Process ID. Ex. "<0.131.0>" - driver : string :: Driver name. Ex. "efile" port : string :: Port ID. Ex. "#Port<0.1031>" + driver : string :: Driver name. Ex. "efile"

Example:

-

driver_stop: { cpu_id = 5 }, { pid = "[]", driver = "efile", port = "#Port<0.3673>" }

+

driver_stop: { cpu_id = 5 }, { pid = "[]", port = "#Port<0.3673>", driver = "efile" }

driver_process_exit

-- cgit v1.2.3 From 95194afd63545c7d60e31b5148584f0707034347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 2 May 2016 17:44:25 +0200 Subject: erts: Rename LTTng tracepoint aio_pool_add to aio_pool_put * Be consistent. --- erts/emulator/beam/erl_async.c | 4 ++-- erts/emulator/beam/erlang_lttng.h | 2 +- erts/emulator/test/lttng_SUITE.erl | 10 +++++----- lib/runtime_tools/doc/src/LTTng.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/erts/emulator/beam/erl_async.c b/erts/emulator/beam/erl_async.c index 4d6d699d9f..84254af0c2 100644 --- a/erts/emulator/beam/erl_async.c +++ b/erts/emulator/beam/erl_async.c @@ -283,10 +283,10 @@ static ERTS_INLINE void async_add(ErtsAsync *a, ErtsAsyncQ* q) erts_thr_q_enqueue(&q->thr_q, a); #ifdef USE_LTTNG_VM_TRACEPOINTS - if (LTTNG_ENABLED(aio_pool_add)) { + if (LTTNG_ENABLED(aio_pool_put)) { lttng_decl_portbuf(port_str); lttng_portid_to_str(a->port, port_str); - LTTNG2(aio_pool_add, port_str, -1); + LTTNG2(aio_pool_put, port_str, -1); } #endif #ifdef USE_VM_PROBES diff --git a/erts/emulator/beam/erlang_lttng.h b/erts/emulator/beam/erlang_lttng.h index f7d751252d..12f68e477b 100644 --- a/erts/emulator/beam/erlang_lttng.h +++ b/erts/emulator/beam/erlang_lttng.h @@ -324,7 +324,7 @@ TRACEPOINT_EVENT( TRACEPOINT_EVENT( com_ericsson_otp, - aio_pool_add, + aio_pool_put, TP_ARGS( char*, port, int, length diff --git a/erts/emulator/test/lttng_SUITE.erl b/erts/emulator/test/lttng_SUITE.erl index d0f6292d5b..efc79f42ed 100644 --- a/erts/emulator/test/lttng_SUITE.erl +++ b/erts/emulator/test/lttng_SUITE.erl @@ -89,8 +89,8 @@ end_per_testcase(Case, _Config) -> %% com_ericsson_otp:carrier_pool_put %% com_ericsson_otp:carrier_destroy %% com_ericsson_otp:carrier_create -%% com_ericsson_otp:aio_pool_add -%% com_ericsson_otp:aio_pool_get +%% com_ericsson_otp:aio_pool_put +%% com_ericsson_otp:aio_pool_get %% com_ericsson_otp:driver_control %% com_ericsson_otp:driver_call %% com_ericsson_otp:driver_finish @@ -151,7 +151,7 @@ t_memory_carrier(Config) -> ok end. -%% com_ericsson_otp:aio_pool_add +%% com_ericsson_otp:aio_pool_put %% com_ericsson_otp:aio_pool_get t_async_io_pool(Config) -> case have_async_threads() of @@ -168,7 +168,7 @@ t_async_io_pool(Config) -> {ok, _} = file:list_dir(Path2), Res = lttng_stop_and_view(Config), - ok = check_tracepoint("com_ericsson_otp:aio_pool_add", Res), + ok = check_tracepoint("com_ericsson_otp:aio_pool_put", Res), ok = check_tracepoint("com_ericsson_otp:aio_pool_get", Res), ok end. @@ -416,7 +416,7 @@ txt() -> "%% com_ericsson_otp:carrier_pool_put\n" "%% com_ericsson_otp:carrier_destroy\n" "%% com_ericsson_otp:carrier_create\n" - "%% com_ericsson_otp:aio_pool_add\n" + "%% com_ericsson_otp:aio_pool_put\n" "%% com_ericsson_otp:aio_pool_get\n" "%% com_ericsson_otp:driver_control\n" "%% com_ericsson_otp:driver_call\n" diff --git a/lib/runtime_tools/doc/src/LTTng.xml b/lib/runtime_tools/doc/src/LTTng.xml index 0d970c487b..4a87133c57 100644 --- a/lib/runtime_tools/doc/src/LTTng.xml +++ b/lib/runtime_tools/doc/src/LTTng.xml @@ -389,14 +389,14 @@ $ make

Example:

aio_pool_get: { cpu_id = 4 }, { port = "#Port<0.3614>", length = 0 }

-

aio_pool_add

+

aio_pool_put

port : string :: Port ID. Ex. "#Port<0.1031>" length : integer :: Async queue length. Ex. -1 -

Async queue length is not defined for add operations.

+

Async queue length is not defined for put operations.

Example:

-

aio_pool_add: { cpu_id = 3 }, { port = "#Port<0.3614>", length = -1 }

+

aio_pool_put: { cpu_id = 3 }, { port = "#Port<0.3614>", length = -1 }

carrier_create

-- cgit v1.2.3