Commit f16e9f4d authored by Changqi Lu's avatar Changqi Lu Committed by Tomasz Zawadzki
Browse files

lib/event: framework_get_reactors supports getting pid and tid



Framework_get_reactors method can retrieve information about
each reactor, but there is a lack of pid and tid infomation in
the frame_get_reactors rpc method. There are situations
where pid and tid information is necessary to monitor specific
system indicators of spdk. This commit adds the required information.

Change-Id: Iaff3cb7c5edb44ed661a1a1183918ad16a3bb87c
Signed-off-by: default avatarChangqi Lu <luchangqi.123@bytedance.com>
Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22142


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 2d610abe
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7,6 +7,10 @@
Added public API 'spdk_nvmf_subsystem_set_cntlid_range' to set controller ID
range for a subsystem.

### event

The `framework_get_reactors` RPC method supports getting pid and tid.

### env_dpdk

`spdk_get_tid` is added to get the tid of the current thread.
+2 −0
Original line number Diff line number Diff line
@@ -709,9 +709,11 @@ Example response:
  "id": 1,
  "result": {
    "tick_rate": 2400000000,
    "pid": 5502,
    "reactors": [
      {
        "lcore": 0,
        "tid": 5520,
        "busy": 41289723495,
        "idle": 3624832946,
        "lw_threads": [
+2 −0
Original line number Diff line number Diff line
@@ -371,6 +371,7 @@ _rpc_framework_get_reactors(void *arg1, void *arg2)

	spdk_json_write_object_begin(ctx->w);
	spdk_json_write_named_uint32(ctx->w, "lcore", current_core);
	spdk_json_write_named_uint64(ctx->w, "tid", spdk_get_tid());
	spdk_json_write_named_uint64(ctx->w, "busy", reactor->busy_tsc);
	spdk_json_write_named_uint64(ctx->w, "idle", reactor->idle_tsc);
	spdk_json_write_named_bool(ctx->w, "in_interrupt", reactor->in_interrupt);
@@ -433,6 +434,7 @@ rpc_framework_get_reactors(struct spdk_jsonrpc_request *request,

	spdk_json_write_object_begin(ctx->w);
	spdk_json_write_named_uint64(ctx->w, "tick_rate", spdk_get_ticks_hz());
	spdk_json_write_named_uint64(ctx->w, "pid", getpid());
	spdk_json_write_named_array_begin(ctx->w, "reactors");

	spdk_for_each_reactor(_rpc_framework_get_reactors, ctx, NULL,