Skip to content

Commit

Permalink
ocp: build ocp-nvme.c and ocp-telemetry-decode.c without json
Browse files Browse the repository at this point in the history
Still ocp-telemetry-decode.c includes json code so check CONFIG_JSON.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t committed Oct 6, 2024
1 parent 2eb5469 commit c9afba9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/ocp/meson.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
sources += [
'plugins/ocp/ocp-utils.c',
'plugins/ocp/ocp-nvme.c',
'plugins/ocp/ocp-clear-features.c',
'plugins/ocp/ocp-smart-extended-log.c',
'plugins/ocp/ocp-fw-activation-history.c',
'plugins/ocp/ocp-telemetry-decode.c',
'plugins/ocp/ocp-hardware-component-log.c',
'plugins/ocp/ocp-print.c',
'plugins/ocp/ocp-print-stdout.c',
Expand All @@ -11,8 +13,6 @@ sources += [

if json_c_dep.found()
sources += [
'plugins/ocp/ocp-nvme.c',
'plugins/ocp/ocp-telemetry-decode.c',
'plugins/ocp/ocp-print-json.c',
]
endif
4 changes: 4 additions & 0 deletions plugins/ocp/ocp-telemetry-decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ struct request_data smart_extended[] = {
{ "Log page GUID", 16 }
};

#ifdef CONFIG_JSONC
void json_add_formatted_u32_str(struct json_object *pobject, const char *msg, unsigned int pdata)
{
char data_str[70] = { 0 };
Expand All @@ -443,6 +444,7 @@ void json_add_formatted_var_size_str(struct json_object *pobject, const char *ms

json_object_add_value_string(pobject, msg, description_str);
}
#endif /* CONFIG_JSONC */

int get_telemetry_das_offset_and_size(
struct nvme_ocp_telemetry_common_header *ptelemetry_common_header,
Expand Down Expand Up @@ -636,6 +638,7 @@ int parse_ocp_telemetry_string_log(int event_fifo_num, int identifier, int debug
return 0;
}

#ifdef CONFIG_JSONC
void parse_time_stamp_event(struct nvme_ocp_telemetry_event_descriptor *pevent_descriptor,
struct json_object *pevent_descriptor_obj, __u8 *pevent_specific_data,
struct json_object *pevent_fifos_object, FILE *fp)
Expand Down Expand Up @@ -1564,3 +1567,4 @@ int print_ocp_telemetry_json(struct ocp_telemetry_parse_options *options)

return status;
}
#endif /* CONFIG_JSONC */

0 comments on commit c9afba9

Please sign in to comment.