i915_trace.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM i915
  4. #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _I915_TRACE_H_
  6. #include <linux/stringify.h>
  7. #include <linux/types.h>
  8. #include <linux/tracepoint.h>
  9. #include <drm/drm_drv.h>
  10. #include "gt/intel_engine.h"
  11. #include "i915_drv.h"
  12. /* object tracking */
  13. TRACE_EVENT(i915_gem_object_create,
  14. TP_PROTO(struct drm_i915_gem_object *obj),
  15. TP_ARGS(obj),
  16. TP_STRUCT__entry(
  17. __field(struct drm_i915_gem_object *, obj)
  18. __field(u64, size)
  19. ),
  20. TP_fast_assign(
  21. __entry->obj = obj;
  22. __entry->size = obj->base.size;
  23. ),
  24. TP_printk("obj=%p, size=0x%llx", __entry->obj, __entry->size)
  25. );
  26. TRACE_EVENT(i915_gem_shrink,
  27. TP_PROTO(struct drm_i915_private *i915, unsigned long target, unsigned flags),
  28. TP_ARGS(i915, target, flags),
  29. TP_STRUCT__entry(
  30. __field(int, dev)
  31. __field(unsigned long, target)
  32. __field(unsigned, flags)
  33. ),
  34. TP_fast_assign(
  35. __entry->dev = i915->drm.primary->index;
  36. __entry->target = target;
  37. __entry->flags = flags;
  38. ),
  39. TP_printk("dev=%d, target=%lu, flags=%x",
  40. __entry->dev, __entry->target, __entry->flags)
  41. );
  42. TRACE_EVENT(i915_vma_bind,
  43. TP_PROTO(struct i915_vma *vma, unsigned flags),
  44. TP_ARGS(vma, flags),
  45. TP_STRUCT__entry(
  46. __field(struct drm_i915_gem_object *, obj)
  47. __field(struct i915_address_space *, vm)
  48. __field(u64, offset)
  49. __field(u64, size)
  50. __field(unsigned, flags)
  51. ),
  52. TP_fast_assign(
  53. __entry->obj = vma->obj;
  54. __entry->vm = vma->vm;
  55. __entry->offset = vma->node.start;
  56. __entry->size = vma->node.size;
  57. __entry->flags = flags;
  58. ),
  59. TP_printk("obj=%p, offset=0x%016llx size=0x%llx%s vm=%p",
  60. __entry->obj, __entry->offset, __entry->size,
  61. __entry->flags & PIN_MAPPABLE ? ", mappable" : "",
  62. __entry->vm)
  63. );
  64. TRACE_EVENT(i915_vma_unbind,
  65. TP_PROTO(struct i915_vma *vma),
  66. TP_ARGS(vma),
  67. TP_STRUCT__entry(
  68. __field(struct drm_i915_gem_object *, obj)
  69. __field(struct i915_address_space *, vm)
  70. __field(u64, offset)
  71. __field(u64, size)
  72. ),
  73. TP_fast_assign(
  74. __entry->obj = vma->obj;
  75. __entry->vm = vma->vm;
  76. __entry->offset = vma->node.start;
  77. __entry->size = vma->node.size;
  78. ),
  79. TP_printk("obj=%p, offset=0x%016llx size=0x%llx vm=%p",
  80. __entry->obj, __entry->offset, __entry->size, __entry->vm)
  81. );
  82. TRACE_EVENT(i915_gem_object_pwrite,
  83. TP_PROTO(struct drm_i915_gem_object *obj, u64 offset, u64 len),
  84. TP_ARGS(obj, offset, len),
  85. TP_STRUCT__entry(
  86. __field(struct drm_i915_gem_object *, obj)
  87. __field(u64, offset)
  88. __field(u64, len)
  89. ),
  90. TP_fast_assign(
  91. __entry->obj = obj;
  92. __entry->offset = offset;
  93. __entry->len = len;
  94. ),
  95. TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
  96. __entry->obj, __entry->offset, __entry->len)
  97. );
  98. TRACE_EVENT(i915_gem_object_pread,
  99. TP_PROTO(struct drm_i915_gem_object *obj, u64 offset, u64 len),
  100. TP_ARGS(obj, offset, len),
  101. TP_STRUCT__entry(
  102. __field(struct drm_i915_gem_object *, obj)
  103. __field(u64, offset)
  104. __field(u64, len)
  105. ),
  106. TP_fast_assign(
  107. __entry->obj = obj;
  108. __entry->offset = offset;
  109. __entry->len = len;
  110. ),
  111. TP_printk("obj=%p, offset=0x%llx, len=0x%llx",
  112. __entry->obj, __entry->offset, __entry->len)
  113. );
  114. TRACE_EVENT(i915_gem_object_fault,
  115. TP_PROTO(struct drm_i915_gem_object *obj, u64 index, bool gtt, bool write),
  116. TP_ARGS(obj, index, gtt, write),
  117. TP_STRUCT__entry(
  118. __field(struct drm_i915_gem_object *, obj)
  119. __field(u64, index)
  120. __field(bool, gtt)
  121. __field(bool, write)
  122. ),
  123. TP_fast_assign(
  124. __entry->obj = obj;
  125. __entry->index = index;
  126. __entry->gtt = gtt;
  127. __entry->write = write;
  128. ),
  129. TP_printk("obj=%p, %s index=%llu %s",
  130. __entry->obj,
  131. __entry->gtt ? "GTT" : "CPU",
  132. __entry->index,
  133. __entry->write ? ", writable" : "")
  134. );
  135. DECLARE_EVENT_CLASS(i915_gem_object,
  136. TP_PROTO(struct drm_i915_gem_object *obj),
  137. TP_ARGS(obj),
  138. TP_STRUCT__entry(
  139. __field(struct drm_i915_gem_object *, obj)
  140. ),
  141. TP_fast_assign(
  142. __entry->obj = obj;
  143. ),
  144. TP_printk("obj=%p", __entry->obj)
  145. );
  146. DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush,
  147. TP_PROTO(struct drm_i915_gem_object *obj),
  148. TP_ARGS(obj)
  149. );
  150. DEFINE_EVENT(i915_gem_object, i915_gem_object_destroy,
  151. TP_PROTO(struct drm_i915_gem_object *obj),
  152. TP_ARGS(obj)
  153. );
  154. TRACE_EVENT(i915_gem_evict,
  155. TP_PROTO(struct i915_address_space *vm, u64 size, u64 align, unsigned int flags),
  156. TP_ARGS(vm, size, align, flags),
  157. TP_STRUCT__entry(
  158. __field(u32, dev)
  159. __field(struct i915_address_space *, vm)
  160. __field(u64, size)
  161. __field(u64, align)
  162. __field(unsigned int, flags)
  163. ),
  164. TP_fast_assign(
  165. __entry->dev = vm->i915->drm.primary->index;
  166. __entry->vm = vm;
  167. __entry->size = size;
  168. __entry->align = align;
  169. __entry->flags = flags;
  170. ),
  171. TP_printk("dev=%d, vm=%p, size=0x%llx, align=0x%llx %s",
  172. __entry->dev, __entry->vm, __entry->size, __entry->align,
  173. __entry->flags & PIN_MAPPABLE ? ", mappable" : "")
  174. );
  175. TRACE_EVENT(i915_gem_evict_node,
  176. TP_PROTO(struct i915_address_space *vm, struct drm_mm_node *node, unsigned int flags),
  177. TP_ARGS(vm, node, flags),
  178. TP_STRUCT__entry(
  179. __field(u32, dev)
  180. __field(struct i915_address_space *, vm)
  181. __field(u64, start)
  182. __field(u64, size)
  183. __field(unsigned long, color)
  184. __field(unsigned int, flags)
  185. ),
  186. TP_fast_assign(
  187. __entry->dev = vm->i915->drm.primary->index;
  188. __entry->vm = vm;
  189. __entry->start = node->start;
  190. __entry->size = node->size;
  191. __entry->color = node->color;
  192. __entry->flags = flags;
  193. ),
  194. TP_printk("dev=%d, vm=%p, start=0x%llx size=0x%llx, color=0x%lx, flags=%x",
  195. __entry->dev, __entry->vm,
  196. __entry->start, __entry->size,
  197. __entry->color, __entry->flags)
  198. );
  199. TRACE_EVENT(i915_gem_evict_vm,
  200. TP_PROTO(struct i915_address_space *vm),
  201. TP_ARGS(vm),
  202. TP_STRUCT__entry(
  203. __field(u32, dev)
  204. __field(struct i915_address_space *, vm)
  205. ),
  206. TP_fast_assign(
  207. __entry->dev = vm->i915->drm.primary->index;
  208. __entry->vm = vm;
  209. ),
  210. TP_printk("dev=%d, vm=%p", __entry->dev, __entry->vm)
  211. );
  212. TRACE_EVENT(i915_request_queue,
  213. TP_PROTO(struct i915_request *rq, u32 flags),
  214. TP_ARGS(rq, flags),
  215. TP_STRUCT__entry(
  216. __field(u32, dev)
  217. __field(u64, ctx)
  218. __field(u16, class)
  219. __field(u16, instance)
  220. __field(u32, seqno)
  221. __field(u32, flags)
  222. ),
  223. TP_fast_assign(
  224. __entry->dev = rq->i915->drm.primary->index;
  225. __entry->class = rq->engine->uabi_class;
  226. __entry->instance = rq->engine->uabi_instance;
  227. __entry->ctx = rq->fence.context;
  228. __entry->seqno = rq->fence.seqno;
  229. __entry->flags = flags;
  230. ),
  231. TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, flags=0x%x",
  232. __entry->dev, __entry->class, __entry->instance,
  233. __entry->ctx, __entry->seqno, __entry->flags)
  234. );
  235. DECLARE_EVENT_CLASS(i915_request,
  236. TP_PROTO(struct i915_request *rq),
  237. TP_ARGS(rq),
  238. TP_STRUCT__entry(
  239. __field(u32, dev)
  240. __field(u64, ctx)
  241. __field(u16, class)
  242. __field(u16, instance)
  243. __field(u32, seqno)
  244. __field(u32, tail)
  245. ),
  246. TP_fast_assign(
  247. __entry->dev = rq->i915->drm.primary->index;
  248. __entry->class = rq->engine->uabi_class;
  249. __entry->instance = rq->engine->uabi_instance;
  250. __entry->ctx = rq->fence.context;
  251. __entry->seqno = rq->fence.seqno;
  252. __entry->tail = rq->tail;
  253. ),
  254. TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, tail=%u",
  255. __entry->dev, __entry->class, __entry->instance,
  256. __entry->ctx, __entry->seqno, __entry->tail)
  257. );
  258. DEFINE_EVENT(i915_request, i915_request_add,
  259. TP_PROTO(struct i915_request *rq),
  260. TP_ARGS(rq)
  261. );
  262. #if IS_ENABLED(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS)
  263. DEFINE_EVENT(i915_request, i915_request_guc_submit,
  264. TP_PROTO(struct i915_request *rq),
  265. TP_ARGS(rq)
  266. );
  267. DEFINE_EVENT(i915_request, i915_request_submit,
  268. TP_PROTO(struct i915_request *rq),
  269. TP_ARGS(rq)
  270. );
  271. DEFINE_EVENT(i915_request, i915_request_execute,
  272. TP_PROTO(struct i915_request *rq),
  273. TP_ARGS(rq)
  274. );
  275. TRACE_EVENT(i915_request_in,
  276. TP_PROTO(struct i915_request *rq, unsigned int port),
  277. TP_ARGS(rq, port),
  278. TP_STRUCT__entry(
  279. __field(u32, dev)
  280. __field(u64, ctx)
  281. __field(u16, class)
  282. __field(u16, instance)
  283. __field(u32, seqno)
  284. __field(u32, port)
  285. __field(s32, prio)
  286. ),
  287. TP_fast_assign(
  288. __entry->dev = rq->i915->drm.primary->index;
  289. __entry->class = rq->engine->uabi_class;
  290. __entry->instance = rq->engine->uabi_instance;
  291. __entry->ctx = rq->fence.context;
  292. __entry->seqno = rq->fence.seqno;
  293. __entry->prio = rq->sched.attr.priority;
  294. __entry->port = port;
  295. ),
  296. TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, prio=%d, port=%u",
  297. __entry->dev, __entry->class, __entry->instance,
  298. __entry->ctx, __entry->seqno,
  299. __entry->prio, __entry->port)
  300. );
  301. TRACE_EVENT(i915_request_out,
  302. TP_PROTO(struct i915_request *rq),
  303. TP_ARGS(rq),
  304. TP_STRUCT__entry(
  305. __field(u32, dev)
  306. __field(u64, ctx)
  307. __field(u16, class)
  308. __field(u16, instance)
  309. __field(u32, seqno)
  310. __field(u32, completed)
  311. ),
  312. TP_fast_assign(
  313. __entry->dev = rq->i915->drm.primary->index;
  314. __entry->class = rq->engine->uabi_class;
  315. __entry->instance = rq->engine->uabi_instance;
  316. __entry->ctx = rq->fence.context;
  317. __entry->seqno = rq->fence.seqno;
  318. __entry->completed = i915_request_completed(rq);
  319. ),
  320. TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, completed?=%u",
  321. __entry->dev, __entry->class, __entry->instance,
  322. __entry->ctx, __entry->seqno, __entry->completed)
  323. );
  324. DECLARE_EVENT_CLASS(intel_context,
  325. TP_PROTO(struct intel_context *ce),
  326. TP_ARGS(ce),
  327. TP_STRUCT__entry(
  328. __field(u32, guc_id)
  329. __field(int, pin_count)
  330. __field(u32, sched_state)
  331. __field(u8, guc_prio)
  332. ),
  333. TP_fast_assign(
  334. __entry->guc_id = ce->guc_id.id;
  335. __entry->pin_count = atomic_read(&ce->pin_count);
  336. __entry->sched_state = ce->guc_state.sched_state;
  337. __entry->guc_prio = ce->guc_state.prio;
  338. ),
  339. TP_printk("guc_id=%d, pin_count=%d sched_state=0x%x, guc_prio=%u",
  340. __entry->guc_id, __entry->pin_count,
  341. __entry->sched_state,
  342. __entry->guc_prio)
  343. );
  344. DEFINE_EVENT(intel_context, intel_context_set_prio,
  345. TP_PROTO(struct intel_context *ce),
  346. TP_ARGS(ce)
  347. );
  348. DEFINE_EVENT(intel_context, intel_context_reset,
  349. TP_PROTO(struct intel_context *ce),
  350. TP_ARGS(ce)
  351. );
  352. DEFINE_EVENT(intel_context, intel_context_ban,
  353. TP_PROTO(struct intel_context *ce),
  354. TP_ARGS(ce)
  355. );
  356. DEFINE_EVENT(intel_context, intel_context_register,
  357. TP_PROTO(struct intel_context *ce),
  358. TP_ARGS(ce)
  359. );
  360. DEFINE_EVENT(intel_context, intel_context_deregister,
  361. TP_PROTO(struct intel_context *ce),
  362. TP_ARGS(ce)
  363. );
  364. DEFINE_EVENT(intel_context, intel_context_deregister_done,
  365. TP_PROTO(struct intel_context *ce),
  366. TP_ARGS(ce)
  367. );
  368. DEFINE_EVENT(intel_context, intel_context_sched_enable,
  369. TP_PROTO(struct intel_context *ce),
  370. TP_ARGS(ce)
  371. );
  372. DEFINE_EVENT(intel_context, intel_context_sched_disable,
  373. TP_PROTO(struct intel_context *ce),
  374. TP_ARGS(ce)
  375. );
  376. DEFINE_EVENT(intel_context, intel_context_sched_done,
  377. TP_PROTO(struct intel_context *ce),
  378. TP_ARGS(ce)
  379. );
  380. DEFINE_EVENT(intel_context, intel_context_create,
  381. TP_PROTO(struct intel_context *ce),
  382. TP_ARGS(ce)
  383. );
  384. DEFINE_EVENT(intel_context, intel_context_fence_release,
  385. TP_PROTO(struct intel_context *ce),
  386. TP_ARGS(ce)
  387. );
  388. DEFINE_EVENT(intel_context, intel_context_free,
  389. TP_PROTO(struct intel_context *ce),
  390. TP_ARGS(ce)
  391. );
  392. DEFINE_EVENT(intel_context, intel_context_steal_guc_id,
  393. TP_PROTO(struct intel_context *ce),
  394. TP_ARGS(ce)
  395. );
  396. DEFINE_EVENT(intel_context, intel_context_do_pin,
  397. TP_PROTO(struct intel_context *ce),
  398. TP_ARGS(ce)
  399. );
  400. DEFINE_EVENT(intel_context, intel_context_do_unpin,
  401. TP_PROTO(struct intel_context *ce),
  402. TP_ARGS(ce)
  403. );
  404. #else
  405. #if !defined(TRACE_HEADER_MULTI_READ)
  406. static inline void
  407. trace_i915_request_guc_submit(struct i915_request *rq)
  408. {
  409. }
  410. static inline void
  411. trace_i915_request_submit(struct i915_request *rq)
  412. {
  413. }
  414. static inline void
  415. trace_i915_request_execute(struct i915_request *rq)
  416. {
  417. }
  418. static inline void
  419. trace_i915_request_in(struct i915_request *rq, unsigned int port)
  420. {
  421. }
  422. static inline void
  423. trace_i915_request_out(struct i915_request *rq)
  424. {
  425. }
  426. static inline void
  427. trace_intel_context_set_prio(struct intel_context *ce)
  428. {
  429. }
  430. static inline void
  431. trace_intel_context_reset(struct intel_context *ce)
  432. {
  433. }
  434. static inline void
  435. trace_intel_context_ban(struct intel_context *ce)
  436. {
  437. }
  438. static inline void
  439. trace_intel_context_register(struct intel_context *ce)
  440. {
  441. }
  442. static inline void
  443. trace_intel_context_deregister(struct intel_context *ce)
  444. {
  445. }
  446. static inline void
  447. trace_intel_context_deregister_done(struct intel_context *ce)
  448. {
  449. }
  450. static inline void
  451. trace_intel_context_sched_enable(struct intel_context *ce)
  452. {
  453. }
  454. static inline void
  455. trace_intel_context_sched_disable(struct intel_context *ce)
  456. {
  457. }
  458. static inline void
  459. trace_intel_context_sched_done(struct intel_context *ce)
  460. {
  461. }
  462. static inline void
  463. trace_intel_context_create(struct intel_context *ce)
  464. {
  465. }
  466. static inline void
  467. trace_intel_context_fence_release(struct intel_context *ce)
  468. {
  469. }
  470. static inline void
  471. trace_intel_context_free(struct intel_context *ce)
  472. {
  473. }
  474. static inline void
  475. trace_intel_context_steal_guc_id(struct intel_context *ce)
  476. {
  477. }
  478. static inline void
  479. trace_intel_context_do_pin(struct intel_context *ce)
  480. {
  481. }
  482. static inline void
  483. trace_intel_context_do_unpin(struct intel_context *ce)
  484. {
  485. }
  486. #endif
  487. #endif
  488. DEFINE_EVENT(i915_request, i915_request_retire,
  489. TP_PROTO(struct i915_request *rq),
  490. TP_ARGS(rq)
  491. );
  492. TRACE_EVENT(i915_request_wait_begin,
  493. TP_PROTO(struct i915_request *rq, unsigned int flags),
  494. TP_ARGS(rq, flags),
  495. TP_STRUCT__entry(
  496. __field(u32, dev)
  497. __field(u64, ctx)
  498. __field(u16, class)
  499. __field(u16, instance)
  500. __field(u32, seqno)
  501. __field(unsigned int, flags)
  502. ),
  503. /* NB: the blocking information is racy since mutex_is_locked
  504. * doesn't check that the current thread holds the lock. The only
  505. * other option would be to pass the boolean information of whether
  506. * or not the class was blocking down through the stack which is
  507. * less desirable.
  508. */
  509. TP_fast_assign(
  510. __entry->dev = rq->i915->drm.primary->index;
  511. __entry->class = rq->engine->uabi_class;
  512. __entry->instance = rq->engine->uabi_instance;
  513. __entry->ctx = rq->fence.context;
  514. __entry->seqno = rq->fence.seqno;
  515. __entry->flags = flags;
  516. ),
  517. TP_printk("dev=%u, engine=%u:%u, ctx=%llu, seqno=%u, flags=0x%x",
  518. __entry->dev, __entry->class, __entry->instance,
  519. __entry->ctx, __entry->seqno,
  520. __entry->flags)
  521. );
  522. DEFINE_EVENT(i915_request, i915_request_wait_end,
  523. TP_PROTO(struct i915_request *rq),
  524. TP_ARGS(rq)
  525. );
  526. /**
  527. * DOC: i915_ppgtt_create and i915_ppgtt_release tracepoints
  528. *
  529. * With full ppgtt enabled each process using drm will allocate at least one
  530. * translation table. With these traces it is possible to keep track of the
  531. * allocation and of the lifetime of the tables; this can be used during
  532. * testing/debug to verify that we are not leaking ppgtts.
  533. * These traces identify the ppgtt through the vm pointer, which is also printed
  534. * by the i915_vma_bind and i915_vma_unbind tracepoints.
  535. */
  536. DECLARE_EVENT_CLASS(i915_ppgtt,
  537. TP_PROTO(struct i915_address_space *vm),
  538. TP_ARGS(vm),
  539. TP_STRUCT__entry(
  540. __field(struct i915_address_space *, vm)
  541. __field(u32, dev)
  542. ),
  543. TP_fast_assign(
  544. __entry->vm = vm;
  545. __entry->dev = vm->i915->drm.primary->index;
  546. ),
  547. TP_printk("dev=%u, vm=%p", __entry->dev, __entry->vm)
  548. )
  549. DEFINE_EVENT(i915_ppgtt, i915_ppgtt_create,
  550. TP_PROTO(struct i915_address_space *vm),
  551. TP_ARGS(vm)
  552. );
  553. DEFINE_EVENT(i915_ppgtt, i915_ppgtt_release,
  554. TP_PROTO(struct i915_address_space *vm),
  555. TP_ARGS(vm)
  556. );
  557. /**
  558. * DOC: i915_context_create and i915_context_free tracepoints
  559. *
  560. * These tracepoints are used to track creation and deletion of contexts.
  561. * If full ppgtt is enabled, they also print the address of the vm assigned to
  562. * the context.
  563. */
  564. DECLARE_EVENT_CLASS(i915_context,
  565. TP_PROTO(struct i915_gem_context *ctx),
  566. TP_ARGS(ctx),
  567. TP_STRUCT__entry(
  568. __field(u32, dev)
  569. __field(struct i915_gem_context *, ctx)
  570. __field(struct i915_address_space *, vm)
  571. ),
  572. TP_fast_assign(
  573. __entry->dev = ctx->i915->drm.primary->index;
  574. __entry->ctx = ctx;
  575. __entry->vm = ctx->vm;
  576. ),
  577. TP_printk("dev=%u, ctx=%p, ctx_vm=%p",
  578. __entry->dev, __entry->ctx, __entry->vm)
  579. )
  580. DEFINE_EVENT(i915_context, i915_context_create,
  581. TP_PROTO(struct i915_gem_context *ctx),
  582. TP_ARGS(ctx)
  583. );
  584. DEFINE_EVENT(i915_context, i915_context_free,
  585. TP_PROTO(struct i915_gem_context *ctx),
  586. TP_ARGS(ctx)
  587. );
  588. #endif /* _I915_TRACE_H_ */
  589. /* This part must be outside protection */
  590. #undef TRACE_INCLUDE_PATH
  591. #undef TRACE_INCLUDE_FILE
  592. #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
  593. #define TRACE_INCLUDE_FILE i915_trace
  594. #include <trace/define_trace.h>