Skip to content

Conversation

@ikegami-t
Copy link
Contributor

Only build json print codes with CONFIG_JSONC build option instead.

#ifdef CONFIG_JSONC
if (!strcmp(cfg.output_format, "json"))
amzn_print_json_stats(&log);
else
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, looks reasonable. One thing we could do is to extend validate_output_format to inform the user that there is no json output supported and use this function here. But that is just bonus :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding validate_output_format. Instead parsing the cfg.output_format again you could use the flags variable directly

if (flag & JSON`)
  amzn_print_json_stats

BTW, I would prefer to introduce an empty amzn_prin-json_stats implementation in case json-c is missing. This avoid sprinkling the ifdefs around in the code. IMO, this helps maintaining the code base in the long run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree with you so just fixed this by the PR #2636. Thank you.

@igaw
Copy link
Collaborator

igaw commented Dec 18, 2024

Oh I see that the build fails because suddenly we are building this plugin with the cross compilers...

Only build json print codes with CONFIG_JSONC build option instead.

Signed-off-by: Tokunori Ikegami <[email protected]>
To fix the cross compiler build fails.

Signed-off-by: Tokunori Ikegami <[email protected]>
@ikegami-t
Copy link
Contributor Author

Fixed for the both comments. Thank you.

@igaw igaw merged commit 8919109 into linux-nvme:master Dec 20, 2024
17 checks passed
@igaw
Copy link
Collaborator

igaw commented Dec 20, 2024

Let's go with enabling these plugins first and we address the ifdefs afterwards. I'd rather go quickly here and have everything build with the cross tool chains!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants