diff mbox

[07/12] drm/i915: Add support for having pid output with OA report

Message ID 1501487985-2017-8-git-send-email-sagar.a.kamble@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sagar.a.kamble@intel.com July 31, 2017, 7:59 a.m. UTC
From: Sourab Gupta <sourab.gupta@intel.com>

This patch introduces flags and adds support for having pid output with
the OA reports generated through the RCS commands.

When the stream is opened with pid sample type, the pid information is also
captured through the command stream samples and forwarded along with the
OA reports.

v2: Changed payload field pid to u64 to keep all sample data aligned at 8
bytes. (Lionel)

Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h  |  7 ++++++
 drivers/gpu/drm/i915/i915_perf.c | 48 +++++++++++++++++++++++++++++++++++++++-
 include/uapi/drm/i915_drm.h      |  7 ++++++
 3 files changed, 61 insertions(+), 1 deletion(-)

Comments

kernel test robot July 31, 2017, 7:24 p.m. UTC | #1
Hi Sourab,

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on next-20170731]
[cannot apply to v4.13-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Sagar-Arun-Kamble/i915-perf-support-for-command-stream-based-OA-GPU-and-workload-metrics-capture/20170731-184412
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
   include/linux/init.h:1: warning: no structured comments found
   include/linux/mod_devicetable.h:687: warning: Excess struct/union/enum/typedef member 'ver_major' description in 'fsl_mc_device_id'
   include/linux/mod_devicetable.h:687: warning: Excess struct/union/enum/typedef member 'ver_minor' description in 'fsl_mc_device_id'
   kernel/sched/core.c:2080: warning: No description found for parameter 'rf'
   kernel/sched/core.c:2080: warning: Excess function parameter 'cookie' description in 'try_to_wake_up_local'
   include/linux/wait.h:555: warning: No description found for parameter 'wq'
   include/linux/wait.h:555: warning: Excess function parameter 'wq_head' description in 'wait_event_interruptible_hrtimeout'
   include/linux/wait.h:759: warning: No description found for parameter 'wq_head'
   include/linux/wait.h:759: warning: Excess function parameter 'wq' description in 'wait_event_killable'
   include/linux/kthread.h:26: warning: Excess function parameter '...' description in 'kthread_create'
   kernel/sys.c:1: warning: no structured comments found
   include/linux/device.h:968: warning: No description found for parameter 'dma_ops'
   drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
   include/linux/iio/iio.h:603: warning: No description found for parameter 'trig_readonly'
   include/linux/iio/trigger.h:151: warning: No description found for parameter 'indio_dev'
   include/linux/iio/trigger.h:151: warning: No description found for parameter 'trig'
   include/linux/device.h:969: warning: No description found for parameter 'dma_ops'
   drivers/ata/libata-eh.c:1449: warning: No description found for parameter 'link'
   drivers/ata/libata-eh.c:1449: warning: Excess function parameter 'ap' description in 'ata_eh_done'
   drivers/ata/libata-eh.c:1590: warning: No description found for parameter 'qc'
   drivers/ata/libata-eh.c:1590: warning: Excess function parameter 'dev' description in 'ata_eh_request_sense'
   drivers/mtd/nand/nand_base.c:2751: warning: Excess function parameter 'cached' description in 'nand_write_page'
   drivers/mtd/nand/nand_base.c:2751: warning: Excess function parameter 'cached' description in 'nand_write_page'
   arch/s390/include/asm/cmb.h:1: warning: no structured comments found
   drivers/scsi/scsi_lib.c:1116: warning: No description found for parameter 'rq'
   drivers/scsi/constants.c:1: warning: no structured comments found
   include/linux/usb/gadget.h:230: warning: No description found for parameter 'claimed'
   include/linux/usb/gadget.h:230: warning: No description found for parameter 'enabled'
   include/linux/usb/gadget.h:412: warning: No description found for parameter 'quirk_altset_not_supp'
   include/linux/usb/gadget.h:412: warning: No description found for parameter 'quirk_stall_not_supp'
   include/linux/usb/gadget.h:412: warning: No description found for parameter 'quirk_zlp_not_supp'
   fs/inode.c:1666: warning: No description found for parameter 'rcu'
   include/linux/jbd2.h:443: warning: No description found for parameter 'i_transaction'
   include/linux/jbd2.h:443: warning: No description found for parameter 'i_next_transaction'
   include/linux/jbd2.h:443: warning: No description found for parameter 'i_list'
   include/linux/jbd2.h:443: warning: No description found for parameter 'i_vfs_inode'
   include/linux/jbd2.h:443: warning: No description found for parameter 'i_flags'
   include/linux/jbd2.h:497: warning: No description found for parameter 'h_rsv_handle'
   include/linux/jbd2.h:497: warning: No description found for parameter 'h_reserved'
   include/linux/jbd2.h:497: warning: No description found for parameter 'h_type'
   include/linux/jbd2.h:497: warning: No description found for parameter 'h_line_no'
   include/linux/jbd2.h:497: warning: No description found for parameter 'h_start_jiffies'
   include/linux/jbd2.h:497: warning: No description found for parameter 'h_requested_credits'
   include/linux/jbd2.h:497: warning: No description found for parameter 'saved_alloc_context'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_chkpt_bhs'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_devname'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_average_commit_time'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_min_batch_time'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_max_batch_time'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_commit_callback'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_failed_commit'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_chksum_driver'
   include/linux/jbd2.h:1050: warning: No description found for parameter 'j_csum_seed'
   fs/jbd2/transaction.c:511: warning: No description found for parameter 'type'
   fs/jbd2/transaction.c:511: warning: No description found for parameter 'line_no'
   fs/jbd2/transaction.c:641: warning: No description found for parameter 'gfp_mask'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'debugfs_init'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_open_object'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_close_object'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'prime_handle_to_fd'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'prime_fd_to_handle'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_export'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_import'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_pin'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_unpin'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_res_obj'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_get_sg_table'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_import_sg_table'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_vmap'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_vunmap'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_mmap'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_vm_ops'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'major'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'minor'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'patchlevel'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'name'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'desc'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'date'
   include/drm/drm_drv.h:553: warning: No description found for parameter 'driver_features'
   drivers/gpu/drm/drm_modes.c:1623: warning: No description found for parameter 'display'
   drivers/gpu/drm/drm_modes.c:1623: warning: Excess function parameter 'connector' description in 'drm_mode_is_420_only'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_drv.h:2000: warning: No description found for parameter 'emit_sample_capture'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_buffer'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_samples'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_samples_lock'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'poll_wq'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'pollin'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'last_ctx_id'
>> drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'last_pid'
   drivers/gpu/drm/i915/i915_drv.h:2000: warning: No description found for parameter 'emit_sample_capture'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_buffer'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_samples'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_samples_lock'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'poll_wq'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'pollin'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'last_ctx_id'
>> drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'last_pid'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_drv.h:2000: warning: No description found for parameter 'emit_sample_capture'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_buffer'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_samples'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'cs_samples_lock'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'poll_wq'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'pollin'
   drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'last_ctx_id'
>> drivers/gpu/drm/i915/i915_drv.h:2083: warning: No description found for parameter 'last_pid'
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:1: warning: no structured comments found
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:1: warning: no structured comments found
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:1: warning: no structured comments found
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:1: warning: no structured comments found
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:1: warning: no structured comments found
   drivers/gpu/drm/i915/i915_perf.c:691: warning: No description found for parameter 'last_ts'
   drivers/gpu/drm/i915/i915_perf.c:1: warning: no structured comments found
   drivers/gpu/drm/i915/i915_perf.c:692: warning: No description found for parameter 'last_ts'
   drivers/gpu/host1x/bus.c:50: warning: Excess function parameter 'driver' description in 'host1x_subdev_add'
   Documentation/doc-guide/sphinx.rst:121: ERROR: Unknown target name: "sphinx c domain".
   kernel/sched/fair.c:7584: WARNING: Inline emphasis start-string without end-string.
   kernel/time/timer.c:1200: ERROR: Unexpected indentation.
   kernel/time/timer.c:1202: ERROR: Unexpected indentation.
   kernel/time/timer.c:1203: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:108: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:111: ERROR: Unexpected indentation.
   include/linux/wait.h:113: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/time/hrtimer.c:991: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/signal.c:323: WARNING: Inline literal start-string without end-string.
   kernel/rcu/tree.c:3187: ERROR: Unexpected indentation.
   kernel/rcu/tree.c:3214: ERROR: Unexpected indentation.
   kernel/rcu/tree.c:3215: WARNING: Bullet list ends without a blank line; unexpected unindent.
   include/linux/iio/iio.h:219: ERROR: Unexpected indentation.
   include/linux/iio/iio.h:220: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/iio/iio.h:226: WARNING: Definition list ends without a blank line; unexpected unindent.
   drivers/iio/industrialio-core.c:633: ERROR: Unknown target name: "iio_val".
   drivers/iio/industrialio-core.c:640: ERROR: Unknown target name: "iio_val".
   drivers/ata/libata-core.c:5906: ERROR: Unknown target name: "hw".
   drivers/message/fusion/mptbase.c:5051: WARNING: Definition list ends without a blank line; unexpected unindent.
   drivers/tty/serial/serial_core.c:1897: WARNING: Definition list ends without a blank line; unexpected unindent.
   drivers/pci/pci.c:3470: ERROR: Unexpected indentation.
   include/linux/regulator/driver.h:271: ERROR: Unknown target name: "regulator_regmap_x_voltage".
   include/linux/spi/spi.h:373: ERROR: Unexpected indentation.
   drivers/w1/w1_io.c:196: WARNING: Definition list ends without a blank line; unexpected unindent.
   block/bio.c:404: ERROR: Unknown target name: "gfp".
   include/drm/drm_modeset_helper_vtables.h:1182: WARNING: Bullet list ends without a blank line; unexpected unindent.
   drivers/gpu/drm/drm_scdc_helper.c:203: ERROR: Unexpected indentation.
   drivers/gpu/drm/drm_scdc_helper.c:204: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/gpu/todo.rst:111: ERROR: Unknown target name: "drm_fb".
   sound/soc/soc-core.c:2703: ERROR: Unknown target name: "snd_soc_daifmt".
   sound/core/jack.c:312: ERROR: Unknown target name: "snd_jack_btn".
   Documentation/media/v4l-drivers/imx.rst:: WARNING: document isn't included in any toctree
   Documentation/virtual/kvm/vcpu-requests.rst:: WARNING: document isn't included in any toctree
   Documentation/dev-tools/kselftest.rst:15: WARNING: Could not lex literal_block as "c". Highlighting skipped.
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected
   Fontconfig warning: "~/.fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected

vim +/last_pid +2083 drivers/gpu/drm/i915/i915_drv.h

eec688e1 Robert Bragg 2016-11-07  1925  
16d98b31 Robert Bragg 2016-12-07  1926  /**
16d98b31 Robert Bragg 2016-12-07  1927   * struct i915_perf_stream_ops - the OPs to support a specific stream type
16d98b31 Robert Bragg 2016-12-07  1928   */
eec688e1 Robert Bragg 2016-11-07  1929  struct i915_perf_stream_ops {
16d98b31 Robert Bragg 2016-12-07  1930  	/**
16d98b31 Robert Bragg 2016-12-07  1931  	 * @enable: Enables the collection of HW samples, either in response to
16d98b31 Robert Bragg 2016-12-07  1932  	 * `I915_PERF_IOCTL_ENABLE` or implicitly called when stream is opened
16d98b31 Robert Bragg 2016-12-07  1933  	 * without `I915_PERF_FLAG_DISABLED`.
eec688e1 Robert Bragg 2016-11-07  1934  	 */
eec688e1 Robert Bragg 2016-11-07  1935  	void (*enable)(struct i915_perf_stream *stream);
eec688e1 Robert Bragg 2016-11-07  1936  
16d98b31 Robert Bragg 2016-12-07  1937  	/**
16d98b31 Robert Bragg 2016-12-07  1938  	 * @disable: Disables the collection of HW samples, either in response
16d98b31 Robert Bragg 2016-12-07  1939  	 * to `I915_PERF_IOCTL_DISABLE` or implicitly called before destroying
16d98b31 Robert Bragg 2016-12-07  1940  	 * the stream.
eec688e1 Robert Bragg 2016-11-07  1941  	 */
eec688e1 Robert Bragg 2016-11-07  1942  	void (*disable)(struct i915_perf_stream *stream);
eec688e1 Robert Bragg 2016-11-07  1943  
16d98b31 Robert Bragg 2016-12-07  1944  	/**
16d98b31 Robert Bragg 2016-12-07  1945  	 * @poll_wait: Call poll_wait, passing a wait queue that will be woken
eec688e1 Robert Bragg 2016-11-07  1946  	 * once there is something ready to read() for the stream
eec688e1 Robert Bragg 2016-11-07  1947  	 */
eec688e1 Robert Bragg 2016-11-07  1948  	void (*poll_wait)(struct i915_perf_stream *stream,
eec688e1 Robert Bragg 2016-11-07  1949  			  struct file *file,
eec688e1 Robert Bragg 2016-11-07  1950  			  poll_table *wait);
eec688e1 Robert Bragg 2016-11-07  1951  
16d98b31 Robert Bragg 2016-12-07  1952  	/**
16d98b31 Robert Bragg 2016-12-07  1953  	 * @wait_unlocked: For handling a blocking read, wait until there is
16d98b31 Robert Bragg 2016-12-07  1954  	 * something to ready to read() for the stream. E.g. wait on the same
d7965152 Robert Bragg 2016-11-07  1955  	 * wait queue that would be passed to poll_wait().
eec688e1 Robert Bragg 2016-11-07  1956  	 */
eec688e1 Robert Bragg 2016-11-07  1957  	int (*wait_unlocked)(struct i915_perf_stream *stream);
eec688e1 Robert Bragg 2016-11-07  1958  
16d98b31 Robert Bragg 2016-12-07  1959  	/**
16d98b31 Robert Bragg 2016-12-07  1960  	 * @read: Copy buffered metrics as records to userspace
16d98b31 Robert Bragg 2016-12-07  1961  	 * **buf**: the userspace, destination buffer
16d98b31 Robert Bragg 2016-12-07  1962  	 * **count**: the number of bytes to copy, requested by userspace
16d98b31 Robert Bragg 2016-12-07  1963  	 * **offset**: zero at the start of the read, updated as the read
16d98b31 Robert Bragg 2016-12-07  1964  	 * proceeds, it represents how many bytes have been copied so far and
16d98b31 Robert Bragg 2016-12-07  1965  	 * the buffer offset for copying the next record.
eec688e1 Robert Bragg 2016-11-07  1966  	 *
16d98b31 Robert Bragg 2016-12-07  1967  	 * Copy as many buffered i915 perf samples and records for this stream
16d98b31 Robert Bragg 2016-12-07  1968  	 * to userspace as will fit in the given buffer.
eec688e1 Robert Bragg 2016-11-07  1969  	 *
16d98b31 Robert Bragg 2016-12-07  1970  	 * Only write complete records; returning -%ENOSPC if there isn't room
16d98b31 Robert Bragg 2016-12-07  1971  	 * for a complete record.
eec688e1 Robert Bragg 2016-11-07  1972  	 *
16d98b31 Robert Bragg 2016-12-07  1973  	 * Return any error condition that results in a short read such as
16d98b31 Robert Bragg 2016-12-07  1974  	 * -%ENOSPC or -%EFAULT, even though these may be squashed before
16d98b31 Robert Bragg 2016-12-07  1975  	 * returning to userspace.
eec688e1 Robert Bragg 2016-11-07  1976  	 */
eec688e1 Robert Bragg 2016-11-07  1977  	int (*read)(struct i915_perf_stream *stream,
eec688e1 Robert Bragg 2016-11-07  1978  		    char __user *buf,
eec688e1 Robert Bragg 2016-11-07  1979  		    size_t count,
eec688e1 Robert Bragg 2016-11-07  1980  		    size_t *offset);
eec688e1 Robert Bragg 2016-11-07  1981  
16d98b31 Robert Bragg 2016-12-07  1982  	/**
16d98b31 Robert Bragg 2016-12-07  1983  	 * @destroy: Cleanup any stream specific resources.
eec688e1 Robert Bragg 2016-11-07  1984  	 *
eec688e1 Robert Bragg 2016-11-07  1985  	 * The stream will always be disabled before this is called.
eec688e1 Robert Bragg 2016-11-07  1986  	 */
eec688e1 Robert Bragg 2016-11-07  1987  	void (*destroy)(struct i915_perf_stream *stream);
b0aca6b4 Sourab Gupta 2017-07-31  1988  
b0aca6b4 Sourab Gupta 2017-07-31  1989  	/*
b0aca6b4 Sourab Gupta 2017-07-31  1990  	 * @emit_sample_capture: Emit the commands in the command streamer
b0aca6b4 Sourab Gupta 2017-07-31  1991  	 * for a particular gpu engine.
b0aca6b4 Sourab Gupta 2017-07-31  1992  	 *
b0aca6b4 Sourab Gupta 2017-07-31  1993  	 * The commands are inserted to capture the perf sample data at
b0aca6b4 Sourab Gupta 2017-07-31  1994  	 * specific points during workload execution, such as before and after
b0aca6b4 Sourab Gupta 2017-07-31  1995  	 * the batch buffer.
b0aca6b4 Sourab Gupta 2017-07-31  1996  	 */
b0aca6b4 Sourab Gupta 2017-07-31  1997  	void (*emit_sample_capture)(struct i915_perf_stream *stream,
b0aca6b4 Sourab Gupta 2017-07-31  1998  				    struct drm_i915_gem_request *request,
b0aca6b4 Sourab Gupta 2017-07-31  1999  				    bool preallocate);
b0aca6b4 Sourab Gupta 2017-07-31 @2000  };
b0aca6b4 Sourab Gupta 2017-07-31  2001  
b0aca6b4 Sourab Gupta 2017-07-31  2002  enum i915_perf_stream_state {
b0aca6b4 Sourab Gupta 2017-07-31  2003  	I915_PERF_STREAM_DISABLED,
b0aca6b4 Sourab Gupta 2017-07-31  2004  	I915_PERF_STREAM_ENABLE_IN_PROGRESS,
b0aca6b4 Sourab Gupta 2017-07-31  2005  	I915_PERF_STREAM_ENABLED,
eec688e1 Robert Bragg 2016-11-07  2006  };
eec688e1 Robert Bragg 2016-11-07  2007  
16d98b31 Robert Bragg 2016-12-07  2008  /**
16d98b31 Robert Bragg 2016-12-07  2009   * struct i915_perf_stream - state for a single open stream FD
16d98b31 Robert Bragg 2016-12-07  2010   */
eec688e1 Robert Bragg 2016-11-07  2011  struct i915_perf_stream {
16d98b31 Robert Bragg 2016-12-07  2012  	/**
16d98b31 Robert Bragg 2016-12-07  2013  	 * @dev_priv: i915 drm device
16d98b31 Robert Bragg 2016-12-07  2014  	 */
eec688e1 Robert Bragg 2016-11-07  2015  	struct drm_i915_private *dev_priv;
eec688e1 Robert Bragg 2016-11-07  2016  
16d98b31 Robert Bragg 2016-12-07  2017  	/**
b0aca6b4 Sourab Gupta 2017-07-31  2018  	 * @engine: Engine to which this stream corresponds.
16d98b31 Robert Bragg 2016-12-07  2019  	 */
b0aca6b4 Sourab Gupta 2017-07-31  2020  	struct intel_engine_cs *engine;
eec688e1 Robert Bragg 2016-11-07  2021  
16d98b31 Robert Bragg 2016-12-07  2022  	/**
16d98b31 Robert Bragg 2016-12-07  2023  	 * @sample_flags: Flags representing the `DRM_I915_PERF_PROP_SAMPLE_*`
16d98b31 Robert Bragg 2016-12-07  2024  	 * properties given when opening a stream, representing the contents
16d98b31 Robert Bragg 2016-12-07  2025  	 * of a single sample as read() by userspace.
16d98b31 Robert Bragg 2016-12-07  2026  	 */
eec688e1 Robert Bragg 2016-11-07  2027  	u32 sample_flags;
16d98b31 Robert Bragg 2016-12-07  2028  
16d98b31 Robert Bragg 2016-12-07  2029  	/**
16d98b31 Robert Bragg 2016-12-07  2030  	 * @sample_size: Considering the configured contents of a sample
16d98b31 Robert Bragg 2016-12-07  2031  	 * combined with the required header size, this is the total size
16d98b31 Robert Bragg 2016-12-07  2032  	 * of a single sample record.
16d98b31 Robert Bragg 2016-12-07  2033  	 */
d7965152 Robert Bragg 2016-11-07  2034  	int sample_size;
eec688e1 Robert Bragg 2016-11-07  2035  
16d98b31 Robert Bragg 2016-12-07  2036  	/**
16d98b31 Robert Bragg 2016-12-07  2037  	 * @ctx: %NULL if measuring system-wide across all contexts or a
16d98b31 Robert Bragg 2016-12-07  2038  	 * specific context that is being monitored.
16d98b31 Robert Bragg 2016-12-07  2039  	 */
eec688e1 Robert Bragg 2016-11-07  2040  	struct i915_gem_context *ctx;
16d98b31 Robert Bragg 2016-12-07  2041  
16d98b31 Robert Bragg 2016-12-07  2042  	/**
b0aca6b4 Sourab Gupta 2017-07-31  2043  	 * @state: Current stream state, which can be either disabled, enabled,
b0aca6b4 Sourab Gupta 2017-07-31  2044  	 * or enable_in_progress, while considering whether the stream was
b0aca6b4 Sourab Gupta 2017-07-31  2045  	 * opened in a disabled state and based on `I915_PERF_IOCTL_ENABLE` and
b0aca6b4 Sourab Gupta 2017-07-31  2046  	 * `I915_PERF_IOCTL_DISABLE` calls.
16d98b31 Robert Bragg 2016-12-07  2047  	 */
b0aca6b4 Sourab Gupta 2017-07-31  2048  	enum i915_perf_stream_state state;
b0aca6b4 Sourab Gupta 2017-07-31  2049  
b0aca6b4 Sourab Gupta 2017-07-31  2050  	/**
b0aca6b4 Sourab Gupta 2017-07-31  2051  	 * @cs_mode: Whether command stream based perf sample collection is
b0aca6b4 Sourab Gupta 2017-07-31  2052  	 * enabled for this stream
b0aca6b4 Sourab Gupta 2017-07-31  2053  	 */
b0aca6b4 Sourab Gupta 2017-07-31  2054  	bool cs_mode;
b0aca6b4 Sourab Gupta 2017-07-31  2055  
b0aca6b4 Sourab Gupta 2017-07-31  2056  	/**
b0aca6b4 Sourab Gupta 2017-07-31  2057  	 * @using_oa: Whether OA unit is in use for this particular stream
b0aca6b4 Sourab Gupta 2017-07-31  2058  	 */
b0aca6b4 Sourab Gupta 2017-07-31  2059  	bool using_oa;
eec688e1 Robert Bragg 2016-11-07  2060  
16d98b31 Robert Bragg 2016-12-07  2061  	/**
16d98b31 Robert Bragg 2016-12-07  2062  	 * @ops: The callbacks providing the implementation of this specific
16d98b31 Robert Bragg 2016-12-07  2063  	 * type of configured stream.
16d98b31 Robert Bragg 2016-12-07  2064  	 */
d7965152 Robert Bragg 2016-11-07  2065  	const struct i915_perf_stream_ops *ops;
b0aca6b4 Sourab Gupta 2017-07-31  2066  
b0aca6b4 Sourab Gupta 2017-07-31  2067  	/* Command stream based perf data buffer */
b0aca6b4 Sourab Gupta 2017-07-31  2068  	struct {
b0aca6b4 Sourab Gupta 2017-07-31  2069  		struct i915_vma *vma;
b0aca6b4 Sourab Gupta 2017-07-31  2070  		u8 *vaddr;
71fd8fc0 Sourab Gupta 2017-07-31  2071  #define I915_PERF_CMD_STREAM_BUF_STATUS_OVERFLOW (1<<0)
71fd8fc0 Sourab Gupta 2017-07-31  2072  		u32 status;
b0aca6b4 Sourab Gupta 2017-07-31  2073  	} cs_buffer;
b0aca6b4 Sourab Gupta 2017-07-31  2074  
b0aca6b4 Sourab Gupta 2017-07-31  2075  	struct list_head cs_samples;
b0aca6b4 Sourab Gupta 2017-07-31  2076  	spinlock_t cs_samples_lock;
b0aca6b4 Sourab Gupta 2017-07-31  2077  
b0aca6b4 Sourab Gupta 2017-07-31  2078  	wait_queue_head_t poll_wq;
b0aca6b4 Sourab Gupta 2017-07-31  2079  	bool pollin;
7405a923 Sourab Gupta 2017-07-31  2080  
7405a923 Sourab Gupta 2017-07-31  2081  	u32 last_ctx_id;
928b6006 Sourab Gupta 2017-07-31  2082  	u32 last_pid;
d7965152 Robert Bragg 2016-11-07 @2083  };
d7965152 Robert Bragg 2016-11-07  2084  

:::::: The code at line 2083 was first introduced by commit
:::::: d79651522e89c4ffa8992b48dfe449f0c583f809 drm/i915: Enable i915 perf stream for Haswell OA unit

:::::: TO: Robert Bragg <robert@sixbynine.org>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6c011f3..b56ea20 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2079,6 +2079,7 @@  struct i915_perf_stream {
 	bool pollin;
 
 	u32 last_ctx_id;
+	u32 last_pid;
 };
 
 /**
@@ -2189,6 +2190,12 @@  struct i915_perf_cs_sample {
 	 * @ctx_id: Context ID associated with this perf sample
 	 */
 	u32 ctx_id;
+
+	/**
+	 * @pid: PID of the process in context of which the workload was
+	 * submitted, pertaining to this perf sample
+	 */
+	u32 pid;
 };
 
 struct intel_cdclk_state {
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 1f5ebdb..5ac1a41 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -293,6 +293,7 @@ 
 struct i915_perf_sample_data {
 	u64 source;
 	u64 ctx_id;
+	u64 pid;
 	const u8 *report;
 };
 
@@ -348,6 +349,7 @@  struct i915_perf_sample_data {
 #define SAMPLE_OA_REPORT      (1<<0)
 #define SAMPLE_OA_SOURCE      (1<<1)
 #define SAMPLE_CTX_ID	      (1<<2)
+#define SAMPLE_PID	      (1<<3)
 
 /**
  * struct perf_open_properties - for validated properties given to open a stream
@@ -608,6 +610,7 @@  static void i915_perf_stream_emit_sample_capture(
 
 	sample->request = i915_gem_request_get(request);
 	sample->ctx_id = request->ctx->hw_id;
+	sample->pid = current->pid;
 
 	insert_perf_sample(stream, sample);
 
@@ -924,6 +927,12 @@  static int append_perf_sample(struct i915_perf_stream *stream,
 		buf += 8;
 	}
 
+	if (sample_flags & SAMPLE_PID) {
+		if (copy_to_user(buf, &data->pid, 8))
+			return -EFAULT;
+		buf += 8;
+	}
+
 	if (sample_flags & SAMPLE_OA_REPORT) {
 		if (copy_to_user(buf, data->report, report_size))
 			return -EFAULT;
@@ -961,6 +970,9 @@  static int append_oa_buffer_sample(struct i915_perf_stream *stream,
 		data.ctx_id = dev_priv->perf.oa.ops.get_ctx_id(stream, report);
 	}
 
+	if (sample_flags & SAMPLE_PID)
+		data.pid = stream->last_pid;
+
 	if (sample_flags & SAMPLE_OA_REPORT)
 		data.report = report;
 
@@ -1558,6 +1570,11 @@  static int append_cs_buffer_sample(struct i915_perf_stream *stream,
 		stream->last_ctx_id = data.ctx_id;
 	}
 
+	if (sample_flags & SAMPLE_PID) {
+		data.pid = node->pid;
+		stream->last_pid = node->pid;
+	}
+
 	return append_perf_sample(stream, buf, count, offset, &data);
 }
 
@@ -2719,6 +2736,7 @@  static int i915_perf_stream_init(struct i915_perf_stream *stream,
 	struct drm_i915_private *dev_priv = stream->dev_priv;
 	bool require_oa_unit = props->sample_flags & (SAMPLE_OA_REPORT |
 						      SAMPLE_OA_SOURCE);
+	bool require_cs_mode = props->sample_flags & SAMPLE_PID;
 	bool cs_sample_data = props->sample_flags & SAMPLE_OA_REPORT;
 	struct i915_perf_stream *curr_stream;
 	struct intel_engine_cs *engine = NULL;
@@ -2866,6 +2884,20 @@  static int i915_perf_stream_init(struct i915_perf_stream *stream,
 	if (props->sample_flags & SAMPLE_CTX_ID) {
 		stream->sample_flags |= SAMPLE_CTX_ID;
 		stream->sample_size += 8;
+
+		/*
+		 * NB: it's meaningful to request SAMPLE_CTX_ID with just CS
+		 * mode or periodic OA mode sampling but we don't allow
+		 * SAMPLE_CTX_ID without either mode
+		 */
+		if (!require_oa_unit)
+			require_cs_mode = true;
+	}
+
+	if (require_cs_mode && !props->cs_mode) {
+		DRM_ERROR("PID sampling requires a ring to be specified");
+		ret = -EINVAL;
+		goto err_enable;
 	}
 
 	if (props->cs_mode) {
@@ -2875,12 +2907,23 @@  static int i915_perf_stream_init(struct i915_perf_stream *stream,
 			goto err_enable;
 		}
 
-		if (!(props->sample_flags & SAMPLE_CTX_ID)) {
+		/*
+		 * The only time we should allow enabling CS mode if it's not
+		 * strictly required, is if SAMPLE_CTX_ID has been requested
+		 * as it's usable with periodic OA or CS sampling.
+		 */
+		if (!require_cs_mode &&
+		    !(props->sample_flags & SAMPLE_CTX_ID)) {
 			DRM_ERROR("Stream engine given without requesting any CS specific property\n");
 			ret = -EINVAL;
 			goto err_enable;
 		}
 
+		if (props->sample_flags & SAMPLE_PID) {
+			stream->sample_flags |= SAMPLE_PID;
+			stream->sample_size += 8;
+		}
+
 		engine = dev_priv->engine[props->engine];
 
 		idx = srcu_read_lock(&engine->perf_srcu);
@@ -3595,6 +3638,9 @@  static int read_properties_unlocked(struct drm_i915_private *dev_priv,
 		case DRM_I915_PERF_PROP_SAMPLE_CTX_ID:
 			props->sample_flags |= SAMPLE_CTX_ID;
 			break;
+		case DRM_I915_PERF_PROP_SAMPLE_PID:
+			props->sample_flags |= SAMPLE_PID;
+			break;
 		case DRM_I915_PERF_PROP_MAX:
 			MISSING_CASE(id);
 			return -EINVAL;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 768b1a5..34d8e41 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1408,6 +1408,12 @@  enum drm_i915_perf_property_id {
 	 */
 	DRM_I915_PERF_PROP_SAMPLE_CTX_ID,
 
+	/**
+	 * The value of this property set to 1 requests inclusion of pid in the
+	 * perf sample data.
+	 */
+	DRM_I915_PERF_PROP_SAMPLE_PID,
+
 	DRM_I915_PERF_PROP_MAX /* non-ABI */
 };
 
@@ -1475,6 +1481,7 @@  enum drm_i915_perf_record_type {
 	 *
 	 *     { u64 source; } && DRM_I915_PERF_PROP_SAMPLE_OA_SOURCE
 	 *     { u64 ctx_id; } && DRM_I915_PERF_PROP_SAMPLE_CTX_ID
+	 *     { u64 pid; } && DRM_I915_PERF_PROP_SAMPLE_PID
 	 *     { u32 oa_report[]; } && DRM_I915_PERF_PROP_SAMPLE_OA
 	 * };
 	 */