Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocp wo json #2503

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Ocp wo json #2503

wants to merge 14 commits into from

Conversation

ikegami-t
Copy link
Contributor

No description provided.

@igaw
Copy link
Collaborator

igaw commented Sep 18, 2024

I was wondering if we should move the json code into a separate files and only include them when the json library is available, like we have with nvme-print-stdout.c and nvme-print-json.c.

@ikegami-t
Copy link
Contributor Author

Okay will try to do it. Thank you.

@ikegami-t ikegami-t force-pushed the ocp-wo-json branch 2 times, most recently from a0c0cdf to b76ae83 Compare September 19, 2024 16:22
@@ -6,5 +6,9 @@ sources += [
'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',
'plugins/ocp/ocp-print-json.c',
Copy link
Collaborator

Choose a reason for hiding this comment

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

The json file should only be added when the json library is available. And then you could update the plugins/meson.build file to always build the ocp plugin.

The rest looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update the meson.build files by the additional commit. Thank you.
Note: Still some exisitng ocp commands files needed to split json code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So do you want me to wait with merging this and wait until you finished the json code splitting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to wait for me. Still working on this but I am okay to do it by additional PRs. Thank you.

@ikegami-t ikegami-t force-pushed the ocp-wo-json branch 3 times, most recently from f498907 to 86d149f Compare October 6, 2024 05:06
At first only hwcomp print code moved.

Signed-off-by: Tokunori Ikegami <[email protected]>
Still ocp-nvme.c and some other ocp commands files depended on json.

Signed-off-by: Tokunori Ikegami <[email protected]>
Moved into print stdout and json files.

Signed-off-by: Tokunori Ikegami <[email protected]>
Move into ocp-print-stdout.c and ocp-print-json.c.

Signed-off-by: Tokunori Ikegami <[email protected]>
Still the ocp-telemetry-decode used by print functions combined json code.

Signed-off-by: Tokunori Ikegami <[email protected]>
Move into ocp-print-stdout.c and ocp-print-json.c.

Signed-off-by: Tokunori Ikegami <[email protected]>
Move into ocp-print-stdout.c and ocp-print-json.c.

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

ikegami-t commented Oct 6, 2024

All OCP command commands json codes execpt except the ocp-telemetry-decode functions are split into the ocp-print-json.c.
Note: The ocp-telemetry-decode functions used by the internal command are mixed stdout and json outputs implementation so not moved into the ocp-print-json.c but using the CONFIG_JSONC to disable intead.

@ikegami-t ikegami-t force-pushed the ocp-wo-json branch 2 times, most recently from eb93edc to 906aed0 Compare October 6, 2024 12:32
Move into ocp-print-stdout.c and ocp-print-json.c.

Signed-off-by: Tokunori Ikegami <[email protected]>
Move into ocp-print-stdout.c and ocp-print-json.c.

Signed-off-by: Tokunori Ikegami <[email protected]>
Move into ocp-print-stdout.c and ocp-print-json.c.

Signed-off-by: Tokunori Ikegami <[email protected]>
Move into ocp-print-stdout.c and ocp-print-json.c.

Signed-off-by: Tokunori Ikegami <[email protected]>
Still ocp-telemetry-decode.c includes json code so check CONFIG_JSON.

Signed-off-by: Tokunori Ikegami <[email protected]>
@ikegami-t ikegami-t force-pushed the ocp-wo-json branch 2 times, most recently from b7d6053 to 5fa9f08 Compare October 7, 2024 15:45
Also fix to use cpu_to_le64 to output __le64 values.

Signed-off-by: Tokunori Ikegami <[email protected]>
Fix also some build warnings.

Signed-off-by: Tokunori Ikegami <[email protected]>
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