diff options
| author | Konsta Holtta <kholtta@nvidia.com> | 2017-03-29 08:15:31 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-06 10:38:03 -0400 |
| commit | 39d5a4f8e00742109eb62dca7ff2e2a67adfb30d (patch) | |
| tree | 0f686b52716d9b88b6beaede43cdba6a25fc9e2e /include | |
| parent | ccc38a52ba2d23fa14ac38059b9a44d0b6f8fdb7 (diff) | |
video: tegra: host: podgov: add trace events
Add the trace events header for the POD devfrqe governor used when
CONFIG_DEVFREQ_GOV_POD_SCALING=y.
This file is copied from linux 4.4; the original consists of these three
commits:
5e6afca7aef06a7e9df9c0cc91ee3a19f279349f drivers: video: tegra: 3d
scaling uses devfreq
122a4c533b13711363e94b27ca13d7af5c04675a video: tegra: host: add 3dfs
user space control
9ee601182294d82e2273710640798c7fbc145c79 video: tegra: host: podgov: Add
dev to trace events
Bug 1853519
Change-Id: Idcf5a67443c698cc0740452ccb130550f12d1b3f
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1454590
(cherry picked from linux-4.9 commit e981a42830212e5924296505e133dedf630b65ec)
Reviewed-on: https://git-master.nvidia.com/r/1772234
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/trace/events/nvhost_podgov.h | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/include/trace/events/nvhost_podgov.h b/include/trace/events/nvhost_podgov.h new file mode 100644 index 000000000..44d528e9e --- /dev/null +++ b/include/trace/events/nvhost_podgov.h | |||
| @@ -0,0 +1,240 @@ | |||
| 1 | /* | ||
| 2 | * Nvhost event logging to ftrace. | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013-2014, NVIDIA Corporation. All rights reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms and conditions of the GNU General Public License, | ||
| 8 | * version 2, as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 13 | * more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #undef TRACE_SYSTEM | ||
| 17 | #define TRACE_SYSTEM nvhost_podgov | ||
| 18 | |||
| 19 | #if !defined(_TRACE_NVHOST_PODGOV_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 20 | #define _TRACE_NVHOST_PODGOV_H | ||
| 21 | |||
| 22 | #include <linux/ktime.h> | ||
| 23 | #include <linux/tracepoint.h> | ||
| 24 | #include <linux/device.h> | ||
| 25 | |||
| 26 | DECLARE_EVENT_CLASS(podgov_update_freq, | ||
| 27 | TP_PROTO(struct device *dev, unsigned long old_freq, unsigned long new_freq), | ||
| 28 | |||
| 29 | TP_ARGS(dev, old_freq, new_freq), | ||
| 30 | |||
| 31 | TP_STRUCT__entry( | ||
| 32 | __field(struct device *, dev) | ||
| 33 | __field(unsigned long, old_freq) | ||
| 34 | __field(unsigned long, new_freq) | ||
| 35 | ), | ||
| 36 | |||
| 37 | TP_fast_assign( | ||
| 38 | __entry->dev = dev; | ||
| 39 | __entry->old_freq = old_freq; | ||
| 40 | __entry->new_freq = new_freq; | ||
| 41 | ), | ||
| 42 | |||
| 43 | TP_printk("name=%s, old_freq=%lu, new_freq=%lu", | ||
| 44 | dev_name(__entry->dev), __entry->old_freq, __entry->new_freq) | ||
| 45 | ); | ||
| 46 | |||
| 47 | DEFINE_EVENT(podgov_update_freq, podgov_do_scale, | ||
| 48 | TP_PROTO(struct device *dev, unsigned long old_freq, unsigned long new_freq), | ||
| 49 | TP_ARGS(dev, old_freq, new_freq) | ||
| 50 | ); | ||
| 51 | |||
| 52 | DEFINE_EVENT(podgov_update_freq, podgov_scaling_state_check, | ||
| 53 | TP_PROTO(struct device *dev, unsigned long old_freq, unsigned long new_freq), | ||
| 54 | TP_ARGS(dev, old_freq, new_freq) | ||
| 55 | ); | ||
| 56 | |||
| 57 | DEFINE_EVENT(podgov_update_freq, podgov_estimate_freq, | ||
| 58 | TP_PROTO(struct device *dev, unsigned long old_freq, unsigned long new_freq), | ||
| 59 | TP_ARGS(dev, old_freq, new_freq) | ||
| 60 | ); | ||
| 61 | |||
| 62 | DEFINE_EVENT(podgov_update_freq, podgov_clocks_handler, | ||
| 63 | TP_PROTO(struct device *dev, unsigned long old_freq, unsigned long new_freq), | ||
| 64 | TP_ARGS(dev, old_freq, new_freq) | ||
| 65 | ); | ||
| 66 | |||
| 67 | TRACE_EVENT(podgov_enabled, | ||
| 68 | TP_PROTO(struct device *dev, int enable), | ||
| 69 | |||
| 70 | TP_ARGS(dev, enable), | ||
| 71 | |||
| 72 | TP_STRUCT__entry( | ||
| 73 | __field(struct device *, dev) | ||
| 74 | __field(int, enable) | ||
| 75 | ), | ||
| 76 | |||
| 77 | TP_fast_assign( | ||
| 78 | __entry->dev = dev; | ||
| 79 | __entry->enable = enable; | ||
| 80 | ), | ||
| 81 | |||
| 82 | TP_printk("name=%s, scaling_enabled=%d", dev_name(__entry->dev), __entry->enable) | ||
| 83 | ); | ||
| 84 | |||
| 85 | TRACE_EVENT(podgov_set_user_ctl, | ||
| 86 | TP_PROTO(struct device *dev, int user_ctl), | ||
| 87 | |||
| 88 | TP_ARGS(dev, user_ctl), | ||
| 89 | |||
| 90 | TP_STRUCT__entry( | ||
| 91 | __field(struct device *, dev) | ||
| 92 | __field(int, user_ctl) | ||
| 93 | ), | ||
| 94 | |||
| 95 | TP_fast_assign( | ||
| 96 | __entry->dev = dev; | ||
| 97 | __entry->user_ctl = user_ctl; | ||
| 98 | ), | ||
| 99 | |||
| 100 | TP_printk("name=%s, userspace control=%d", dev_name(__entry->dev), __entry->user_ctl) | ||
| 101 | ); | ||
| 102 | |||
| 103 | TRACE_EVENT(podgov_set_freq_request, | ||
| 104 | TP_PROTO(struct device *dev, int freq_request), | ||
| 105 | |||
| 106 | TP_ARGS(dev, freq_request), | ||
| 107 | |||
| 108 | TP_STRUCT__entry( | ||
| 109 | __field(struct device *, dev) | ||
| 110 | __field(int, freq_request) | ||
| 111 | ), | ||
| 112 | |||
| 113 | TP_fast_assign( | ||
| 114 | __entry->dev = dev; | ||
| 115 | __entry->freq_request = freq_request; | ||
| 116 | ), | ||
| 117 | |||
| 118 | TP_printk("name=%s, freq_request=%d", dev_name(__entry->dev), __entry->freq_request) | ||
| 119 | ); | ||
| 120 | |||
| 121 | TRACE_EVENT(podgov_busy, | ||
| 122 | TP_PROTO(struct device *dev, unsigned long busyness), | ||
| 123 | |||
| 124 | TP_ARGS(dev, busyness), | ||
| 125 | |||
| 126 | TP_STRUCT__entry( | ||
| 127 | __field(struct device *, dev) | ||
| 128 | __field(unsigned long, busyness) | ||
| 129 | ), | ||
| 130 | |||
| 131 | TP_fast_assign( | ||
| 132 | __entry->dev = dev; | ||
| 133 | __entry->busyness = busyness; | ||
| 134 | ), | ||
| 135 | |||
| 136 | TP_printk("name=%s, busyness=%lu", dev_name(__entry->dev), __entry->busyness) | ||
| 137 | ); | ||
| 138 | |||
| 139 | TRACE_EVENT(podgov_hint, | ||
| 140 | TP_PROTO(struct device *dev, long idle_estimate, int hint), | ||
| 141 | |||
| 142 | TP_ARGS(dev, idle_estimate, hint), | ||
| 143 | |||
| 144 | TP_STRUCT__entry( | ||
| 145 | __field(struct device *, dev) | ||
| 146 | __field(long, idle_estimate) | ||
| 147 | __field(int, hint) | ||
| 148 | ), | ||
| 149 | |||
| 150 | TP_fast_assign( | ||
| 151 | __entry->dev = dev; | ||
| 152 | __entry->idle_estimate = idle_estimate; | ||
| 153 | __entry->hint = hint; | ||
| 154 | ), | ||
| 155 | |||
| 156 | TP_printk("podgov (%s): idle %ld, hint %d", dev_name(__entry->dev), | ||
| 157 | __entry->idle_estimate, __entry->hint) | ||
| 158 | ); | ||
| 159 | |||
| 160 | TRACE_EVENT(podgov_idle, | ||
| 161 | TP_PROTO(struct device *dev, unsigned long idleness), | ||
| 162 | |||
| 163 | TP_ARGS(dev, idleness), | ||
| 164 | |||
| 165 | TP_STRUCT__entry( | ||
| 166 | __field(struct device *, dev) | ||
| 167 | __field(unsigned long, idleness) | ||
| 168 | ), | ||
| 169 | |||
| 170 | TP_fast_assign( | ||
| 171 | __entry->dev = dev; | ||
| 172 | __entry->idleness = idleness; | ||
| 173 | ), | ||
| 174 | |||
| 175 | TP_printk("name=%s, idleness=%lu", dev_name(__entry->dev), __entry->idleness) | ||
| 176 | ); | ||
| 177 | |||
| 178 | TRACE_EVENT(podgov_print_target, | ||
| 179 | TP_PROTO(struct device *dev, long busy, int avg_busy, long curr, | ||
| 180 | long target, int hint, int avg_hint), | ||
| 181 | |||
| 182 | TP_ARGS(dev, busy, avg_busy, curr, target, hint, avg_hint), | ||
| 183 | |||
| 184 | TP_STRUCT__entry( | ||
| 185 | __field(struct device *, dev) | ||
| 186 | __field(long, busy) | ||
| 187 | __field(int, avg_busy) | ||
| 188 | __field(long, curr) | ||
| 189 | __field(long, target) | ||
| 190 | __field(int, hint) | ||
| 191 | __field(int, avg_hint) | ||
| 192 | ), | ||
| 193 | |||
| 194 | TP_fast_assign( | ||
| 195 | __entry->dev = dev; | ||
| 196 | __entry->busy = busy; | ||
| 197 | __entry->avg_busy = avg_busy; | ||
| 198 | __entry->curr = curr; | ||
| 199 | __entry->target = target; | ||
| 200 | __entry->hint = hint; | ||
| 201 | __entry->avg_hint = avg_hint; | ||
| 202 | ), | ||
| 203 | |||
| 204 | TP_printk("podgov (%s): busy %ld <%d>, curr %ld, t %ld, hint %d <%d>\n", | ||
| 205 | dev_name(__entry->dev), __entry->busy, __entry->avg_busy, __entry->curr, | ||
| 206 | __entry->target, __entry->hint, __entry->avg_hint) | ||
| 207 | ); | ||
| 208 | |||
| 209 | TRACE_EVENT(podgov_stats, | ||
| 210 | TP_PROTO(struct device *dev, int fast_up_count, int slow_down_count, | ||
| 211 | unsigned int idle_min, unsigned int idle_max), | ||
| 212 | |||
| 213 | TP_ARGS(dev, fast_up_count, slow_down_count, idle_min, idle_max), | ||
| 214 | |||
| 215 | TP_STRUCT__entry( | ||
| 216 | __field(struct device *, dev) | ||
| 217 | __field(int, fast_up_count) | ||
| 218 | __field(int, slow_down_count) | ||
| 219 | __field(unsigned int, idle_min) | ||
| 220 | __field(unsigned int, idle_max) | ||
| 221 | ), | ||
| 222 | |||
| 223 | TP_fast_assign( | ||
| 224 | __entry->dev = dev; | ||
| 225 | __entry->fast_up_count = fast_up_count; | ||
| 226 | __entry->slow_down_count = slow_down_count; | ||
| 227 | __entry->idle_min = idle_min; | ||
| 228 | __entry->idle_max = idle_max; | ||
| 229 | ), | ||
| 230 | |||
| 231 | TP_printk("podgov stats (%s): + %d - %d min %u max %u\n", | ||
| 232 | dev_name(__entry->dev), __entry->fast_up_count, | ||
| 233 | __entry->slow_down_count, __entry->idle_min, | ||
| 234 | __entry->idle_max) | ||
| 235 | ); | ||
| 236 | |||
| 237 | #endif /* _TRACE_NVHOST_PODGOV_H */ | ||
| 238 | |||
| 239 | /* This part must be outside protection */ | ||
| 240 | #include <trace/define_trace.h> | ||
