Lines Matching defs:report
124 * and while we could pull a report out of the OA buffer we can't
125 * trigger a report from the cpu on demand.
127 * Related to being report based; the OA counters are configured in HW as a
132 * OA unit report format used to capture all counters in a set, or specify a
148 * With the OA unit's report formats, counters are packed together as 32
149 * or 40bit values, with the largest report size being 256 bytes.
173 * ring buffer. To include more than the OA report we'd have to copy the
174 * report into an intermediate larger buffer. I'd been considering allowing a
188 * majority of the OA driver ran in atomic context, including all OA report
239 * by checking for a zeroed report-id field in tail reports, we want to account
245 * report with its first 2 dwords not 0 meaning its previous report is
248 * first dword is the reason for this report while the second is the timestamp,
280 * overflow in OA report timestamps.
313 /* XXX: beware if future OA HW adds new report formats that the current
349 * @oa_format: An OA unit HW report format
461 static u64 oa_report_id(struct i915_perf_stream *stream, void *report)
463 return oa_report_header_64bit(stream) ? *(u64 *)report : *(u32 *)report;
466 static u64 oa_report_reason(struct i915_perf_stream *stream, void *report)
468 return (oa_report_id(stream, report) >> OAREPORT_REASON_SHIFT) &
474 static void oa_report_id_clear(struct i915_perf_stream *stream, u32 *report)
477 *(u64 *)report = 0;
479 *report = 0;
482 static bool oa_report_ctx_invalid(struct i915_perf_stream *stream, void *report)
484 return !(oa_report_id(stream, report) &
488 static u64 oa_timestamp(struct i915_perf_stream *stream, void *report)
491 *((u64 *)report + 1) :
492 *((u32 *)report + 1);
495 static void oa_timestamp_clear(struct i915_perf_stream *stream, u32 *report)
498 *(u64 *)&report[2] = 0;
500 report[1] = 0;
503 static u32 oa_context_id(struct i915_perf_stream *stream, u32 *report)
505 u32 ctx_id = oa_report_header_64bit(stream) ? report[4] : report[2];
510 static void oa_context_id_squash(struct i915_perf_stream *stream, u32 *report)
513 report[4] = INVALID_CTX_ID;
515 report[2] = INVALID_CTX_ID;
560 * steps. Also the report size may not be a power of 2. Compute
561 * potentially partially landed report in the OA buffer
578 /* Walk the stream backward until we find a report with report
581 * to 256 bytes long, we can't tell whether a report has fully
582 * landed in memory before the report id and timestamp of the
583 * following report have effectively landed.
590 void *report = stream->oa_buffer.vaddr + tail;
592 if (oa_report_id(stream, report) ||
593 oa_timestamp(stream, report))
602 "unlanded report(s) head=0x%x tail=0x%x hw_tail=0x%x\n",
621 * @type: The kind of status to report to userspace
650 * append_oa_sample - Copies single OA report into userspace read() buffer.
655 * @report: A single OA report to (optionally) include as part of the sample
670 const u8 *report)
690 report_size_partial = oa_buf_end - report;
693 if (copy_to_user(buf, report, report_size_partial))
700 } else if (copy_to_user(buf, report, report_size)) {
766 * only be incremented by multiples of the report size.
779 u8 *report = oa_buf_base + head;
780 u32 *report32 = (void *)report;
786 * triggered this specific report (mostly timer
789 reason = oa_report_reason(stream, report);
806 * context-switch-report: This is a report with the reason type
810 * context-valid-bit: A bit that is set in the report ID field
814 * context-switch-report with context-valid-bit set to 0.
820 * switch report if a new context switched in. For all other
826 * below to squash the context ID would render the report
832 if (oa_report_ctx_invalid(stream, report) &&
867 * identify a switch before any 'context switch' report.
884 report);
893 * Clear out the report id and timestamp as a means
903 /* Zero out the entire report */
1082 * only be incremented by multiples of the report size (notably also
1096 u8 *report = oa_buf_base + head;
1097 u32 *report32 = (void *)report;
1099 /* All the report sizes factor neatly into the buffer
1100 * size so we never expect to see a report split
1110 "Spurious OA head ptr: non-integral report offset\n");
1114 /* The report-ID field for periodic samples includes
1116 * the report and is never expected to be zero so we
1117 * can check that the report isn't invalid before
1123 "Skipping spurious, invalid OA report\n");
1127 ret = append_oa_sample(stream, buf, count, offset, report);
1198 * which will start to report a near-empty buffer after an
1724 "%d spurious OA report notices suppressed due to ratelimiting\n",
1767 * report-id field to make sure it's non-zero which relies on
3328 "Only OA report sampling supported\n");
3351 "OA report format not specified\n");
3539 * oabuffer has >= 1 report we don't immediately know whether
3557 /* We allow the poll checking to sometimes report false positive EPOLLIN
3558 * events where we might actually report EAGAIN on read() if there's
4129 "Out-of-range OA report format %llu\n",
4135 "Unsupported OA report format %llu\n",