| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved. |
|---|
| 4 | + * (C) COPYRIGHT 2019-2023 ARM Limited. All rights reserved. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * This program is free software and is provided to you under the terms of the |
|---|
| 7 | 7 | * GNU General Public License version 2 as published by the Free Software |
|---|
| .. | .. |
|---|
| 40 | 40 | struct kbase_device; |
|---|
| 41 | 41 | |
|---|
| 42 | 42 | /** |
|---|
| 43 | | - * struct kbase_ts_converter - |
|---|
| 44 | | - * System timestamp to CPU timestamp converter state. |
|---|
| 45 | | - * |
|---|
| 46 | | - * @multiplier: Numerator of the converter's fraction. |
|---|
| 47 | | - * @divisor: Denominator of the converter's fraction. |
|---|
| 48 | | - * @offset: Converter's offset term. |
|---|
| 49 | | - * |
|---|
| 50 | | - * According to Generic timer spec, system timer: |
|---|
| 51 | | - * - Increments at a fixed frequency |
|---|
| 52 | | - * - Starts operating from zero |
|---|
| 53 | | - * |
|---|
| 54 | | - * Hence CPU time is a linear function of System Time. |
|---|
| 55 | | - * |
|---|
| 56 | | - * CPU_ts = alpha * SYS_ts + beta |
|---|
| 57 | | - * |
|---|
| 58 | | - * Where |
|---|
| 59 | | - * - alpha = 10^9/SYS_ts_freq |
|---|
| 60 | | - * - beta is calculated by two timer samples taken at the same time: |
|---|
| 61 | | - * beta = CPU_ts_s - SYS_ts_s * alpha |
|---|
| 62 | | - * |
|---|
| 63 | | - * Since alpha is a rational number, we minimizing possible |
|---|
| 64 | | - * rounding error by simplifying the ratio. Thus alpha is stored |
|---|
| 65 | | - * as a simple `multiplier / divisor` ratio. |
|---|
| 66 | | - * |
|---|
| 67 | | - */ |
|---|
| 68 | | -struct kbase_ts_converter { |
|---|
| 69 | | - u64 multiplier; |
|---|
| 70 | | - u64 divisor; |
|---|
| 71 | | - s64 offset; |
|---|
| 72 | | -}; |
|---|
| 73 | | - |
|---|
| 74 | | -/** |
|---|
| 75 | 43 | * struct kbase_csf_tl_reader - CSFFW timeline reader state. |
|---|
| 76 | 44 | * |
|---|
| 77 | 45 | * @read_timer: Timer used for periodical tracebufer reading. |
|---|
| .. | .. |
|---|
| 107 | 75 | size_t size; |
|---|
| 108 | 76 | size_t btc; |
|---|
| 109 | 77 | } tl_header; |
|---|
| 110 | | - struct kbase_ts_converter ts_converter; |
|---|
| 111 | 78 | |
|---|
| 112 | 79 | bool got_first_event; |
|---|
| 113 | 80 | bool is_active; |
|---|
| .. | .. |
|---|
| 134 | 101 | void kbase_csf_tl_reader_term(struct kbase_csf_tl_reader *self); |
|---|
| 135 | 102 | |
|---|
| 136 | 103 | /** |
|---|
| 137 | | - * kbase_csf_tl_reader_flush_buffer() - |
|---|
| 138 | | - * Flush trace from buffer into CSFFW timeline stream. |
|---|
| 104 | + * kbase_csf_tl_reader_flush_buffer() - Flush trace from buffer into CSFFW timeline stream. |
|---|
| 139 | 105 | * |
|---|
| 140 | 106 | * @self: CSFFW TL Reader instance. |
|---|
| 141 | 107 | * |
|---|
| 142 | 108 | * Return: Zero on success, negative error code (EBUSY) otherwise |
|---|
| 143 | 109 | */ |
|---|
| 144 | | - |
|---|
| 145 | 110 | int kbase_csf_tl_reader_flush_buffer(struct kbase_csf_tl_reader *self); |
|---|
| 146 | 111 | |
|---|
| 147 | 112 | /** |
|---|
| 148 | | - * kbase_csf_tl_reader_start() - |
|---|
| 149 | | - * Start asynchronous copying of CSFFW timeline stream. |
|---|
| 113 | + * kbase_csf_tl_reader_start() - Start asynchronous copying of CSFFW timeline stream. |
|---|
| 150 | 114 | * |
|---|
| 151 | 115 | * @self: CSFFW TL Reader instance. |
|---|
| 152 | 116 | * @kbdev: Kbase device. |
|---|
| .. | .. |
|---|
| 157 | 121 | struct kbase_device *kbdev); |
|---|
| 158 | 122 | |
|---|
| 159 | 123 | /** |
|---|
| 160 | | - * kbase_csf_tl_reader_stop() - |
|---|
| 161 | | - * Stop asynchronous copying of CSFFW timeline stream. |
|---|
| 124 | + * kbase_csf_tl_reader_stop() - Stop asynchronous copying of CSFFW timeline stream. |
|---|
| 162 | 125 | * |
|---|
| 163 | 126 | * @self: CSFFW TL Reader instance. |
|---|
| 164 | 127 | */ |
|---|
| .. | .. |
|---|
| 166 | 129 | |
|---|
| 167 | 130 | #if IS_ENABLED(CONFIG_DEBUG_FS) |
|---|
| 168 | 131 | /** |
|---|
| 169 | | - * kbase_csf_tl_reader_debugfs_init() - |
|---|
| 170 | | - * Initialize debugfs for CSFFW Timelime Stream Reader. |
|---|
| 132 | + * kbase_csf_tl_reader_debugfs_init() - Initialize debugfs for CSFFW Timelime Stream Reader. |
|---|
| 171 | 133 | * |
|---|
| 172 | 134 | * @kbdev: Kbase device. |
|---|
| 173 | 135 | */ |
|---|
| .. | .. |
|---|
| 175 | 137 | #endif |
|---|
| 176 | 138 | |
|---|
| 177 | 139 | /** |
|---|
| 178 | | - * kbase_csf_tl_reader_reset() - |
|---|
| 179 | | - * Reset CSFFW timeline reader, it should be called before reset CSFFW. |
|---|
| 140 | + * kbase_csf_tl_reader_reset() - Reset CSFFW timeline reader, it should be called before reset CSFFW. |
|---|
| 180 | 141 | * |
|---|
| 181 | 142 | * @self: CSFFW TL Reader instance. |
|---|
| 182 | 143 | */ |
|---|