2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2022-11-01 20:26:26 +00:00
|
|
|
* Copyright (C) 2021 Intel Corporation.
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPDK_INTERNAL_USDT_H
|
|
|
|
#define SPDK_INTERNAL_USDT_H
|
|
|
|
|
|
|
|
#include "spdk/config.h"
|
2021-05-26 06:57:20 +00:00
|
|
|
#include "spdk/env.h"
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
|
2021-07-07 08:42:13 +00:00
|
|
|
#if defined(SPDK_CONFIG_USDT) && !defined(SPDK_UNIT_TEST)
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
|
2022-09-13 03:01:03 +00:00
|
|
|
#if defined(__aarch64__)
|
|
|
|
#define STAP_SDT_ARG_CONSTRAINT nr
|
|
|
|
#endif
|
|
|
|
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
#include <sys/sdt.h>
|
|
|
|
|
2023-04-21 20:36:10 +00:00
|
|
|
#define SPDK_DTRACE_PROBE(name) DTRACE_PROBE1(spdk,name,0)
|
|
|
|
#define SPDK_DTRACE_PROBE1(name,a1) DTRACE_PROBE2(spdk,name,0,a1)
|
|
|
|
#define SPDK_DTRACE_PROBE2(name,a1,a2) DTRACE_PROBE3(spdk,name,0,a1,a2)
|
|
|
|
#define SPDK_DTRACE_PROBE3(name,a1,a2,a3) DTRACE_PROBE4(spdk,name,0,a1,a2,a3)
|
|
|
|
#define SPDK_DTRACE_PROBE4(name,a1,a2,a3,a4) DTRACE_PROBE5(spdk,name,0,a1,a2,a3,a4)
|
|
|
|
|
|
|
|
/* These variants implicitly add a TSC argument at the front of the caller's arguments.
|
|
|
|
* These are useful for scripts that require an exact timestamp for correlating
|
|
|
|
* USDT events with those captured by the lower-overhead SPDK tracing framework.
|
|
|
|
*/
|
|
|
|
#define SPDK_DTRACE_PROBE_TICKS(name) DTRACE_PROBE1(spdk,name,spdk_get_ticks())
|
|
|
|
#define SPDK_DTRACE_PROBE1_TICKS(name,a1) DTRACE_PROBE2(spdk,name,spdk_get_ticks(),a1)
|
|
|
|
#define SPDK_DTRACE_PROBE2_TICKS(name,a1,a2) DTRACE_PROBE3(spdk,name,spdk_get_ticks(),a1,a2)
|
|
|
|
#define SPDK_DTRACE_PROBE3_TICKS(name,a1,a2,a3) DTRACE_PROBE4(spdk,name,spdk_get_ticks(),a1,a2,a3)
|
|
|
|
#define SPDK_DTRACE_PROBE4_TICKS(name,a1,a2,a3,a4) DTRACE_PROBE5(spdk,name,spdk_get_ticks(),a1,a2,a3,a4)
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define SPDK_DTRACE_PROBE(...)
|
|
|
|
#define SPDK_DTRACE_PROBE1(...)
|
|
|
|
#define SPDK_DTRACE_PROBE2(...)
|
|
|
|
#define SPDK_DTRACE_PROBE3(...)
|
|
|
|
#define SPDK_DTRACE_PROBE4(...)
|
|
|
|
|
2023-04-21 20:36:10 +00:00
|
|
|
#define SPDK_DTRACE_PROBE_TICKS(...)
|
|
|
|
#define SPDK_DTRACE_PROBE1_TICKS(...)
|
|
|
|
#define SPDK_DTRACE_PROBE2_TICKS(...)
|
|
|
|
#define SPDK_DTRACE_PROBE3_TICKS(...)
|
|
|
|
#define SPDK_DTRACE_PROBE4_TICKS(...)
|
|
|
|
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* SPDK_INTERNAL_USDT_H */
|