summaryrefslogtreecommitdiff
path: root/drivers/block/null_blk/trace.c
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2020-11-20 04:55:19 +0300
committerJens Axboe <axboe@kernel.dk>2020-12-08 03:36:04 +0300
commiteebf34a85c8c724676eba502d15202854f199b05 (patch)
tree6f3399a148e58230e449e5de271bb1b0fbdfdd12 /drivers/block/null_blk/trace.c
parentea17fd354ca8afd3e8962a77236b1a9a59262fdd (diff)
downloadlinux-eebf34a85c8c724676eba502d15202854f199b05.tar.xz
null_blk: Move driver into its own directory
Move null_blk driver code into the new sub-directory drivers/block/null_blk. Suggested-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/null_blk/trace.c')
-rw-r--r--drivers/block/null_blk/trace.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/block/null_blk/trace.c b/drivers/block/null_blk/trace.c
new file mode 100644
index 000000000000..3711cba16071
--- /dev/null
+++ b/drivers/block/null_blk/trace.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * null_blk trace related helpers.
+ *
+ * Copyright (C) 2020 Western Digital Corporation or its affiliates.
+ */
+#include "trace.h"
+
+/*
+ * Helper to use for all null_blk traces to extract disk name.
+ */
+const char *nullb_trace_disk_name(struct trace_seq *p, char *name)
+{
+ const char *ret = trace_seq_buffer_ptr(p);
+
+ if (name && *name)
+ trace_seq_printf(p, "disk=%s, ", name);
+ trace_seq_putc(p, 0);
+
+ return ret;
+}