Skip to content

Commit

Permalink
usdt: pass ticks as the first probe argument
Browse files Browse the repository at this point in the history
This will allow to match and compare the DTrace probes with SPDK traces
as they'll be using the same source for the timestamps.

Signed-off-by: Konrad Sztyber <[email protected]>
Change-Id: I686c3351428c75f9b618a1a909836504fccad828
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8101
Tested-by: SPDK CI Jenkins <[email protected]>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <[email protected]>
Reviewed-by: Aleksey Marchuk <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Ziye Yang <[email protected]>
  • Loading branch information
ksztyber authored and jimharris committed Jun 28, 2021
1 parent c556b6b commit a4044e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
11 changes: 6 additions & 5 deletions include/spdk_internal/usdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@
#define SPDK_INTERNAL_USDT_H

#include "spdk/config.h"
#include "spdk/env.h"

#ifdef SPDK_CONFIG_USDT

#include <sys/sdt.h>

#define SPDK_DTRACE_PROBE(name) DTRACE_PROBE(spdk,name)
#define SPDK_DTRACE_PROBE1(name,a1) DTRACE_PROBE1(spdk,name,a1)
#define SPDK_DTRACE_PROBE2(name,a1,a2) DTRACE_PROBE2(spdk,name,a1,a2)
#define SPDK_DTRACE_PROBE3(name,a1,a2,a3) DTRACE_PROBE3(spdk,name,a1,a2,a3)
#define SPDK_DTRACE_PROBE4(name,a1,a2,a3,a4) DTRACE_PROBE4(spdk,name,a1,a2,a3,a4)
#define SPDK_DTRACE_PROBE(name) DTRACE_PROBE1(spdk,name,spdk_get_ticks())
#define SPDK_DTRACE_PROBE1(name,a1) DTRACE_PROBE2(spdk,name,spdk_get_ticks(),a1)
#define SPDK_DTRACE_PROBE2(name,a1,a2) DTRACE_PROBE3(spdk,name,spdk_get_ticks(),a1,a2)
#define SPDK_DTRACE_PROBE3(name,a1,a2,a3) DTRACE_PROBE4(spdk,name,spdk_get_ticks(),a1,a2,a3)
#define SPDK_DTRACE_PROBE4(name,a1,a2,a3,a4) DTRACE_PROBE5(spdk,name,spdk_get_ticks(),a1,a2,a3,a4)

#else

Expand Down
28 changes: 14 additions & 14 deletions scripts/bpf/nvmf.bt
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
usdt:__EXE__:nvmf_tgt_state {
printf("%d.%06d: nvmf_tgt reached state %s\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
@target[arg0]);
@target[arg1]);
}

usdt:__EXE__:nvmf_subsystem_change_state {
printf("%d.%06d: %s change state from %s to %s start\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
str(arg0), @subsystem[arg2], @subsystem[arg1]);
str(arg1), @subsystem[arg3], @subsystem[arg2]);
}

usdt:__EXE__:nvmf_subsystem_change_state_done {
printf("%d.%06d: %s change state from %s to %s %s\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
str(arg0), @subsystem[arg2], @subsystem[arg1], arg3 ? "failed" : "done");
str(arg1), @subsystem[arg3], @subsystem[arg2], arg4 ? "failed" : "done");
}

usdt:__EXE__:nvmf_pg_change_state {
printf("%d.%06d: %s on thread %d state to %s start\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
str(arg0), arg2, @subsystem[arg1]);
str(arg1), arg3, @subsystem[arg2]);
}

usdt:__EXE__:nvmf_pg_change_state_done {
printf("%d.%06d: %s on thread %d state to %s done\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
str(arg0), arg2, @subsystem[arg1]);
str(arg1), arg3, @subsystem[arg2]);
}

usdt:__EXE__:nvmf_create_poll_group {
printf("%d.%06d: create poll group on thread: %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0);
arg1);
}

usdt:__EXE__:nvmf_destroy_poll_group {
printf("%d.%06d: destroy poll group on thread: %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0);
arg1);
}

usdt:__EXE__:nvmf_poll_group_add_qpair {
printf("%d.%06d: add qpair: %p to poll group on thread %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0, arg1);
arg1, arg2);
}

usdt:__EXE__:nvmf_destroy_poll_group_qpairs {
printf("%d.%06d: destroy qpairs on poll group on thread %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0);
arg1);
}

usdt:__EXE__:nvmf_poll_group_remove_qpair {
printf("%d.%06d: remove qpair: %p from poll group on thread %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0, arg1);
arg1, arg2);
}

usdt:__EXE__:nvmf_qpair_disconnect {
printf("%d.%06d: disconnect qpair: %p from poll group on thread %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0, arg1);
arg1, arg2);
}

usdt:__EXE__:nvmf_transport_qpair_fini {
printf("%d.%06d: destroy qpair: %p on transport layer\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0);
arg1);
}

usdt:__EXE__:nvmf_poll_group_drain_qpair {
printf("%d.%06d: drain qpair: %p from poll group on thread %d\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
arg0, arg1);
arg1, arg2);
}

usdt:__EXE__:nvmf_ctrlr_add_qpair {
printf("%d.%06d: %s add qpair: %p, qid: %d for host: %s\n",
elapsed / (uint64)(1000 * 1000), elapsed % (uint64)(1000 * 1000),
str(arg2), arg0, arg1, str(arg3));
str(arg3), arg1, arg2, str(arg4));
}

0 comments on commit a4044e7

Please sign in to comment.