]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: Use __print_symbolic() for UFS trace string print
authorBean Huo <beanhuo@micron.com>
Tue, 5 Jan 2021 11:34:42 +0000 (12:34 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 8 Jan 2021 03:29:10 +0000 (22:29 -0500)
commit852e8de5244c814e22ae19d68e930fa7b2b251c8
treef5bcb25743100fcf233e7fefc497d8d5be56aa5a
parent0e669151c067003c539c80da58838d9e76c49e4b
scsi: ufs: Use __print_symbolic() for UFS trace string print

__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.

original print format:

print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
            __print_hex(REC->hdr, sizeof(REC->hdr)),
            __print_hex(REC->tsf, sizeof(REC->tsf))

after this change:

print fmt: "%s: %s: HDR:%s, CDB:%s",
      print_symbolic(REC->str_t, {0, "send"},
                                 {1, "complete"},
                                 {2, "dev_complete"},
                                 {3, "query_send"},
                                 {4, "query_complete"},
                                 {5, "query_complete_err"},
                                 {6, "tm_send"},
                                 {7, "tm_complete"},
                                 {8, "tm_complete_err"}),
      __get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
      __print_hex(REC->tsf, sizeof(REC->tsf))

Note: This patch just converts current __get_str(str) to __print_symbolic(),
      the original tracing log will not be affected by this change, so it
      doesn't break what current parsers expect.

Link: https://lore.kernel.org/r/20210105113446.16027-3-huobean@gmail.com
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs.h
drivers/scsi/ufs/ufshcd.c
include/trace/events/ufs.h