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

ioctl: Add debugging feature to show command outputs #646

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

ikegami-t
Copy link
Contributor

No description provided.

src/libnvme.map Outdated
@@ -1,5 +1,10 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

LIBNVME_1_6 {
Copy link
Contributor

Choose a reason for hiding this comment

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

The current git master is still v1.5 (unreleased)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thansk for your comment. Just fixed the patch to use the map file v1.5 definition.

src/nvme/ioctl.c Outdated
struct timeval end;
int err;

gettimeofday(&start, NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIRC, gettimeofday can be costly. I would like to avoid the overhead in this path if we don't enable the debug feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This also fixed as suggested. Thank you.

src/nvme/ioctl.c Outdated

gettimeofday(&end, NULL);

if (nvme_debug(false))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The nvme_debug API is a bit strange. At least this usage is a bit obscure, if I read it correctly. I think it's better just to introduce proper a setter and a getter. FWIW, I can live with the global debug variable in the library. I don't expect this to be a problem in normal use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed as mentioned.

src/nvme/tree.h Show resolved Hide resolved
@igaw
Copy link
Collaborator

igaw commented May 16, 2023

I was pondering if this could also be done with ftrace, but I think it is not so easy as I thought.

@ikegami-t
Copy link
Contributor Author

Just rebased.

src/libnvme.map Outdated
@@ -20,6 +20,8 @@ LIBNVME_1_5 {
nvme_root_set_application;
nvme_subsystem_get_application;
nvme_subsystem_set_application;
nvme_set_debug;
nvme_get_debug;
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two entries should be under the 1.6 section as we already released 1.5.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the version.

src/nvme/ioctl.h Outdated
@@ -3855,4 +3855,16 @@ int nvme_zns_append(struct nvme_zns_append_args *args);
*/
int nvme_dim_send(struct nvme_dim_args *args);

/**
* nvme_debug - Set NVMe command debugging output
Copy link
Collaborator

Choose a reason for hiding this comment

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

kdoc is not happy because nvme_debug should be nvme_set_debug. The same problem with the kdoc section below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the kdoc also. Thank you.

@igaw igaw merged commit 17429f7 into linux-nvme:master Sep 13, 2023
13 checks passed
@igaw
Copy link
Collaborator

igaw commented Sep 13, 2023

Thanks

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.

3 participants