[Intel-gfx] [RFC 4/6] drm/i915: Add i915 perf event for Haswell OA unit

kbuild test robot lkp at intel.com
Tue Sep 29 07:55:39 PDT 2015


Hi Robert,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore]

config: i386-defconfig (attached as .config)
reproduce:
  git checkout a1d59679ae8f3e7e7659e9723ae3fc69af2532e6
  # save the attached .config to linux build tree
  make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/i915/i915_perf.c: In function 'append_oa_sample':
>> drivers/gpu/drm/i915/i915_perf.c:199:2: warning: #warning "fixme: extract context ID from OA reports" [-Wcpp]
    #warning "fixme: extract context ID from OA reports"
     ^
>> drivers/gpu/drm/i915/i915_perf.c:205:2: warning: #warning "fixme: extract timestamp from OA reports" [-Wcpp]
    #warning "fixme: extract timestamp from OA reports"
     ^
   drivers/gpu/drm/i915/i915_perf.c: In function 'append_oa_status':
>> drivers/gpu/drm/i915/i915_perf.c:155:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(read_state->buf, &header, sizeof(header));
     ^
   drivers/gpu/drm/i915/i915_perf.c: In function 'append_oa_sample':
   drivers/gpu/drm/i915/i915_perf.c:195:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
     copy_to_user(read_state->buf, &header, sizeof(header));
     ^
   drivers/gpu/drm/i915/i915_perf.c:200:3: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
      copy_to_user(read_state->buf, &dummy_ctx_id, 4);
      ^
   drivers/gpu/drm/i915/i915_perf.c:206:3: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
      copy_to_user(read_state->buf, &dummy_timestamp, 4);
      ^
   drivers/gpu/drm/i915/i915_perf.c:211:3: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
      copy_to_user(read_state->buf, report, report_size);
      ^

vim +199 drivers/gpu/drm/i915/i915_perf.c

   149	{
   150		struct drm_i915_perf_event_header header = { type, 0, sizeof(header) };
   151	
   152		if ((read_state->count - read_state->read) < header.size)
   153			return false;
   154	
 > 155		copy_to_user(read_state->buf, &header, sizeof(header));
   156	
   157		read_state->buf += sizeof(header);
   158		read_state->read += header.size;
   159	
   160		return true;
   161	}
   162	
   163	static bool append_oa_sample(struct i915_perf_event *event,
   164				     struct i915_perf_read_state *read_state,
   165				     const u8 *report)
   166	{
   167		struct drm_i915_private *dev_priv = event->dev_priv;
   168		int report_size = dev_priv->perf.oa.oa_buffer.format_size;
   169		struct drm_i915_perf_event_header header;
   170		u32 sample_flags = event->sample_flags;
   171		u32 dummy_ctx_id = 0;
   172		u32 dummy_timestamp = 0;
   173	
   174		header.type = DRM_I915_PERF_RECORD_SAMPLE;
   175		header.misc = 0;
   176		header.size = sizeof(header);
   177	
   178	
   179		/* XXX: could pre-compute this when opening the event... */
   180	
   181		if (sample_flags & I915_PERF_SAMPLE_CTXID)
   182			header.size += 4;
   183	
   184		if (sample_flags & I915_PERF_SAMPLE_TIMESTAMP)
   185			header.size += 4;
   186	
   187		if (sample_flags & I915_PERF_SAMPLE_OA_REPORT)
   188			header.size += report_size;
   189	
   190	
   191		if ((read_state->count - read_state->read) < header.size)
   192			return false;
   193	
   194	
   195		copy_to_user(read_state->buf, &header, sizeof(header));
   196		read_state->buf += sizeof(header);
   197	
   198		if (sample_flags & I915_PERF_SAMPLE_CTXID) {
 > 199	#warning "fixme: extract context ID from OA reports"
   200			copy_to_user(read_state->buf, &dummy_ctx_id, 4);
   201			read_state->buf += 4;
   202		}
   203	
   204		if (sample_flags & I915_PERF_SAMPLE_TIMESTAMP) {
 > 205	#warning "fixme: extract timestamp from OA reports"
   206			copy_to_user(read_state->buf, &dummy_timestamp, 4);
   207			read_state->buf += 4;
   208		}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 23761 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20150929/d423ad00/attachment-0001.obj>


More information about the Intel-gfx mailing list