Files
linux/drivers
Bean Huo 761aed4e6d UPSTREAM: 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>
[bvanasche: updated Android trace statements]
(cherry picked from commit 28fa68fc55)
Bug: 204438323
Change-Id: Id8d4605fc304abbe90a8e654edb2e18c44f2e37d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-11-03 13:31:24 -07:00
..
2021-10-20 11:53:11 +02:00
2021-03-07 12:33:33 +01:00
2021-11-03 09:07:26 +01:00
2021-09-17 09:30:49 +02:00
2021-10-20 11:53:11 +02:00
2021-10-06 17:32:06 +02:00
2021-09-18 13:59:45 +02:00
2021-10-06 17:32:06 +02:00
2021-09-30 10:33:42 +02:00
2021-07-20 16:05:42 +02:00
2021-11-03 09:07:26 +01:00
2021-11-03 09:07:26 +01:00
2021-10-17 11:41:55 +02:00
2021-10-17 11:41:55 +02:00
2021-10-13 15:34:56 +02:00
2021-03-04 11:38:21 +01:00
2021-10-27 10:46:26 +02:00
2021-09-30 10:33:42 +02:00
2021-10-09 15:04:37 +02:00
2021-10-06 17:32:06 +02:00
2021-07-25 15:35:50 +02:00
2021-07-14 16:55:53 +02:00
2021-10-20 11:53:11 +02:00
2021-11-03 09:07:26 +01:00
2021-11-03 09:07:26 +01:00
2021-11-03 09:07:26 +01:00
2021-09-18 13:59:45 +02:00
2021-09-18 13:59:45 +02:00
2021-10-27 10:46:26 +02:00
2021-11-03 09:07:26 +01:00
2021-09-18 13:59:45 +02:00
2021-10-13 15:34:56 +02:00
2021-09-30 10:33:42 +02:00
2021-11-03 09:07:26 +01:00
2021-05-20 15:35:25 +02:00
2021-09-30 10:33:42 +02:00
2021-09-30 10:42:21 +02:00
2021-10-13 15:34:56 +02:00
2021-10-20 11:53:11 +02:00
2021-09-30 10:42:21 +02:00
2021-10-09 15:04:37 +02:00
2021-10-06 17:32:06 +02:00
2021-09-18 13:59:45 +02:00
2021-10-13 15:34:56 +02:00
2021-10-20 11:53:11 +02:00
2021-10-13 15:34:56 +02:00