Allow redirecting output to file. Using simple
"if" for an environment variable, as script arguments
number is variable and using getops seems like an
overkill.
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I7e219bb1fd6377bc20c44b76cec3685b32e9316c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8643
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Also add scripts/bpf/nvmf.bt to enable and log these
probes.
This patch also adds a script that can generate
a bpftrace script snippet with string maps for
needed enumerations (currently nvmf_tgt_state and
spdk_nvmf_subsystem_state). This allows us to
dynamically generate this from the source code, and
can be extended for other enums we may want to
add in the future.
Thanks to Michal Berger for converting my original
gen_enums.py script into gen_enums.sh!
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iff34a6218aef40055ac14932eea5fc00e1c8bcf5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7194
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This script simplifies execution of bpftrace scripts
for SPDK application analysis. The script should be
invoked as:
scripts/bpftrace.sh `pidof spdk_tgt` script.bt
where 'script.bt' is the name of the bpftrace script
you wish to execute.
The script helps simplify the following:
1) replace __EXE__ markers in the bpftrace script with
the full path of the spdk executable (required for
usdt probes); it uses /proc/<pid>/exe to get the
full path
2) replace __PID__ markers in the bpftrace script with
the PID of the spdk process under analysis - this
allows for doing things like filtering system call
counts for just the SPDK process
3) invoke bpftrace with the -p <pid> option
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib271f26efe4ba326d951a7b30f61b22be755dda7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7710
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>