diff options
author | Matthew Ahrens <[email protected]> | 2021-01-11 09:29:25 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-11 09:29:25 -0800 |
commit | 2ac90457f503e84a3acf8b7c368cd8e44677f7d3 (patch) | |
tree | 913420994b688cfaa273716844b2cfab9a465ec6 /include/sys/fs/zfs.h | |
parent | dc303dcf5b4230d3f53ba999ce3225fcd3b08943 (diff) |
record ioctl elapsed time in zpool history
Each zfs ioctl that changes on-disk state (e.g. set property, create
snapshot, destroy filesystem) is recorded in the zpool history, and is
printed by `zpool history -i`.
For performance diagnostic purposes, it would be useful to know how long
each of these ioctls took to run. This commit adds that functionality,
with a new `ZPOOL_HIST_ELAPSED_NS` member of the history nvlist.
Additionally, the time recorded in this history log is currently the
time that the history record is written to disk. But in many cases (CLI
args logging and ioctl logging), this happens asynchronously,
potentially many seconds after the operation completed. This commit
changes the timestamp to reflect when the history event was created,
rather than when it was written to disk.
Reviewed-by: Mark Maybee <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #11440
Diffstat (limited to 'include/sys/fs/zfs.h')
-rw-r--r-- | include/sys/fs/zfs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index 60c1b8460..65515e382 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -1456,6 +1456,7 @@ typedef enum { #define ZPOOL_HIST_DSNAME "dsname" #define ZPOOL_HIST_DSID "dsid" #define ZPOOL_HIST_ERRNO "errno" +#define ZPOOL_HIST_ELAPSED_NS "elapsed_ns" /* * Special nvlist name that will not have its args recorded in the pool's |