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 <krzysztof.karas@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10818 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
bd31512595
commit
749e1f73a0
@ -403,7 +403,10 @@ app_setup_trace(struct spdk_app_opts *opts)
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
tpoint_group_mask = strtoull(tpoint_group, &end, 16);
|
tpoint_group_mask = strtoull(tpoint_group, &end, 16);
|
||||||
if (*end != '\0' || errno) {
|
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.
|
/* Check if tpoint group mask has only one bit set.
|
||||||
* This is to avoid enabling individual tpoints in
|
* This is to avoid enabling individual tpoints in
|
||||||
@ -423,7 +426,10 @@ app_setup_trace(struct spdk_app_opts *opts)
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
tpoint_group_mask = strtoull(tpoint_group_str, &end, 16);
|
tpoint_group_mask = strtoull(tpoint_group_str, &end, 16);
|
||||||
if (*end != '\0' || errno) {
|
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;
|
tpoint_mask = -1ULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user