diff options
| author | Thomas Fleury <tfleury@nvidia.com> | 2016-04-04 11:39:32 -0400 |
|---|---|---|
| committer | Sri Krishna chowdary <schowdary@nvidia.com> | 2016-04-14 04:08:16 -0400 |
| commit | 4a76eb4ec96514bdd783b852b2b735aa91c8cb83 (patch) | |
| tree | 0750fcc6c4cc5d81e23be0930dd184faa73158c3 /include/trace/events | |
| parent | d4336d98259211c9273d7f082654f4b631111145 (diff) | |
video: tegra: nvmap: traces points for handle tracking
Jira EVLR-242
Change-Id: I8ecfaa3349a13ae9c82c059fd2c543cb2ecb1de7
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1119975
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'include/trace/events')
| -rw-r--r-- | include/trace/events/nvmap.h | 155 |
1 files changed, 145 insertions, 10 deletions
diff --git a/include/trace/events/nvmap.h b/include/trace/events/nvmap.h index 3848619e6..7c456b707 100644 --- a/include/trace/events/nvmap.h +++ b/include/trace/events/nvmap.h | |||
| @@ -133,7 +133,7 @@ TRACE_EVENT(nvmap_alloc_handle, | |||
| 133 | (unsigned long long)__entry->alloc) | 133 | (unsigned long long)__entry->alloc) |
| 134 | ); | 134 | ); |
| 135 | 135 | ||
| 136 | TRACE_EVENT(nvmap_free_handle, | 136 | DECLARE_EVENT_CLASS(nvmap_handle_alloc_summary, |
| 137 | TP_PROTO(struct nvmap_client *client, | 137 | TP_PROTO(struct nvmap_client *client, |
| 138 | struct nvmap_handle *handle | 138 | struct nvmap_handle *handle |
| 139 | ), | 139 | ), |
| @@ -143,18 +143,59 @@ TRACE_EVENT(nvmap_free_handle, | |||
| 143 | TP_STRUCT__entry( | 143 | TP_STRUCT__entry( |
| 144 | __field(struct nvmap_client *, client) | 144 | __field(struct nvmap_client *, client) |
| 145 | __field(struct nvmap_handle *, handle) | 145 | __field(struct nvmap_handle *, handle) |
| 146 | __field(u64, base) | ||
| 147 | __field(size_t, size) | ||
| 148 | __field(u32, userflags) | ||
| 149 | __field(u32, ref) | ||
| 150 | __field(u32, pin_count) | ||
| 151 | __field(u32, kmap_count) | ||
| 152 | __field(u32, umap_count) | ||
| 153 | __field(u32, share_count) | ||
| 146 | ), | 154 | ), |
| 147 | 155 | ||
| 148 | TP_fast_assign( | 156 | TP_fast_assign( |
| 149 | __entry->client = client; | 157 | __entry->client = client; |
| 150 | __entry->handle = handle; | 158 | __entry->handle = handle; |
| 151 | ), | 159 | __entry->base = handle->heap_type == NVMAP_HEAP_IOVMM ? 0 : |
| 160 | (handle->carveout->base); | ||
| 161 | __entry->size = handle->size; | ||
| 162 | __entry->userflags = handle->userflags; | ||
| 163 | __entry->ref = atomic_read(&handle->ref); | ||
| 164 | __entry->pin_count = atomic_read(&handle->pin); | ||
| 165 | __entry->kmap_count = atomic_read(&handle->kmap_count); | ||
| 166 | __entry->umap_count = atomic_read(&handle->umap_count); | ||
| 167 | __entry->share_count = atomic_read(&handle->share_count); | ||
| 168 | ), | ||
| 169 | |||
| 170 | TP_printk("client=%p, handle=0x%p, ref=%u, pin=%u, kmap=%u, umap=%u, share=%u " | ||
| 171 | "base=%llx, size=%zu, userflags=0x%x", | ||
| 172 | __entry->client, | ||
| 173 | __entry->handle, | ||
| 174 | __entry->ref, | ||
| 175 | __entry->pin_count, | ||
| 176 | __entry->kmap_count, | ||
| 177 | __entry->umap_count, | ||
| 178 | __entry->share_count, | ||
| 179 | __entry->base, | ||
| 180 | __entry->size, | ||
| 181 | __entry->userflags) | ||
| 182 | ); | ||
| 183 | |||
| 184 | DEFINE_EVENT(nvmap_handle_alloc_summary, nvmap_alloced_handle, | ||
| 185 | TP_PROTO(struct nvmap_client *client, | ||
| 186 | struct nvmap_handle *handle), | ||
| 187 | TP_ARGS(client, handle) | ||
| 188 | ); | ||
| 152 | 189 | ||
| 153 | TP_printk("client=%p, handle=%p", | 190 | DEFINE_EVENT(nvmap_handle_alloc_summary, nvmap_alloced_handle_from_va, |
| 154 | __entry->client, __entry->handle) | 191 | TP_PROTO(struct nvmap_client *client, |
| 192 | struct nvmap_handle *handle), | ||
| 193 | TP_ARGS(client, handle) | ||
| 155 | ); | 194 | ); |
| 156 | 195 | ||
| 157 | TRACE_EVENT(nvmap_duplicate_handle, | 196 | |
| 197 | |||
| 198 | DECLARE_EVENT_CLASS(nvmap_handle_summary, | ||
| 158 | TP_PROTO(struct nvmap_client *client, | 199 | TP_PROTO(struct nvmap_client *client, |
| 159 | struct nvmap_handle *handle, | 200 | struct nvmap_handle *handle, |
| 160 | struct nvmap_handle_ref *ref | 201 | struct nvmap_handle_ref *ref |
| @@ -164,18 +205,65 @@ TRACE_EVENT(nvmap_duplicate_handle, | |||
| 164 | 205 | ||
| 165 | TP_STRUCT__entry( | 206 | TP_STRUCT__entry( |
| 166 | __field(struct nvmap_client *, client) | 207 | __field(struct nvmap_client *, client) |
| 208 | __field(u32, dupes) | ||
| 167 | __field(struct nvmap_handle *, handle) | 209 | __field(struct nvmap_handle *, handle) |
| 168 | __field(struct nvmap_handle_ref *, ref) | 210 | __field(u32, ref) |
| 211 | __field(u32, pin_count) | ||
| 212 | __field(u32, kmap_count) | ||
| 213 | __field(u32, umap_count) | ||
| 214 | __field(u32, share_count) | ||
| 169 | ), | 215 | ), |
| 170 | 216 | ||
| 171 | TP_fast_assign( | 217 | TP_fast_assign( |
| 172 | __entry->client = client; | 218 | __entry->client = client; |
| 219 | __entry->dupes = ref ? atomic_read(&ref->dupes) : 1; | ||
| 173 | __entry->handle = handle; | 220 | __entry->handle = handle; |
| 174 | __entry->ref = ref; | 221 | __entry->ref = atomic_read(&handle->ref); |
| 175 | ), | 222 | __entry->pin_count = atomic_read(&handle->pin); |
| 223 | __entry->kmap_count = atomic_read(&handle->kmap_count); | ||
| 224 | __entry->umap_count = atomic_read(&handle->umap_count); | ||
| 225 | __entry->share_count = atomic_read(&handle->share_count); | ||
| 226 | ), | ||
| 227 | |||
| 228 | TP_printk("client=%p, dupes=%u, handle=%p, ref=%u, pin=%u, kmap=%u, umap=%u, share=%u", | ||
| 229 | __entry->client, | ||
| 230 | __entry->dupes, | ||
| 231 | __entry->handle, | ||
| 232 | __entry->ref, | ||
| 233 | __entry->pin_count, | ||
| 234 | __entry->kmap_count, | ||
| 235 | __entry->umap_count, | ||
| 236 | __entry->share_count | ||
| 237 | ) | ||
| 238 | ); | ||
| 239 | |||
| 240 | DEFINE_EVENT(nvmap_handle_summary, nvmap_duplicate_handle, | ||
| 241 | TP_PROTO(struct nvmap_client *client, | ||
| 242 | struct nvmap_handle *handle, | ||
| 243 | struct nvmap_handle_ref *ref), | ||
| 244 | TP_ARGS(client, handle, ref) | ||
| 245 | ); | ||
| 246 | |||
| 247 | DEFINE_EVENT(nvmap_handle_summary, nvmap_free_handle, | ||
| 248 | TP_PROTO(struct nvmap_client *client, | ||
| 249 | struct nvmap_handle *handle, | ||
| 250 | struct nvmap_handle_ref *ref), | ||
| 251 | TP_ARGS(client, handle, ref) | ||
| 252 | ); | ||
| 253 | |||
| 254 | DEFINE_EVENT(nvmap_handle_summary, nvmap_alloc_from_ivc, | ||
| 255 | TP_PROTO(struct nvmap_client *client, | ||
| 256 | struct nvmap_handle *handle, | ||
| 257 | struct nvmap_handle_ref *ref), | ||
| 258 | TP_ARGS(client, handle, ref) | ||
| 259 | ); | ||
| 176 | 260 | ||
| 177 | TP_printk("client=%p, id=%p, ref=%p", | 261 | TRACE_EVENT(nvmap_destroy_handle, |
| 178 | __entry->client, __entry->handle, __entry->ref) | 262 | TP_PROTO(struct nvmap_handle *handle), |
| 263 | TP_ARGS(handle), | ||
| 264 | TP_STRUCT__entry(__field(struct nvmap_handle *, handle)), | ||
| 265 | TP_fast_assign(__entry->handle = handle;), | ||
| 266 | TP_printk("handle=%p", __entry->handle) | ||
| 179 | ); | 267 | ); |
| 180 | 268 | ||
| 181 | TRACE_EVENT(nvmap_cache_maint, | 269 | TRACE_EVENT(nvmap_cache_maint, |
| @@ -351,6 +439,53 @@ TRACE_EVENT(nvmap_ioctl_pinop, | |||
| 351 | sizeof(struct nvmap_handle *) * __entry->count : 0)) | 439 | sizeof(struct nvmap_handle *) * __entry->count : 0)) |
| 352 | ); | 440 | ); |
| 353 | 441 | ||
| 442 | TRACE_EVENT(nvmap_func, | ||
| 443 | TP_PROTO(const char *name), | ||
| 444 | TP_ARGS(name), | ||
| 445 | |||
| 446 | TP_STRUCT__entry( | ||
| 447 | __field(const char *, name) | ||
| 448 | ), | ||
| 449 | |||
| 450 | TP_fast_assign( | ||
| 451 | __entry->name = name; | ||
| 452 | ), | ||
| 453 | |||
| 454 | TP_printk("name=%s", __entry->name) | ||
| 455 | ); | ||
| 456 | |||
| 457 | |||
| 458 | DECLARE_EVENT_CLASS(handle_get_put, | ||
| 459 | TP_PROTO(struct nvmap_handle *handle), | ||
| 460 | |||
| 461 | TP_ARGS(handle), | ||
| 462 | |||
| 463 | TP_STRUCT__entry( | ||
| 464 | __field(struct nvmap_handle *, handle) | ||
| 465 | __field(u32, ref) | ||
| 466 | ), | ||
| 467 | |||
| 468 | TP_fast_assign( | ||
| 469 | __entry->handle = handle; | ||
| 470 | __entry->ref = atomic_read(&handle->ref); | ||
| 471 | ), | ||
| 472 | |||
| 473 | TP_printk("ref=%u handle=%p", | ||
| 474 | __entry->ref, | ||
| 475 | __entry->handle | ||
| 476 | ) | ||
| 477 | ); | ||
| 478 | |||
| 479 | DEFINE_EVENT(handle_get_put, nvmap_handle_get, | ||
| 480 | TP_PROTO(struct nvmap_handle *handle), | ||
| 481 | TP_ARGS(handle) | ||
| 482 | ); | ||
| 483 | |||
| 484 | DEFINE_EVENT(handle_get_put, nvmap_handle_put, | ||
| 485 | TP_PROTO(struct nvmap_handle *handle), | ||
| 486 | TP_ARGS(handle) | ||
| 487 | ); | ||
| 488 | |||
| 354 | DECLARE_EVENT_CLASS(pin_unpin, | 489 | DECLARE_EVENT_CLASS(pin_unpin, |
| 355 | TP_PROTO(struct nvmap_client *client, | 490 | TP_PROTO(struct nvmap_client *client, |
| 356 | const char *name, | 491 | const char *name, |
