Commit 7effc0f7 authored by Christophe Massiot's avatar Christophe Massiot

We now display CPU usage statistics for each thread.

parent d54a5f8f
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#ifdef STATS
# include <sys/times.h>
#endif
#include "config.h" #include "config.h"
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
...@@ -293,6 +297,16 @@ static void EndThread( input_thread_t * p_input ) ...@@ -293,6 +297,16 @@ static void EndThread( input_thread_t * p_input )
pi_status = p_input->pi_status; pi_status = p_input->pi_status;
*pi_status = THREAD_END; *pi_status = THREAD_END;
#ifdef STATS
{
struct tms cpu_usage;
times( &cpu_usage );
intf_Msg("input stats: cpu usage (user: %d, system: %d)\n",
cpu_usage.tms_utime, cpu_usage.tms_stime);
}
#endif
/* Destroy all decoder threads */ /* Destroy all decoder threads */
for( i_es_loop = 0; for( i_es_loop = 0;
(i_es_loop < INPUT_MAX_ES) (i_es_loop < INPUT_MAX_ES)
......
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
#include <stdio.h> /* sprintf() */ #include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */ #include <string.h> /* strerror() */
#ifdef STATS
# include <sys/times.h>
#endif
#include "config.h" #include "config.h"
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
...@@ -1259,6 +1263,16 @@ static void EndThread( vout_thread_t *p_vout ) ...@@ -1259,6 +1263,16 @@ static void EndThread( vout_thread_t *p_vout )
intf_DbgMsg("\n"); intf_DbgMsg("\n");
*p_vout->pi_status = THREAD_END; *p_vout->pi_status = THREAD_END;
#ifdef STATS
{
struct tms cpu_usage;
times( &cpu_usage );
intf_Msg("vout stats: cpu usage (user: %d, system: %d)\n",
cpu_usage.tms_utime, cpu_usage.tms_stime);
}
#endif
/* Destroy all remaining pictures and subpictures */ /* Destroy all remaining pictures and subpictures */
for( i_index = 0; i_index < VOUT_MAX_PICTURES; i_index++ ) for( i_index = 0; i_index < VOUT_MAX_PICTURES; i_index++ )
{ {
......
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#ifdef STATS
# include <sys/times.h>
#endif
#include "config.h" #include "config.h"
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
...@@ -322,6 +326,15 @@ static void EndThread( vpar_thread_t *p_vpar ) ...@@ -322,6 +326,15 @@ static void EndThread( vpar_thread_t *p_vpar )
#ifdef STATS #ifdef STATS
intf_Msg("vpar stats: %d loops among %d sequence(s)\n", intf_Msg("vpar stats: %d loops among %d sequence(s)\n",
p_vpar->c_loops, p_vpar->c_sequences); p_vpar->c_loops, p_vpar->c_sequences);
{
struct tms cpu_usage;
times( &cpu_usage );
intf_Msg("vpar stats: cpu usage (user: %d, system: %d)\n",
cpu_usage.tms_utime, cpu_usage.tms_stime);
}
intf_Msg("vpar stats: Read %d frames/fields (I %d/P %d/B %d)\n", intf_Msg("vpar stats: Read %d frames/fields (I %d/P %d/B %d)\n",
p_vpar->pc_pictures[I_CODING_TYPE] p_vpar->pc_pictures[I_CODING_TYPE]
+ p_vpar->pc_pictures[P_CODING_TYPE] + p_vpar->pc_pictures[P_CODING_TYPE]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment