diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-09-06 01:32:09 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-09-06 01:32:09 +0000 |
commit | b3e0f5fb6df7bc3ae331ed3e101c3b25d5d5ebff (patch) | |
tree | 071431f644926105f6377a2732b1ac13470c33b0 | |
parent | 2f96ad35136fa139ba5033b2fdb3172ec0a37287 (diff) |
Kill the stats data structures and noop some other parts. Nothing in
userland asks for these stats, and we stopped recording anything
interesting a while back.
-rw-r--r-- | sys/dev/pci/drm/drmP.h | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 15 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_ioctl.c | 22 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_irq.c | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_lock.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_dma.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/drm/mga_dma.c | 5 |
7 files changed, 1 insertions, 57 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index d1d4e1c747b..025b5d425cf 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -579,11 +579,6 @@ struct drm_device { int open_count; /* Outstanding files open */ int buf_use; /* Buffers in use -- cannot alloc */ - /* Performance counters */ - unsigned long counters; - enum drm_stat_type types[15]; - atomic_t counts[15]; - /* Authentication */ drm_file_list_t files; drm_magic_t magicid; diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 45a6b7d97f9..91dfd2eea09 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -356,17 +356,6 @@ drm_firstopen(struct drm_device *dev) return i; } - dev->counters = 6; - dev->types[0] = _DRM_STAT_LOCK; - dev->types[1] = _DRM_STAT_OPENS; - dev->types[2] = _DRM_STAT_CLOSES; - dev->types[3] = _DRM_STAT_IOCTLS; - dev->types[4] = _DRM_STAT_LOCKS; - dev->types[5] = _DRM_STAT_UNLOCKS; - - for (i = 0; i < DRM_ARRAY_SIZE(dev->counts); i++) - atomic_set(&dev->counts[i], 0); - dev->magicid = 1; SPLAY_INIT(&dev->magiclist); @@ -495,7 +484,6 @@ drmopen(DRM_CDEV kdev, int flags, int fmt, DRM_STRUCTPROC *p) retcode = drm_open_helper(kdev, flags, fmt, p, dev); if (retcode == 0) { - atomic_inc(&dev->counts[_DRM_STAT_OPENS]); DRM_LOCK(); if (dev->open_count++ == 0) retcode = drm_firstopen(dev); @@ -556,7 +544,6 @@ drmclose(DRM_CDEV kdev, int flags, int fmt, DRM_STRUCTPROC *p) if (drm_lock_take(&dev->lock, DRM_KERNEL_CONTEXT)) { dev->lock.file_priv = file_priv; dev->lock.lock_time = jiffies; - atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); break; /* Got lock */ } /* Contention */ @@ -586,7 +573,6 @@ drmclose(DRM_CDEV kdev, int flags, int fmt, DRM_STRUCTPROC *p) */ done: - atomic_inc(&dev->counts[_DRM_STAT_CLOSES]); if (--dev->open_count == 0) { retcode = drm_lastclose(dev); } @@ -621,7 +607,6 @@ drmioctl(DRM_CDEV kdev, u_long cmd, caddr_t data, int flags, return EINVAL; } - atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]); ++file_priv->ioctl_count; DRM_DEBUG("pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", diff --git a/sys/dev/pci/drm/drm_ioctl.c b/sys/dev/pci/drm/drm_ioctl.c index cd993d7a514..ed3611e4b51 100644 --- a/sys/dev/pci/drm/drm_ioctl.c +++ b/sys/dev/pci/drm/drm_ioctl.c @@ -211,27 +211,7 @@ drm_getclient(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_stats *stats = data; - int i; - - memset(stats, 0, sizeof(struct drm_stats)); - - DRM_LOCK(); - - for (i = 0; i < dev->counters; i++) { - if (dev->types[i] == _DRM_STAT_LOCK) - stats->data[i].value = (dev->lock.hw_lock - ? dev->lock.hw_lock->lock : 0); - else - stats->data[i].value = atomic_read(&dev->counts[i]); - stats->data[i].type = dev->types[i]; - } - - stats->count = dev->counters; - - DRM_UNLOCK(); - - return 0; + return (EINVAL); } #define DRM_IF_MAJOR 1 diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c index ddc47153031..866455ddc03 100644 --- a/sys/dev/pci/drm/drm_irq.c +++ b/sys/dev/pci/drm/drm_irq.c @@ -426,7 +426,6 @@ drm_locked_task(void *context, void *pending) dev->lock.file_priv = NULL; /* kernel owned */ dev->lock.lock_time = jiffies; - atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); DRM_UNLOCK(); diff --git a/sys/dev/pci/drm/drm_lock.c b/sys/dev/pci/drm/drm_lock.c index 6b130fdd77e..2c85d8bdc6b 100644 --- a/sys/dev/pci/drm/drm_lock.c +++ b/sys/dev/pci/drm/drm_lock.c @@ -141,7 +141,6 @@ drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) if (drm_lock_take(&dev->lock, lock->context)) { dev->lock.file_priv = file_priv; dev->lock.lock_time = jiffies; - atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); break; /* Got lock */ } @@ -190,8 +189,6 @@ drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) } DRM_SPINUNLOCK(&dev->tsk_lock); - atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); - DRM_LOCK(); drm_lock_transfer(&dev->lock, DRM_KERNEL_CONTEXT); diff --git a/sys/dev/pci/drm/i915_dma.c b/sys/dev/pci/drm/i915_dma.c index 73be55e5b6a..b0c8d3b63ac 100644 --- a/sys/dev/pci/drm/i915_dma.c +++ b/sys/dev/pci/drm/i915_dma.c @@ -930,13 +930,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) unsigned long base, size; int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1; - /* i915 has 4 more counters */ - dev->counters += 4; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; - dev->types[9] = _DRM_STAT_DMA; - dev_priv = drm_calloc(1, sizeof(drm_i915_private_t), DRM_MEM_DRIVER); if (dev_priv == NULL) return -ENOMEM; diff --git a/sys/dev/pci/drm/mga_dma.c b/sys/dev/pci/drm/mga_dma.c index dad747c0b95..52145252687 100644 --- a/sys/dev/pci/drm/mga_dma.c +++ b/sys/dev/pci/drm/mga_dma.c @@ -407,11 +407,6 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags) dev_priv->mmio_base = drm_get_resource_start(dev, 1); dev_priv->mmio_size = drm_get_resource_len(dev, 1); - dev->counters += 3; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; - return 0; } |