aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-03-28 04:34:45 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:47 -0400
commitad0992e97c5416e431e19dcfd4f6c84448dc1bc2 (patch)
treeea90956680289c0797b715422e9d1c889f38f3d5 /drivers/media/video/pvrusb2/pvrusb2-debugifc.c
parentbe9cbb7c559eddea19604abafb89faf9c8666715 (diff)
V4L/DVB (7699): pvrusb2: Implement statistics for USB I/O performance / tracking
Implement a mechanism in the pvrusb2 driver for gathering statistics on the stream buffering, including bytes transferred, buffers handled, buffers in flight, etc. This is useful for debugging certain classes of streaming issues and for determining if the buffer pool size is generally correct for the driver. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-debugifc.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-debugifc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
index b0687430fdd4..b53121c78ff9 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
@@ -164,6 +164,8 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw,
164 int ccnt; 164 int ccnt;
165 int ret; 165 int ret;
166 u32 gpio_dir,gpio_in,gpio_out; 166 u32 gpio_dir,gpio_in,gpio_out;
167 struct pvr2_stream_stats stats;
168 struct pvr2_stream *sp;
167 169
168 ret = pvr2_hdw_is_hsm(hdw); 170 ret = pvr2_hdw_is_hsm(hdw);
169 ccnt = scnprintf(buf,acnt,"USB link speed: %s\n", 171 ccnt = scnprintf(buf,acnt,"USB link speed: %s\n",
@@ -182,6 +184,24 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw,
182 pvr2_hdw_get_streaming(hdw) ? "on" : "off"); 184 pvr2_hdw_get_streaming(hdw) ? "on" : "off");
183 bcnt += ccnt; acnt -= ccnt; buf += ccnt; 185 bcnt += ccnt; acnt -= ccnt; buf += ccnt;
184 186
187
188 sp = pvr2_hdw_get_video_stream(hdw);
189 if (sp) {
190 pvr2_stream_get_stats(sp, &stats, 0);
191 ccnt = scnprintf(
192 buf,acnt,
193 "Bytes streamed=%u"
194 " URBs: queued=%u idle=%u ready=%u"
195 " processed=%u failed=%u\n",
196 stats.bytes_processed,
197 stats.buffers_in_queue,
198 stats.buffers_in_idle,
199 stats.buffers_in_ready,
200 stats.buffers_processed,
201 stats.buffers_failed);
202 bcnt += ccnt; acnt -= ccnt; buf += ccnt;
203 }
204
185 return bcnt; 205 return bcnt;
186} 206}
187 207
@@ -220,6 +240,10 @@ static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
220 return pvr2_hdw_cmd_decoder_reset(hdw); 240 return pvr2_hdw_cmd_decoder_reset(hdw);
221 } else if (debugifc_match_keyword(wptr,wlen,"worker")) { 241 } else if (debugifc_match_keyword(wptr,wlen,"worker")) {
222 return pvr2_hdw_untrip(hdw); 242 return pvr2_hdw_untrip(hdw);
243 } else if (debugifc_match_keyword(wptr,wlen,"usbstats")) {
244 pvr2_stream_get_stats(pvr2_hdw_get_video_stream(hdw),
245 NULL, !0);
246 return 0;
223 } 247 }
224 return -EINVAL; 248 return -EINVAL;
225 } else if (debugifc_match_keyword(wptr,wlen,"cpufw")) { 249 } else if (debugifc_match_keyword(wptr,wlen,"cpufw")) {