trace: make trace_create_tpoint_group_mask() external

Make trace_create_tpoint_group_mask() an external function.
This is going to be used in following patch.

Change-Id: I06cd1652bb30abddd49536bc76ec134a01121537
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10830
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:
Krzysztof Karas 2021-12-22 14:58:14 +00:00 committed by Tomasz Zawadzki
parent dd6a8a80df
commit aa1ec3730d
4 changed files with 14 additions and 5 deletions

View File

@ -416,6 +416,14 @@ int spdk_trace_disable_tpoint_group(const char *group_name);
*/
void spdk_trace_mask_usage(FILE *f, const char *tmask_arg);
/**
* Create a tracepoint group mask from tracepoint group name
*
* \param group_name tracepoint group name string
* \return tpoint group mask on success, 0 on failure
*/
uint64_t spdk_trace_create_tpoint_group_mask(const char *group_name);
struct spdk_trace_register_fn {
const char *name;
uint8_t tgroup_id;

View File

@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
SO_VER := 5
SO_MINOR := 0
SO_MINOR := 1
C_SRCS = trace.c trace_flags.c trace_rpc.c
LIBNAME = trace

View File

@ -23,6 +23,7 @@
spdk_trace_mask_usage;
spdk_trace_add_register_fn;
spdk_trace_tpoint_register_relation;
spdk_trace_create_tpoint_group_mask;
# public variables
g_trace_histories;

View File

@ -151,8 +151,8 @@ spdk_trace_get_next_register_fn(struct spdk_trace_register_fn *register_fn)
return register_fn->next;
}
static uint64_t
trace_create_tpoint_group_mask(const char *group_name)
uint64_t
spdk_trace_create_tpoint_group_mask(const char *group_name)
{
uint64_t tpoint_group_mask = 0;
struct spdk_trace_register_fn *register_fn;
@ -190,7 +190,7 @@ spdk_trace_enable_tpoint_group(const char *group_name)
return -1;
}
tpoint_group_mask = trace_create_tpoint_group_mask(group_name);
tpoint_group_mask = spdk_trace_create_tpoint_group_mask(group_name);
if (tpoint_group_mask == 0) {
return -1;
}
@ -208,7 +208,7 @@ spdk_trace_disable_tpoint_group(const char *group_name)
return -1;
}
tpoint_group_mask = trace_create_tpoint_group_mask(group_name);
tpoint_group_mask = spdk_trace_create_tpoint_group_mask(group_name);
if (tpoint_group_mask == 0) {
return -1;
}