@@ -96,6 +96,7 @@ struct nvme_extended_additional_smart_log {
9696 struct nvme_additional_smart_log_item inflight_write_io_cmd ;
9797};
9898
99+ #ifdef CONFIG_JSONC
99100static void show_dapustor_add_smart_log_jsn (struct nvme_additional_smart_log * smart ,
100101 struct json_object * dev_stats )
101102{
@@ -348,6 +349,9 @@ static void show_dapustor_smart_log_jsn(struct nvme_additional_smart_log *smart,
348349 json_print_object (root , NULL );
349350 json_free_object (root );
350351}
352+ #else /* CONFIG_JSONC */
353+ #define show_dapustor_smart_log_jsn (smart , ext_smart , nsid , devname , has_ext )
354+ #endif /* CONFIG_JSONC */
351355
352356static void show_dapustor_add_smart_log (struct nvme_additional_smart_log * smart )
353357{
@@ -505,7 +509,9 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
505509 const char * desc = "Get DapuStor vendor specific additional smart log, and show it." ;
506510 const char * namespace = "(optional) desired namespace" ;
507511 const char * raw = "Dump output in binary format" ;
512+ #ifdef CONFIG_JSONC
508513 const char * json = "Dump output in json format" ;
514+ #endif /* CONFIG_JSONC */
509515
510516 struct nvme_additional_smart_log smart_log ;
511517 struct nvme_extended_additional_smart_log ext_smart_log ;
@@ -526,7 +532,9 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
526532 OPT_ARGS (opts ) = {
527533 OPT_UINT ("namespace-id" , 'n' , & cfg .namespace_id , namespace ),
528534 OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ),
535+ #ifdef CONFIG_JSONC
529536 OPT_FLAG ("json" , 'j' , & cfg .json , json ),
537+ #endif /* CONFIG_JSONC */
530538 OPT_END ()
531539 };
532540
0 commit comments