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

Initialize logging for commands #2288

Merged
merged 3 commits into from
May 10, 2024
Merged

Conversation

igaw
Copy link
Collaborator

@igaw igaw commented Apr 9, 2024

We currently only initialize the libnvme logging for those commands which use the nvme_root_t object. In order to get the logging going for all commands we have to initialize the logging for every command.

This is a first attempt to solve this. Maybe it would be better to initialize the libvnme logging just once for all commands.

For this draft I'v just made it work for the read and write command (submit_io).

@ikegami-t
Copy link
Contributor

Seems nvme_create_root() also can be moved into parse_args(). If this PR merged will do rebase #2285. Thank you.

@igaw
Copy link
Collaborator Author

igaw commented Apr 10, 2024

Seems nvme_create_root() also can be moved into parse_args().

Yes this is a possibility. Let me play with it and see how this works out.

@igaw
Copy link
Collaborator Author

igaw commented Apr 26, 2024

depends on linux-nvme/libnvme#824

nvme.c Show resolved Hide resolved
util/cleanup.h Outdated Show resolved Hide resolved
@igaw igaw marked this pull request as ready for review May 7, 2024 14:48
igaw added 3 commits May 10, 2024 09:17
Import nvme_init_default_logging.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Use a cleanup helper for the nvme_root_t objects which simplifies the
error paths and ensures we are always removing all the allocated
resources.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
The library will only print errors unless we initialize default logging.
By doing so, all nvme commands are enabled to also print debug
information.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
@igaw igaw merged commit 931082b into linux-nvme:master May 10, 2024
16 checks passed
@igaw igaw deleted the verbose-logging branch May 10, 2024 07:21
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