Chaitanya Kulkarni | c51d041 | 2020-03-25 10:49:55 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * null_blk trace related helpers. |
| 4 | * |
| 5 | * Copyright (C) 2020 Western Digital Corporation or its affiliates. |
| 6 | */ |
Damien Le Moal | eebf34a | 2020-11-20 10:55:19 +0900 | [diff] [blame] | 7 | #include "trace.h" |
Chaitanya Kulkarni | c51d041 | 2020-03-25 10:49:55 -0700 | [diff] [blame] | 8 | |
| 9 | /* |
| 10 | * Helper to use for all null_blk traces to extract disk name. |
| 11 | */ |
| 12 | const char *nullb_trace_disk_name(struct trace_seq *p, char *name) |
| 13 | { |
| 14 | const char *ret = trace_seq_buffer_ptr(p); |
| 15 | |
| 16 | if (name && *name) |
| 17 | trace_seq_printf(p, "disk=%s, ", name); |
| 18 | trace_seq_putc(p, 0); |
| 19 | |
| 20 | return ret; |
| 21 | } |