-
Notifications
You must be signed in to change notification settings - Fork 132
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
Conversation
src/libnvme.map
Outdated
@@ -1,5 +1,10 @@ | |||
# SPDX-License-Identifier: LGPL-2.1-or-later | |||
|
|||
LIBNVME_1_6 { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as mentioned.
I was pondering if this could also be done with ftrace, but I think it is not so easy as I thought. |
Signed-off-by: Tokunori Ikegami <[email protected]>
5d74c0a
to
2991203
Compare
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Signed-off-by: Tokunori Ikegami <[email protected]>
2991203
to
a65b1d2
Compare
Thanks |
No description provided.