media: dvb: mpq: Enhance information exposed in debug-fs

Added the following files to existing demux directory in debug-fs:
1. decoder_out_count: Counts number of frames output to decoder.
2. decoder_out_interval_sum: Sum of time intervals between
   frames outputs.
3. decoder_out_interval_average: Average of time intervals between
   frames outputs.
4. decoder_out_interval_max: Maximum time interval between
   frames outputs.

All counters can read and reset by writing to the respective file.
demux device output in debug-fs was adjusted for better visibility.

Change-Id: I2c9835364c534cc4b9c1cbc74afee71c40f61d98
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
This commit is contained in:
Hamad Kadmany 2012-12-25 15:30:40 +02:00 committed by Stephen Boyd
parent 9e8eeb6328
commit cb437d4091
3 changed files with 77 additions and 8 deletions

View file

@ -3354,25 +3354,27 @@ static int dvb_dmxdev_dbgfs_print(struct seq_file *s, void *p)
seq_printf(s, "filter_%02d - ", i);
if (filter->type == DMXDEV_TYPE_SEC) {
if (filter->type == DMXDEV_TYPE_SEC) {
seq_printf(s, "type: SEC, ");
seq_printf(s, "PID %04d ",
filter->params.sec.pid);
} else {
} else {
seq_printf(s, "type: %s, ",
pes_feeds[filter->params.pes.output]);
seq_printf(s, "PID: %04d ",
filter->params.pes.pid);
}
}
if (0 == dvb_dmxdev_get_buffer_status(
filter, &buffer_status)) {
seq_printf(s, "buffer size: %08d, ",
seq_printf(s, "size: %08d, ",
buffer_status.size);
seq_printf(s, "buffer fullness: %08d\n",
seq_printf(s, "fullness: %08d, ",
buffer_status.fullness);
seq_printf(s, "buffer error: %08d\n",
seq_printf(s, "error: %d\n",
buffer_status.error);
} else {
seq_printf(s, "\n");
}
}
}
@ -3380,8 +3382,6 @@ static int dvb_dmxdev_dbgfs_print(struct seq_file *s, void *p)
if (!active_count)
seq_printf(s, "No active filters\n");
seq_printf(s, "\n");
return 0;
}

View file

@ -523,6 +523,30 @@ void mpq_dmx_init_hw_statistics(struct mpq_demux *mpq_demux)
S_IRUGO|S_IWUGO,
mpq_demux->demux.dmx.debugfs_demux_dir,
&mpq_demux->decoder_drop_count);
debugfs_create_u32(
"decoder_out_count",
S_IRUGO|S_IWUGO,
mpq_demux->demux.dmx.debugfs_demux_dir,
&mpq_demux->decoder_out_count);
debugfs_create_u32(
"decoder_out_interval_sum",
S_IRUGO|S_IWUGO,
mpq_demux->demux.dmx.debugfs_demux_dir,
&mpq_demux->decoder_out_interval_sum);
debugfs_create_u32(
"decoder_out_interval_average",
S_IRUGO|S_IWUGO,
mpq_demux->demux.dmx.debugfs_demux_dir,
&mpq_demux->decoder_out_interval_average);
debugfs_create_u32(
"decoder_out_interval_max",
S_IRUGO|S_IWUGO,
mpq_demux->demux.dmx.debugfs_demux_dir,
&mpq_demux->decoder_out_interval_max);
}
}
EXPORT_SYMBOL(mpq_dmx_init_hw_statistics);
@ -2161,6 +2185,9 @@ static int mpq_dmx_process_video_packet_framing(
feed->indexing_params.standard,
feed_data->last_framing_match_type);
if (is_video_frame == 1) {
struct timespec curr_time, delta_time;
u64 delta_time_ms;
mpq_dmx_write_pts_dts(feed_data,
&(meta_data.info.framing.pts_dts_info));
mpq_dmx_save_pts_dts(feed_data);
@ -2175,6 +2202,34 @@ static int mpq_dmx_process_video_packet_framing(
0, /* current write buffer handle */
&packet.raw_data_handle);
curr_time = current_kernel_time();
if (likely(mpq_demux->decoder_out_count)) {
/* calculate time-delta between frame */
delta_time = timespec_sub(curr_time,
mpq_demux->decoder_out_last_time);
delta_time_ms =
((u64)delta_time.tv_sec * MSEC_PER_SEC)
+ delta_time.tv_nsec / NSEC_PER_MSEC;
mpq_demux->decoder_out_interval_sum +=
(u32)delta_time_ms;
mpq_demux->
decoder_out_interval_average =
mpq_demux->decoder_out_interval_sum /
mpq_demux->decoder_out_count;
if (delta_time_ms >
mpq_demux->decoder_out_interval_max)
mpq_demux->
decoder_out_interval_max =
delta_time_ms;
}
mpq_demux->decoder_out_last_time = curr_time;
mpq_demux->decoder_out_count++;
/*
* writing meta-data that includes
* the framing information

View file

@ -54,6 +54,15 @@
* exposed in debugfs.
* @decoder_drop_count: Accumulated number of bytes dropped due to decoder
* buffer fullness, exposed in debugfs.
* @decoder_out_count: Counter incremeneted for each video frame output by
* demux, exposed in debugfs.
* @decoder_out_interval_sum: Sum of intervals (msec) holding the time between
* two successive video frames output, exposed in debugfs.
* @decoder_out_interval_average: Average interval (msec) between two
* successive video frames output, exposed in debugfs.
* @decoder_out_interval_max: Max interval (msec) between two
* successive video frames output, exposed in debugfs.
* @decoder_out_last_time: Time of last video frame output.
* @last_notification_time: Time of last HW notification.
*/
struct mpq_demux {
@ -72,6 +81,11 @@ struct mpq_demux {
u32 hw_notification_size;
u32 hw_notification_min_size;
u32 decoder_drop_count;
u32 decoder_out_count;
u32 decoder_out_interval_sum;
u32 decoder_out_interval_average;
u32 decoder_out_interval_max;
struct timespec decoder_out_last_time;
struct timespec last_notification_time;
};