Enable Gen 7 Observation Architecture
Subsystems (3)
cover Enable Gen 7 Observation Architecture
This series enables support for the Observation Architecture on Haswell
Compared to the last series I sent out, the main changes are:
* The terminology changed so we open a 'stream' not an 'event'.
* A stream is configured with an array of u64 properties after finding the previous config struct quite awkward to validate and not well suited to supporting multiple kinds of streams sharing common config options (which arises with work Sourab Gupta is looking at based on this driver)
* No pre-defined enum of metric set IDs and metric sets are now advertised via sysfs. This is to allow for configs being loaded at runtime in the future and the use of uuids that can be unambiguously mapped to corresponding normalization equations in userspace. Another consideration here was that we might need to add new versions of a particular config like 'compute basic' (more likely for newer configs with less testing) at which point the enum doesn't really make life easier for userspace if you have to be aware of the versioning relationships and attempt different IDs to find the latest version the kernel supports.
I haven't written igt tests for this yet, but can hopefully start looking at that next if there's no major issue with the general api. So far the interface has been tested and iterated based on what's worked out well for GPU Top[1], an implementation of GL_INTEL_performance_query in Mesa and an implementation of an API called MDAPI used by GPA/VTune to capture metrics (private a.t.m as I'm not sure there would be much general interest in it.)
The PRM for Haswell's OA unit can be found here:
https://01.org/sites/default/files/documentation/
observability_performance_counters_haswell.pdf
(though unfortunately it's not very complete documentation)
An example of opening an i915 perf stream can be seen in Mesa here:
https://github.com/rib/mesa/blob/wip/rib/oa-next/src/mesa/drivers/
dri/i965/brw_performance_query.c#L904
A summary of the stream format can seen here:
https://github.com/rib/linux/wiki/i915-perf-stream-format
There's an open issue to do with how to properly clear the status bits in the OASTATUS1 register which I noticed the other day can't be right a.t.m and I'm waiting for feedback on from the Windows team or OA architect. I don't expect it will have much impact so it still seemed worth sending this series now.
Another thing to mention is that I just noticed gputop is hitting the cpu more than expected in its overview mode, polling for OA data and I need to double check it's not a driver issue. Hopefully a minor issue; probably not worth holding things up for.
Although this series only adds basic infrastructure and enables Haswell it's probably good to keep in mind other work that builds on top. I've also enabled Gen8+; there's some further work by Sourab Gupta to access metrics in sync with command stream processing and Matthew Auld has experimented with an interface for registering new OA configurations at runtime.
In case it's helpful to reference, the Gen 8 enabling can be seen here:
https://github.com/rib/linux/tree/wip/rib/oa-next
Sourab's work can be seen here:
https://github.com/sourabgu/linux/tree/rebase-4.4-testing
Matt's patch for runtime configs can be seen here:
https://github.com/matt-auld/linux/tree/wip/matt-auld/oa-4.4-dynamic-testing
Regards,
- Robert
[1]
https://github.com/rib/gputop
https://github.com/rib/gputop/wiki/Build-Instructions
Robert Bragg (8):
drm/i915: Add i915 perf infrastructure drm/i915: rename OACONTROL GEN7_OACONTROL drm/i915: Add 'render basic' Haswell OA unit config drm/i915: Add i915 perf event for Haswell OA unit drm/i915: advertise available metrics via sysfs drm/i915: Add dev.i915.perf_event_paranoid sysctl option drm/i915: add oa_event_min_timer_exponent sysctl drm/i915: Add more Haswell OA metric sets
drivers/gpu/drm/i915/Makefile | 4 + drivers/gpu/drm/i915/i915_cmd_parser.c | 4 +- drivers/gpu/drm/i915/i915_dma.c | 7 + drivers/gpu/drm/i915/i915_drv.h | 154 ++++ drivers/gpu/drm/i915/i915_gem_context.c | 23 +- drivers/gpu/drm/i915/i915_oa_hsw.c | 658 ++++++++++++++++ drivers/gpu/drm/i915/i915_oa_hsw.h | 38 + drivers/gpu/drm/i915/i915_perf.c | 1283 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 340 +++++++- include/uapi/drm/i915_drm.h | 121 +++ 10 files changed, 2625 insertions(+), 7 deletions(-) create mode 100644 drivers/gpu/drm/i915/i915_oa_hsw.c create mode 100644 drivers/gpu/drm/i915/i915_oa_hsw.h create mode 100644 drivers/gpu/drm/i915/i915_perf.c
Signature · 6 lines
2.7.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/8 drm/i915: Add i915 perf infrastructure
Adds base i915 perf infrastructure for Gen performance metrics.
This adds a DRM_IOCTL_I915_PERF_OPEN ioctl that takes an array of uint64 properties to configure a stream of metrics and returns a new fd usable with standard VFS system calls including read() to read typed and sized records; ioctl() to enable or disable capture and poll() to wait for data.
A stream is opened something like:
uint64_t properties[] = {
/* Single context sampling */
DRM_I915_PERF_CTX_HANDLE_PROP, ctx_handle, /* Include OA reports in samples */
DRM_I915_PERF_SAMPLE_OA_PROP, true,
/* OA unit configuration */
DRM_I915_PERF_OA_METRICS_SET_PROP, metrics_set_id,
DRM_I915_PERF_OA_FORMAT_PROP, report_format,
DRM_I915_PERF_OA_EXPONENT_PROP, period_exponent,
};
struct drm_i915_perf_open_param parm = {
.flags = I915_PERF_FLAG_FD_CLOEXEC |
I915_PERF_FLAG_FD_NONBLOCK |
I915_PERF_FLAG_DISABLED,
.properties = properties,
.n_properties = sizeof(properties) / 16, };
int fd = drmIoctl(drm_fd, DRM_IOCTL_I915_PERF_OPEN, ¶m);
Records read all start with a common { type, size } header with DRM_I915_PERF_RECORD_SAMPLE being of most interest. Sample records contain an extensible number of fields and it's the DRM_I915_PERF_SAMPLE_xyz properties given when opening that determine what's included in every sample.
No specific streams are supported yet so any attempt to open a stream will return an error.
--- drivers/gpu/drm/i915/Makefile | 3 + drivers/gpu/drm/i915/i915_dma.c | 7 + drivers/gpu/drm/i915/i915_drv.h | 88 ++++++++ drivers/gpu/drm/i915/i915_perf.c | 442 +++++++++++++++++++++++++++++++++++++++ include/uapi/drm/i915_drm.h | 69 ++++++ 5 files changed, 609 insertions(+) create mode 100644 drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/i915/Makefile +3 -0
@@ -93,6 +93,9 @@ i915-y += dvo_ch7017.o \ # virtual gpu code i915-y += i915_vgpu.o +# perf code +i915-y += i915_perf.o + # legacy horrors i915-y += i915_dma.o
drivers/gpu/drm/i915/i915_dma.c +7 -0
@@ -893,6 +893,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)mutex_init (&dev_priv->csr_lock);mutex_init (&dev_priv->av_mutex); +/* Must at least be initialized before trying to pin any context +* which i915_perf hooks into. +*/ +i915_perf_init (dev); +intel_pm_setup (dev);intel_display_crc_init (dev);
@@ -1139,6 +1144,7 @@ int i915_driver_unload(struct drm_device *dev)return ret; } +i915_perf_fini (dev);intel_power_domains_fini (dev_priv);intel_gpu_ips_teardown ();
@@ -1329,6 +1335,7 @@ const struct drm_ioctl_desc i915_ioctls[] = {DRM_IOCTL_DEF_DRV (I915_GEM_USERPTR , i915_gem_userptr_ioctl,DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (I915_GEM_CONTEXT_GETPARAM , i915_gem_context_getparam_ioctl,DRM_RENDER_ALLOW ),DRM_IOCTL_DEF_DRV (I915_GEM_CONTEXT_SETPARAM , i915_gem_context_setparam_ioctl,DRM_RENDER_ALLOW ), + DRM_IOCTL_DEF_DRV(I915_PERF_OPEN, i915_perf_open_ioctl, DRM_RENDER_ALLOW), };int i915_max_ioctl =ARRAY_SIZE (i915_ioctls);
drivers/gpu/drm/i915/i915_drv.h +88 -0
112 lines not on this page · raw message
drivers/gpu/drm/i915/i915_perf.c new file +442 -0
442 lines not on this page · raw message
include/uapi/drm/i915_drm.h +69 -0
85 lines not on this page · raw message
Signature · 6 lines
2.7.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/8 drm/i915: rename OACONTROL GEN7_OACONTROL
In reply to Robert BraggOACONTROL changes quite a bit for gen8, with some bits split out into a per-context OACTXCONTROL register. Rename now before add more gen7 OA registers
--- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- drivers/gpu/drm/i915/i915_reg.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_cmd_parser.c +2 -2
@@ -439,7 +439,7 @@ static const struct drm_i915_reg_descriptor gen7_render_regs[] = {REG64 (CL_PRIMITIVES_COUNT ),REG64 (PS_INVOCATION_COUNT ),REG64 (PS_DEPTH_COUNT ), -REG32 (OACONTROL ),/* Only allowed for LRI and SRM. See below. */ +REG32 (GEN7_OACONTROL ),/* Only allowed for LRI and SRM. See below. */ REG64 (MI_PREDICATE_SRC0 ),REG64 (MI_PREDICATE_SRC1 ), REG32(GEN7_3DPRIM_END_OFFSET),
@@ -1023,7 +1023,7 @@ static bool check_cmd(const struct intel_engine_cs *ring,* to the register. Hence, limit OACONTROL writes to * only MI_LOAD_REGISTER_IMM commands. */ -if (reg_addr ==OACONTROL ) { +if (reg_addr ==GEN7_OACONTROL ) {if (desc->cmd.value ==MI_LOAD_REGISTER_MEM ) {DRM_DEBUG_DRIVER ("CMD: Rejected LRM to OACONTROL\n" );return false;
drivers/gpu/drm/i915/i915_reg.h +1 -1
@@ -540,7 +540,7 @@#define GEN7_GPGPU_DISPATCHDIMY 0x2504#define GEN7_GPGPU_DISPATCHDIMZ 0x2508 -#define OACONTROL 0x2360 +#define GEN7_OACONTROL 0x2360#define _GEN7_PIPEA_DE_LOAD_SL 0x70068#define _GEN7_PIPEB_DE_LOAD_SL 0x71068
Signature · 6 lines
2.7.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/8 drm/i915: Add 'render basic' Haswell OA unit config
In reply to Robert BraggAdds a static OA unit, MUX + B Counter configuration for basic render metrics on Haswell. This is autogenerated from an internal XML description of metric sets.
--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.h | 14 ++++ drivers/gpu/drm/i915/i915_oa_hsw.c | 132 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_oa_hsw.h | 34 ++++++++++ 4 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/i915/i915_oa_hsw.c create mode 100644 drivers/gpu/drm/i915/i915_oa_hsw.h
drivers/gpu/drm/i915/Makefile +2 -1
@@ -94,7 +94,8 @@ i915-y += dvo_ch7017.o \ i915-y += i915_vgpu.o # perf code -i915-y += i915_perf.o +i915-y += i915_perf.o \ + i915_oa_hsw.o # legacy horrors i915-y += i915_dma.o
drivers/gpu/drm/i915/i915_drv.h +14 -0
@@ -1698,6 +1698,11 @@ struct i915_execbuffer_params {struct drm_i915_gem_request *request; }; +struct i915_oa_reg { +u32 addr; +u32 value; +}; +struct i915_perf_read_state {int count;ssize_t read;
@@ -2020,6 +2025,15 @@ struct drm_i915_private {bool initialized;struct mutex lock;struct list_head streams; + +struct { +u32 metrics_set; + +const struct i915_oa_reg *mux_regs; +int mux_regs_len; +const struct i915_oa_reg *b_counter_regs; +int b_counter_regs_len; + } oa; } perf;/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
drivers/gpu/drm/i915/i915_oa_hsw.c new file +132 -0
132 lines not on this page · raw message
drivers/gpu/drm/i915/i915_oa_hsw.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* Autogenerated file, DO NOT EDIT manually! +* +* Copyright (c) 2015 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +*/ + +#ifndef __I915_OA_HSW_H__ +#define __I915_OA_HSW_H__ + +extern int i915_oa_n_builtin_metric_sets_hsw; + +extern int i915_oa_select_metric_set_hsw (struct drm_i915_private *dev_priv); + +#endif
Signature · 6 lines
2.7.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/8 drm/i915: Add i915 perf event for Haswell OA unit
In reply to Robert BraggGen graphics hardware can be set up to periodically write snapshots of performance counters into a circular buffer via its Observation Architecture and this patch exposes that capability to userspace via the i915 perf interface.
--- drivers/gpu/drm/i915/i915_drv.h | 49 ++ drivers/gpu/drm/i915/i915_gem_context.c | 23 +- drivers/gpu/drm/i915/i915_perf.c | 783 +++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 338 ++++++++++++++ include/uapi/drm/i915_drm.h | 56 ++- 5 files changed, 1233 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +49 -0
@@ -1698,6 +1698,11 @@ struct i915_execbuffer_params {struct drm_i915_gem_request *request; }; +struct i915_oa_format { +u32 format; +int size; +}; +struct i915_oa_reg {u32 addr;u32 value;
@@ -1715,6 +1720,7 @@ struct i915_perf_stream {struct list_head link;u32 sample_flags; +int sample_size;struct intel_context *ctx;bool enabled;
@@ -1778,6 +1784,20 @@ struct i915_perf_stream {void (*destroy)(struct i915_perf_stream *stream); }; +struct i915_oa_ops { +void (*init_oa_buffer)(struct drm_i915_private *dev_priv); +int (*enable_metric_set)(struct drm_i915_private *dev_priv); +void (*disable_metric_set)(struct drm_i915_private *dev_priv); +void (*oa_enable)(struct drm_i915_private *dev_priv); +void (*oa_disable)(struct drm_i915_private *dev_priv); +void (*update_oacontrol)(struct drm_i915_private *dev_priv); +void (*update_hw_ctx_id_locked)(struct drm_i915_private *dev_priv, +u32 ctx_id); +int (*read)(struct i915_perf_stream *stream, +struct i915_perf_read_state *read_state); +bool (*oa_buffer_is_empty)(struct drm_i915_private *dev_priv); +}; +struct drm_i915_private {struct drm_device *dev;struct kmem_cache *objects;
@@ -2023,16 +2043,43 @@ struct drm_i915_private {struct {bool initialized; +struct mutex lock;struct list_head streams; +spinlock_t hook_lock; +struct { +struct i915_perf_stream *exclusive_stream; + +u32 specific_ctx_id; + +struct hrtimer poll_check_timer; +wait_queue_head_t poll_wq; + +bool periodic; +u32 period_exponent; +u32 metrics_set;const struct i915_oa_reg *mux_regs;int mux_regs_len;const struct i915_oa_reg *b_counter_regs;int b_counter_regs_len; + +struct { +struct drm_i915_gem_object *obj; +u32 gtt_offset; +u8 *addr; +u32 head; +u32 tail; +int format; +int format_size; + } oa_buffer; + +struct i915_oa_ops ops; +const struct i915_oa_format *oa_formats; +int n_builtin_sets; } oa; } perf;
@@ -3272,6 +3319,8 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,int i915_perf_open_ioctl (struct drm_device *dev,void *data,struct drm_file *file); +void i915_oa_context_pin_notify (struct drm_i915_private *dev_priv, +struct intel_context *context);/* i915_gem_evict.c */ int __must_check i915_gem_evict_something(struct drm_device *dev,
drivers/gpu/drm/i915/i915_gem_context.c +19 -4
@@ -133,6 +133,23 @@ static int get_context_size(struct drm_device *dev)return ret; } +static int i915_gem_context_pin_state (struct drm_device *dev, +struct intel_context *ctx) +{ +int ret; + +BUG_ON (!mutex_is_locked (&dev->struct_mutex)); + + ret =i915_gem_obj_ggtt_pin (ctx->legacy_hw_ctx.rcs_state, +get_context_alignment (dev),0 ); +if (ret) +return ret; + +i915_oa_context_pin_notify (dev->dev_private, ctx); + +return 0 ; +} +static void i915_gem_context_clean (struct intel_context *ctx) {struct i915_hw_ppgtt *ppgtt = ctx->ppgtt;
@@ -280,8 +297,7 @@ i915_gem_create_context(struct drm_device *dev,* be available. To avoid this we always pin the default * context. */ - ret =i915_gem_obj_ggtt_pin (ctx->legacy_hw_ctx.rcs_state, -get_context_alignment (dev),0 ); + ret =i915_gem_context_pin_state (dev, ctx);if (ret) {DRM_DEBUG_DRIVER ("Couldn't pin %d\n" , ret); goto err_destroy;
@@ -663,8 +679,7 @@ static int do_switch(struct drm_i915_gem_request *req)/* Trying to pin first makes error handling easier. */ if (ring == &dev_priv->ring[RCS ]) { - ret =i915_gem_obj_ggtt_pin (to->legacy_hw_ctx.rcs_state, -get_context_alignment (ring->dev),0 ); + ret =i915_gem_context_pin_state (ring->dev, to);if (ret)return ret; }
drivers/gpu/drm/i915/i915_perf.c +773 -10
833 lines not on this page · raw message
drivers/gpu/drm/i915/i915_reg.h +338 -0
350 lines not on this page · raw message
include/uapi/drm/i915_drm.h +54 -2
83 lines not on this page · raw message
Signature · 6 lines
2.7.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH 4/8] drm/i915: Add i915 perf event for Haswell OA unit
reproduce:
Hi Robert,
[auto build test WARNING on v4.4-rc8]
[cannot apply to drm-intel/for-linux-next v4.5-rc2 v4.5-rc1 next-20160202]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Robert-Bragg/Enable-Gen-7-Observation-Architecture/20160203-053423 config: i386-defconfig (attached as .config) reproduce: # 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 'gen7_oa_read':
>> drivers/gpu/drm/i915/i915_perf.c:264:2: warning: #warning "WIP: check the correct way to clear OASTATUS1 bits" [-Wcpp]
#warning "WIP: check the correct way to clear OASTATUS1 bits"
^
vim +264 drivers/gpu/drm/i915/i915_perf.c
248 DRM_I915_PERF_RECORD_OA_REPORT_LOST);
249 if (n_records && ret == -EFAULT)
250 ret = 0;
251 else if (ret < 0)
252 return ret;
253 else if (ret > 0) {
254 n_records += ret;
255 oastatus1 &= ~GEN7_OASTATUS1_REPORT_LOST;
256 }
257 }
258
259 /* XXX: This register contains the OA tail pointer
260 * which may be updated asynchronously while periodic
261 * sampling is enabled so it's racy to
262 * read-modify-write like we are here (esp after the
263 * append/copy_to_user work above.) */
> 264 #warning "WIP: check the correct way to clear OASTATUS1 bits"
265 I915_WRITE(GEN7_OASTATUS1, oastatus1);
266 }
267
268 /* If there is still buffer space */
269 if (ret) {
270 ret = gen7_append_oa_reports(stream, read_state, &head, tail);
271 if (n_records && ret == -EFAULT)
272 ret = 0;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/8 drm/i915: advertise available metrics via sysfs
In reply to Robert BraggEach metric set is given a sysfs entry like:
/sys/class/drm/card0/metrics/<guid>/id
This allows userspace to enumerate the specific sets that are available for the current system. The 'id' file contains an unsigned integer that can be used to open the associated metric set via DRM_IOCTL_I915_PERF_OPEN. The <guid> is a globally unique ID for a specific OA unit configuration that can be reliably used as a key to lookup corresponding counter meta data and normalization equations.
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_oa_hsw.c | 45 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_oa_hsw.h | 4 ++++ drivers/gpu/drm/i915/i915_perf.c | 18 ++++++++++++++- 4 files changed, 68 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -2044,6 +2044,8 @@ struct drm_i915_private {struct {bool initialized; +struct kobject *metrics_kobj; +struct mutex lock;struct list_head streams;
drivers/gpu/drm/i915/i915_oa_hsw.c +45 -0
54 lines not on this page · raw message
drivers/gpu/drm/i915/i915_oa_hsw.h +4 -0
@@ -31,4 +31,8 @@ extern int i915_oa_n_builtin_metric_sets_hsw;extern int i915_oa_select_metric_set_hsw (struct drm_i915_private *dev_priv); +extern int i915_perf_init_sysfs_hsw (struct drm_i915_private *dev_priv); + +extern void i915_perf_deinit_sysfs_hsw (struct drm_i915_private *dev_priv); +#endif
drivers/gpu/drm/i915/i915_perf.c +17 -1
@@ -1164,6 +1164,11 @@ void i915_perf_init(struct drm_device *dev)if (!IS_HASWELL (dev))return ; + dev_priv->perf.metrics_kobj = +kobject_create_and_add ("metrics" , &dev->primary->kdev->kobj); +if (!dev_priv->perf.metrics_kobj) +return ; +hrtimer_init (&dev_priv->perf.oa.poll_check_timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); dev_priv->perf.oa.poll_check_timer.function = poll_check_timer_cb;
@@ -1187,9 +1192,15 @@ void i915_perf_init(struct drm_device *dev) dev_priv->perf.oa.n_builtin_sets = i915_oa_n_builtin_metric_sets_hsw; - dev_priv->perf.oa.oa_formats = hsw_oa_formats; +if (i915_perf_init_sysfs_hsw (dev_priv)) { +kobject_put (dev_priv->perf.metrics_kobj); + dev_priv->perf.metrics_kobj =NULL ; +return ; + } dev_priv->perf.initialized = true; + +return ; }void i915_perf_fini (struct drm_device *dev)
@@ -1199,6 +1210,11 @@ void i915_perf_fini(struct drm_device *dev)if (!dev_priv->perf.initialized)return ; +i915_perf_deinit_sysfs_hsw (dev_priv); + +kobject_put (dev_priv->perf.metrics_kobj); + dev_priv->perf.metrics_kobj =NULL ; + dev_priv->perf.oa.ops.init_oa_buffer =NULL ; dev_priv->perf.initialized = false;
Signature · 6 lines
2.7.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/8 drm/i915: Add dev.i915.perf_event_paranoid sysctl option
In reply to Robert BraggConsistent with the kernel.perf_event_paranoid sysctl option that can allow non-root users to access system wide cpu metrics, this can optionally allow non-root users to access system wide OA counter metrics from Gen graphics hardware.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_perf.c | 46 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2045,6 +2045,7 @@ struct drm_i915_private {bool initialized;struct kobject *metrics_kobj; +struct ctl_table_header *sysctl_header;struct mutex lock;struct list_head streams;
drivers/gpu/drm/i915/i915_perf.c +45 -1
76 lines not on this page · raw message
Signature · 6 lines
2.7.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/8 drm/i915: add oa_event_min_timer_exponent sysctl
In reply to Robert BraggThe minimal sampling period is now configurable via a dev.i915.oa_min_timer_exponent sysctl parameter.
Following the precedent set by perf, the default is the minimum that won't (on its own) exceed the default kernel.perf_event_max_sample_rate default of 100000 samples/s.
--- drivers/gpu/drm/i915/i915_perf.c | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_perf.c +29 -11
@@ -41,6 +41,23 @@ static u32 i915_perf_stream_paranoid = true;#define OA_EXPONENT_MAX 0x3f +/* for sysctl proc_dointvec_minmax of i915_oa_min_timer_exponent */ +static int zero; +static int oa_exponent_max =OA_EXPONENT_MAX ; + +/* Theoretically we can program the OA unit to sample every 160ns but don't +* allow that by default unless root... +* +* The period is derived from the exponent as: +* +* period = 80ns * 2^(exponent + 1) +* +* Referring to perf's kernel.perf_event_max_sample_rate for a precedent +* (100000 by default); with an OA exponent of 6 we get a period of 10.240 +* microseconds - just under 100000Hz +*/ +static u32 i915_oa_min_timer_exponent =6 ; +static struct i915_oa_format hsw_oa_formats[I915_OA_FORMAT_MAX ] = { [I915_OA_FORMAT_A13 ] = {0 ,64 }, [I915_OA_FORMAT_A29 ] = {1 ,128 },
@@ -1098,20 +1115,12 @@ static int read_properties_unlocked(struct drm_i915_private *dev_priv,if (value >OA_EXPONENT_MAX )return -EINVAL ; -/* NB: The exponent represents a period as follows: -* -* 80ns * 2^(period_exponent + 1) -* -* Theoretically we can program the OA unit to sample +/* Theoretically we can program the OA unit to sample * every 160ns but don't allow that by default unless * root. -* -* Referring to perf's -* kernel.perf_event_max_sample_rate for a precedent -* (100000 by default); with an OA exponent of 6 we get -* a period of 10.240 microseconds -just under 100000Hz */ -if (value <6 && !capable (CAP_SYS_ADMIN )) { +if (value < i915_oa_min_timer_exponent && + !capable (CAP_SYS_ADMIN )) {DRM_ERROR ("Sampling period too high without root privileges\n" );return -EACCES ; }
@@ -1174,6 +1183,15 @@ static struct ctl_table oa_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "oa_min_timer_exponent", + .data = &i915_oa_min_timer_exponent, + .maxlen = sizeof(i915_oa_min_timer_exponent), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &oa_exponent_max, + }, {} };
Signature · 6 lines
2.7.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/8 drm/i915: Add more Haswell OA metric sets
In reply to Robert BraggThis adds 'compute', 'compute extended', 'memory reads', 'memory writes' and 'sampler balance' metric sets for Haswell.
--- drivers/gpu/drm/i915/i915_oa_hsw.c | 483 ++++++++++++++++++++++++++++++++++++- 1 file changed, 482 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_oa_hsw.c +482 -1
@@ -30,9 +30,14 @@enum metric_set_id {METRIC_SET_ID_RENDER_BASIC =1 , +METRIC_SET_ID_COMPUTE_BASIC , +METRIC_SET_ID_COMPUTE_EXTENDED , +METRIC_SET_ID_MEMORY_READS , +METRIC_SET_ID_MEMORY_WRITES , +METRIC_SET_ID_SAMPLER_BALANCE , }; -int i915_oa_n_builtin_metric_sets_hsw =1 ; +int i915_oa_n_builtin_metric_sets_hsw =6 ;static const struct i915_oa_reg b_counter_config_render_basic[] = { {0x2724 ,0x00800000 },
@@ -118,6 +123,332 @@ static int select_render_basic_config(struct drm_i915_private *dev_priv)return 0 ; } +static const struct i915_oa_reg b_counter_config_compute_basic[] = { + {0x2710 ,0x00000000 }, + {0x2714 ,0x00800000 }, + {0x2718 ,0xAAAAAAAA }, + {0x271C ,0xAAAAAAAA }, + {0x2720 ,0x00000000 }, + {0x2724 ,0x00800000 }, + {0x2728 ,0xAAAAAAAA }, + {0x272C ,0xAAAAAAAA }, + {0x2740 ,0x00000000 }, + {0x2744 ,0x00000000 }, + {0x2748 ,0x00000000 }, + {0x274C ,0x00000000 }, + {0x2750 ,0x00000000 }, + {0x2754 ,0x00000000 }, + {0x2758 ,0x00000000 }, + {0x275C ,0x00000000 }, +}; + +static const struct i915_oa_reg mux_config_compute_basic[] = { + {0x253A4 ,0x00000000 }, + {0x2681C ,0x01F00800 }, + {0x26820 ,0x00001000 }, + {0x2781C ,0x01F00800 }, + {0x26520 ,0x00000007 }, + {0x265A0 ,0x00000007 }, + {0x25380 ,0x00000010 }, + {0x2538C ,0x00300000 }, + {0x25384 ,0xAA8AAAAA }, + {0x25404 ,0xFFFFFFFF }, + {0x26800 ,0x00004202 }, + {0x26808 ,0x00605817 }, + {0x2680C ,0x10001005 }, + {0x26804 ,0x00000000 }, + {0x27800 ,0x00000102 }, + {0x27808 ,0x0C0701E0 }, + {0x2780C ,0x000200A0 }, + {0x27804 ,0x00000000 }, + {0x26484 ,0x44000000 }, + {0x26704 ,0x44000000 }, + {0x26500 ,0x00000006 }, + {0x26510 ,0x00000001 }, + {0x26504 ,0x88000000 }, + {0x26580 ,0x00000006 }, + {0x26590 ,0x00000020 }, + {0x26584 ,0x00000000 }, + {0x26104 ,0x55822222 }, + {0x26184 ,0xAA866666 }, + {0x25420 ,0x08320C83 }, + {0x25424 ,0x06820C83 }, + {0x2541C ,0x00000000 }, + {0x25428 ,0x00000C03 }, +}; + +static int select_compute_basic_config (struct drm_i915_private *dev_priv) +{ + dev_priv->perf.oa.mux_regs = + mux_config_compute_basic; + dev_priv->perf.oa.mux_regs_len = +ARRAY_SIZE (mux_config_compute_basic); + + dev_priv->perf.oa.b_counter_regs = + b_counter_config_compute_basic; + dev_priv->perf.oa.b_counter_regs_len = +ARRAY_SIZE (b_counter_config_compute_basic); + +return 0 ; +} + +static const struct i915_oa_reg b_counter_config_compute_extended[] = { + {0x2724 ,0xf0800000 }, + {0x2720 ,0x00000000 }, + {0x2714 ,0xf0800000 }, + {0x2710 ,0x00000000 }, + {0x2770 ,0x0007fe2a }, + {0x2774 ,0x0000ff00 }, + {0x2778 ,0x0007fe6a }, + {0x277c ,0x0000ff00 }, + {0x2780 ,0x0007fe92 }, + {0x2784 ,0x0000ff00 }, + {0x2788 ,0x0007fea2 }, + {0x278c ,0x0000ff00 }, + {0x2790 ,0x0007fe32 }, + {0x2794 ,0x0000ff00 }, + {0x2798 ,0x0007fe9a }, + {0x279c ,0x0000ff00 }, + {0x27a0 ,0x0007ff23 }, + {0x27a4 ,0x0000ff00 }, + {0x27a8 ,0x0007fff3 }, + {0x27ac ,0x0000fffe }, +}; + +static const struct i915_oa_reg mux_config_compute_extended[] = { + {0x2681C ,0x3EB00800 }, + {0x26820 ,0x00900000 }, + {0x25384 ,0x02AAAAAA }, + {0x25404 ,0x03FFFFFF }, + {0x26800 ,0x00142284 }, + {0x26808 ,0x0E629062 }, + {0x2680C ,0x3F6F55CB }, + {0x26810 ,0x00000014 }, + {0x26804 ,0x00000000 }, + {0x26104 ,0x02AAAAAA }, + {0x26184 ,0x02AAAAAA }, + {0x25420 ,0x00000000 }, + {0x25424 ,0x00000000 }, + {0x2541C ,0x00000000 }, + {0x25428 ,0x00000000 }, +}; + +static int select_compute_extended_config (struct drm_i915_private *dev_priv) +{ + dev_priv->perf.oa.mux_regs = + mux_config_compute_extended; + dev_priv->perf.oa.mux_regs_len = +ARRAY_SIZE (mux_config_compute_extended); + + dev_priv->perf.oa.b_counter_regs = + b_counter_config_compute_extended; + dev_priv->perf.oa.b_counter_regs_len = +ARRAY_SIZE (b_counter_config_compute_extended); + +return 0 ; +} + +static const struct i915_oa_reg b_counter_config_memory_reads[] = { + {0x2724 ,0xf0800000 }, + {0x2720 ,0x00000000 }, + {0x2714 ,0xf0800000 }, + {0x2710 ,0x00000000 }, + {0x274c ,0x76543298 }, + {0x2748 ,0x98989898 }, + {0x2744 ,0x000000e4 }, + {0x2740 ,0x00000000 }, + {0x275c ,0x98a98a98 }, + {0x2758 ,0x88888888 }, + {0x2754 ,0x000c5500 }, + {0x2750 ,0x00000000 }, + {0x2770 ,0x0007f81a }, + {0x2774 ,0x0000fc00 }, + {0x2778 ,0x0007f82a }, + {0x277c ,0x0000fc00 }, + {0x2780 ,0x0007f872 }, + {0x2784 ,0x0000fc00 }, + {0x2788 ,0x0007f8ba }, + {0x278c ,0x0000fc00 }, + {0x2790 ,0x0007f87a }, + {0x2794 ,0x0000fc00 }, + {0x2798 ,0x0007f8ea }, + {0x279c ,0x0000fc00 }, + {0x27a0 ,0x0007f8e2 }, + {0x27a4 ,0x0000fc00 }, + {0x27a8 ,0x0007f8f2 }, + {0x27ac ,0x0000fc00 }, +}; + +static const struct i915_oa_reg mux_config_memory_reads[] = { + {0x253A4 ,0x34300000 }, + {0x25440 ,0x2D800000 }, + {0x25444 ,0x00000008 }, + {0x25128 ,0x0E600000 }, + {0x25380 ,0x00000450 }, + {0x25390 ,0x00052C43 }, + {0x25384 ,0x00000000 }, + {0x25400 ,0x00006144 }, + {0x25408 ,0x0A418820 }, + {0x2540C ,0x000820E6 }, + {0x25404 ,0xFF500000 }, + {0x25100 ,0x000005D6 }, + {0x2510C ,0x0EF00000 }, + {0x25104 ,0x00000000 }, + {0x25420 ,0x02108421 }, + {0x25424 ,0x00008421 }, + {0x2541C ,0x00000000 }, + {0x25428 ,0x00000000 }, +}; + +static int select_memory_reads_config (struct drm_i915_private *dev_priv) +{ + dev_priv->perf.oa.mux_regs = + mux_config_memory_reads; + dev_priv->perf.oa.mux_regs_len = +ARRAY_SIZE (mux_config_memory_reads); + + dev_priv->perf.oa.b_counter_regs = + b_counter_config_memory_reads; + dev_priv->perf.oa.b_counter_regs_len = +ARRAY_SIZE (b_counter_config_memory_reads); + +return 0 ; +} + +static const struct i915_oa_reg b_counter_config_memory_writes[] = { + {0x2724 ,0xf0800000 }, + {0x2720 ,0x00000000 }, + {0x2714 ,0xf0800000 }, + {0x2710 ,0x00000000 }, + {0x274c ,0x76543298 }, + {0x2748 ,0x98989898 }, + {0x2744 ,0x000000e4 }, + {0x2740 ,0x00000000 }, + {0x275c ,0xbabababa }, + {0x2758 ,0x88888888 }, + {0x2754 ,0x000c5500 }, + {0x2750 ,0x00000000 }, + {0x2770 ,0x0007f81a }, + {0x2774 ,0x0000fc00 }, + {0x2778 ,0x0007f82a }, + {0x277c ,0x0000fc00 }, + {0x2780 ,0x0007f822 }, + {0x2784 ,0x0000fc00 }, + {0x2788 ,0x0007f8ba }, + {0x278c ,0x0000fc00 }, + {0x2790 ,0x0007f87a }, + {0x2794 ,0x0000fc00 }, + {0x2798 ,0x0007f8ea }, + {0x279c ,0x0000fc00 }, + {0x27a0 ,0x0007f8e2 }, + {0x27a4 ,0x0000fc00 }, + {0x27a8 ,0x0007f8f2 }, + {0x27ac ,0x0000fc00 }, +}; + +static const struct i915_oa_reg mux_config_memory_writes[] = { + {0x253A4 ,0x34300000 }, + {0x25440 ,0x01500000 }, + {0x25444 ,0x00000120 }, + {0x25128 ,0x0C200000 }, + {0x25380 ,0x00000450 }, + {0x25390 ,0x00052C43 }, + {0x25384 ,0x00000000 }, + {0x25400 ,0x00007184 }, + {0x25408 ,0x0A418820 }, + {0x2540C ,0x000820E6 }, + {0x25404 ,0xFF500000 }, + {0x25100 ,0x000005D6 }, + {0x2510C ,0x1E700000 }, + {0x25104 ,0x00000000 }, + {0x25420 ,0x02108421 }, + {0x25424 ,0x00008421 }, + {0x2541C ,0x00000000 }, + {0x25428 ,0x00000000 }, +}; + +static int select_memory_writes_config (struct drm_i915_private *dev_priv) +{ + dev_priv->perf.oa.mux_regs = + mux_config_memory_writes; + dev_priv->perf.oa.mux_regs_len = +ARRAY_SIZE (mux_config_memory_writes); + + dev_priv->perf.oa.b_counter_regs = + b_counter_config_memory_writes; + dev_priv->perf.oa.b_counter_regs_len = +ARRAY_SIZE (b_counter_config_memory_writes); + +return 0 ; +} + +static const struct i915_oa_reg b_counter_config_sampler_balance[] = { + {0x2740 ,0x00000000 }, + {0x2744 ,0x00800000 }, + {0x2710 ,0x00000000 }, + {0x2714 ,0x00800000 }, + {0x2720 ,0x00000000 }, + {0x2724 ,0x00800000 }, +}; + +static const struct i915_oa_reg mux_config_sampler_balance[] = { + {0x2eb9c ,0x01906400 }, + {0x2fb9c ,0x01906400 }, + {0x253a4 ,0x00000000 }, + {0x26b9c ,0x01906400 }, + {0x27b9c ,0x01906400 }, + {0x27104 ,0x00a00000 }, + {0x27184 ,0x00a50000 }, + {0x2e804 ,0x00500000 }, + {0x2e984 ,0x00500000 }, + {0x2eb04 ,0x00500000 }, + {0x2eb80 ,0x00000084 }, + {0x2eb8c ,0x14200000 }, + {0x2eb84 ,0x00000000 }, + {0x2f804 ,0x00050000 }, + {0x2f984 ,0x00050000 }, + {0x2fb04 ,0x00050000 }, + {0x2fb80 ,0x00000084 }, + {0x2fb8c ,0x00050800 }, + {0x2fb84 ,0x00000000 }, + {0x25380 ,0x00000010 }, + {0x2538c ,0x000000c0 }, + {0x25384 ,0xaa550000 }, + {0x25404 ,0xffffc000 }, + {0x26804 ,0x50000000 }, + {0x26984 ,0x50000000 }, + {0x26b04 ,0x50000000 }, + {0x26b80 ,0x00000084 }, + {0x26b90 ,0x00050800 }, + {0x26b84 ,0x00000000 }, + {0x27804 ,0x05000000 }, + {0x27984 ,0x05000000 }, + {0x27b04 ,0x05000000 }, + {0x27b80 ,0x00000084 }, + {0x27b90 ,0x00000142 }, + {0x27b84 ,0x00000000 }, + {0x26104 ,0xa0000000 }, + {0x26184 ,0xa5000000 }, + {0x25424 ,0x00008620 }, + {0x2541c ,0x00000000 }, + {0x25428 ,0x0004a54a }, +}; + +static int select_sampler_balance_config (struct drm_i915_private *dev_priv) +{ + dev_priv->perf.oa.mux_regs = + mux_config_sampler_balance; + dev_priv->perf.oa.mux_regs_len = +ARRAY_SIZE (mux_config_sampler_balance); + + dev_priv->perf.oa.b_counter_regs = + b_counter_config_sampler_balance; + dev_priv->perf.oa.b_counter_regs_len = +ARRAY_SIZE (b_counter_config_sampler_balance); + +return 0 ; +} +int i915_oa_select_metric_set_hsw (struct drm_i915_private *dev_priv) { dev_priv->perf.oa.mux_regs =NULL ;
@@ -128,6 +459,16 @@ int i915_oa_select_metric_set_hsw(struct drm_i915_private *dev_priv)switch (dev_priv->perf.oa.metrics_set) {case METRIC_SET_ID_RENDER_BASIC :return select_render_basic_config (dev_priv); +case METRIC_SET_ID_COMPUTE_BASIC : +return select_compute_basic_config (dev_priv); +case METRIC_SET_ID_COMPUTE_EXTENDED : +return select_compute_extended_config (dev_priv); +case METRIC_SET_ID_MEMORY_READS : +return select_memory_reads_config (dev_priv); +case METRIC_SET_ID_MEMORY_WRITES : +return select_memory_writes_config (dev_priv); +case METRIC_SET_ID_SAMPLER_BALANCE : +return select_sampler_balance_config (dev_priv);default :return -ENODEV ; }
@@ -155,6 +496,116 @@ static struct attribute_group group_render_basic = { .attrs = attrs_render_basic, }; +static ssize_t +show_compute_basic_id (struct device *kdev,struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%d\n" ,METRIC_SET_ID_COMPUTE_BASIC ); +} + +static struct device_attribute dev_attr_compute_basic_id = { + .attr = { .name ="id" , .mode =S_IRUGO }, + .show = show_compute_basic_id, + .store =NULL , +}; + +static struct attribute *attrs_compute_basic[] = { + &dev_attr_compute_basic_id.attr, +NULL , +}; + +static struct attribute_group group_compute_basic = { + .name ="39ad14bc-2380-45c4-91eb-fbcb3aa7ae7b" , + .attrs = attrs_compute_basic, +}; + +static ssize_t +show_compute_extended_id (struct device *kdev,struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%d\n" ,METRIC_SET_ID_COMPUTE_EXTENDED ); +} + +static struct device_attribute dev_attr_compute_extended_id = { + .attr = { .name ="id" , .mode =S_IRUGO }, + .show = show_compute_extended_id, + .store =NULL , +}; + +static struct attribute *attrs_compute_extended[] = { + &dev_attr_compute_extended_id.attr, +NULL , +}; + +static struct attribute_group group_compute_extended = { + .name ="3865be28-6982-49fe-9494-e4d1b4795413" , + .attrs = attrs_compute_extended, +}; + +static ssize_t +show_memory_reads_id (struct device *kdev,struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%d\n" ,METRIC_SET_ID_MEMORY_READS ); +} + +static struct device_attribute dev_attr_memory_reads_id = { + .attr = { .name ="id" , .mode =S_IRUGO }, + .show = show_memory_reads_id, + .store =NULL , +}; + +static struct attribute *attrs_memory_reads[] = { + &dev_attr_memory_reads_id.attr, +NULL , +}; + +static struct attribute_group group_memory_reads = { + .name ="bb5ed49b-2497-4095-94f6-26ba294db88a" , + .attrs = attrs_memory_reads, +}; + +static ssize_t +show_memory_writes_id (struct device *kdev,struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%d\n" ,METRIC_SET_ID_MEMORY_WRITES ); +} + +static struct device_attribute dev_attr_memory_writes_id = { + .attr = { .name ="id" , .mode =S_IRUGO }, + .show = show_memory_writes_id, + .store =NULL , +}; + +static struct attribute *attrs_memory_writes[] = { + &dev_attr_memory_writes_id.attr, +NULL , +}; + +static struct attribute_group group_memory_writes = { + .name ="3358d639-9b5f-45ab-976d-9b08cbfc6240" , + .attrs = attrs_memory_writes, +}; + +static ssize_t +show_sampler_balance_id (struct device *kdev,struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%d\n" ,METRIC_SET_ID_SAMPLER_BALANCE ); +} + +static struct device_attribute dev_attr_sampler_balance_id = { + .attr = { .name ="id" , .mode =S_IRUGO }, + .show = show_sampler_balance_id, + .store =NULL , +}; + +static struct attribute *attrs_sampler_balance[] = { + &dev_attr_sampler_balance_id.attr, +NULL , +}; + +static struct attribute_group group_sampler_balance = { + .name ="bc274488-b4b6-40c7-90da-b77d7ad16189" , + .attrs = attrs_sampler_balance, +}; +int i915_perf_init_sysfs_hsw (struct drm_i915_private *dev_priv) {
@@ -163,9 +614,34 @@ i915_perf_init_sysfs_hsw(struct drm_i915_private *dev_priv) ret =sysfs_create_group (dev_priv->perf.metrics_kobj, &group_render_basic);if (ret) goto error_render_basic; + ret =sysfs_create_group (dev_priv->perf.metrics_kobj, &group_compute_basic); +if (ret) + goto error_compute_basic; + ret =sysfs_create_group (dev_priv->perf.metrics_kobj, &group_compute_extended); +if (ret) + goto error_compute_extended; + ret =sysfs_create_group (dev_priv->perf.metrics_kobj, &group_memory_reads); +if (ret) + goto error_memory_reads; + ret =sysfs_create_group (dev_priv->perf.metrics_kobj, &group_memory_writes); +if (ret) + goto error_memory_writes; + ret =sysfs_create_group (dev_priv->perf.metrics_kobj, &group_sampler_balance); +if (ret) + goto error_sampler_balance;return 0 ; +error_sampler_balance: +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_memory_writes); +error_memory_writes: +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_memory_reads); +error_memory_reads: +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_compute_extended); +error_compute_extended: +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_compute_basic); +error_compute_basic: +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_render_basic); error_render_basic:return ret; }
@@ -174,4 +650,9 @@ void i915_perf_deinit_sysfs_hsw(struct drm_i915_private *dev_priv) {sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_render_basic); +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_compute_basic); +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_compute_extended); +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_memory_reads); +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_memory_writes); +sysfs_remove_group (dev_priv->perf.metrics_kobj, &group_sampler_balance); }
Signature · 6 lines
2.7.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for Enable Gen 7 Observation Architecture
In reply to Robert Bragg== Summary ==
== Summary ==
Series 3024v1 Enable Gen 7 Observation Architecture
2016-02-02T21:31:17.176759 http://patchwork.freedesktop.org/api/1.0/series/3024/revisions/1/mbox/
Applying: drm/i915: Add i915 perf infrastructure
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/Makefile
M drivers/gpu/drm/i915/i915_dma.c
M drivers/gpu/drm/i915/i915_drv.h
M include/uapi/drm/i915_drm.h
Falling back to patching base and 3-way merge... Auto-merging include/uapi/drm/i915_drm.h
Auto-merging drivers/gpu/drm/i915/i915_drv.h
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_drv.h Auto-merging drivers/gpu/drm/i915/i915_dma.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_dma.c Auto-merging drivers/gpu/drm/i915/Makefile
Patch failed at 0001 drm/i915: Add i915 perf infrastructure
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx