From 749e1f73a045b61d6e65b04387c4b4f9143145ad Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Tue, 21 Dec 2021 16:22:40 +0000 Subject: [PATCH] trace: allow usage of tracepoint groups while enabling traces Let user pass a name of tracepoint group. Currently the only way to enable traces with '-e' option is to pass the tpoint mask, which is cumbersome. This patch modifies our API to accept strings as parameters. Example: -e nvmf_tcp:2,thread enables nvmf_tcp's second tracepoint and the whole thread tpoint group. Modified spdk_trace_enable_tpoint_group() - it will be also used in the changed form later in the series to accept tpoint mask when using RPCs to activate/deactivate traces. Change-Id: I6b02363cce3b44b0b578877bc2505f5a4e2fffdd Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10818 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris --- lib/event/app.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/event/app.c b/lib/event/app.c index f4b34aca1..894ba63ef 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -403,7 +403,10 @@ app_setup_trace(struct spdk_app_opts *opts) errno = 0; tpoint_group_mask = strtoull(tpoint_group, &end, 16); if (*end != '\0' || errno) { - break; + tpoint_group_mask = spdk_trace_create_tpoint_group_mask(tpoint_group); + if (tpoint_group_mask == 0) { + break; + } } /* Check if tpoint group mask has only one bit set. * This is to avoid enabling individual tpoints in @@ -423,7 +426,10 @@ app_setup_trace(struct spdk_app_opts *opts) errno = 0; tpoint_group_mask = strtoull(tpoint_group_str, &end, 16); if (*end != '\0' || errno) { - break; + tpoint_group_mask = spdk_trace_create_tpoint_group_mask(tpoint_group_str); + if (tpoint_group_mask == 0) { + break; + } } tpoint_mask = -1ULL; }