/* 200 - 2000ms x 100ms */
for (i = 0; i < 15; i++) {
- hg->counter1[48 + i].val = 200 + (i * 100);
+ hg->counter1[48 + i].val = 200 + (i * 200);
}
- /* Catch all massive value (1hr) */
+ /* Catch all massive value (2secs) */
+ hg->counter1[55].val = 2000;
+
+ /* Catch all massive value (4secs) */
+ hg->counter1[56].val = 4000;
+
+ /* Catch all massive value (8secs) */
+ hg->counter1[57].val = 8000;
+
+ /* Catch all massive value (15secs) */
+ hg->counter1[58].val = 15000;
+
+ /* Catch all massive value (30secs) */
+ hg->counter1[59].val = 30000;
+
+ /* Catch all massive value (60secs) */
+ hg->counter1[60].val = 60000;
+
+ /* Catch all massive value (5mins) */
+ hg->counter1[61].val = 300000;
+
+ /* Catch all massive value (15mins) */
+ hg->counter1[62].val = 900000;
+
+ /* Catch all massive values (1hr) */
hg->counter1[63].val = 3600000;
}
-static void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val)
+void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val)
{
int i;
for (i = 0; i < 64; i++ ) {
u32 entries = 0;
int i;
- printk(KERN_ERR "Histogram named %s\n", hg->name);
+ printk(KERN_ERR "Histogram named %s (ms, count, last_update_jiffy)\n", hg->name);
for (i = 0; i < 64; i++ ) {
if (hg->counter1[i].count == 0)
continue;
saa7164_histogram_print(port, &port->irq_interval);
saa7164_histogram_print(port, &port->svc_interval);
saa7164_histogram_print(port, &port->irq_svc_interval);
+ saa7164_histogram_print(port, &port->read_interval);
+ saa7164_histogram_print(port, &port->poll_interval);
print_histogram = 64 + port->nr;
}
}
saa7164_histogram_reset(&port->svc_interval, "deferred intervals");
saa7164_histogram_reset(&port->irq_svc_interval,
"irq to deferred intervals");
+ saa7164_histogram_reset(&port->read_interval,
+ "encoder read() intervals");
+ saa7164_histogram_reset(&port->poll_interval,
+ "encoder poll() intervals");
return 0;
}
&dev->ports[ SAA7164_PORT_ENC1 ].svc_interval);
saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
&dev->ports[ SAA7164_PORT_ENC1 ].irq_svc_interval);
+ saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
+ &dev->ports[ SAA7164_PORT_ENC1 ].read_interval);
+ saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
+ &dev->ports[ SAA7164_PORT_ENC1 ].poll_interval);
saa7164_shutdown(dev);
int rem, cnt;
u8 *p;
+ port->last_read_msecs_diff = port->last_read_msecs;
+ port->last_read_msecs = jiffies_to_msecs(jiffies);
+ port->last_read_msecs_diff = port->last_read_msecs -
+ port->last_read_msecs_diff;
+
+ saa7164_histogram_update(&port->read_interval,
+ port->last_read_msecs_diff);
+
if (*pos)
return -ESPIPE;
struct saa7164_user_buffer *ubuf;
unsigned int mask = 0;
+ port->last_poll_msecs_diff = port->last_poll_msecs;
+ port->last_poll_msecs = jiffies_to_msecs(jiffies);
+ port->last_poll_msecs_diff = port->last_poll_msecs -
+ port->last_poll_msecs_diff;
+
+ saa7164_histogram_update(&port->poll_interval,
+ port->last_poll_msecs_diff);
+
if (!video_is_registered(port->v4l_device)) {
return -EIO;
}
u32 last_irq_wp, last_svc_wp;
u32 last_irq_rp, last_svc_rp;
u64 last_irq_svc_msecs_diff;
+ u64 last_read_msecs, last_read_msecs_diff;
+ u64 last_poll_msecs, last_poll_msecs_diff;
struct saa7164_histogram irq_interval;
struct saa7164_histogram svc_interval;
struct saa7164_histogram irq_svc_interval;
+ struct saa7164_histogram read_interval;
+ struct saa7164_histogram poll_interval;
/* --- DVB Transport Specific --- */
struct saa7164_dvb dvb;
void saa7164_dumphex16(struct saa7164_dev *dev, u8 *buf, int len);
void saa7164_getfirmwarestatus(struct saa7164_dev *dev);
u32 saa7164_getcurrentfirmwareversion(struct saa7164_dev *dev);
+void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val);
/* ----------------------------------------------------------- */
/* saa7164-fw.c */