Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
d5264484
Commit
d5264484
authored
Apr 15, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stats: Support per object timer. (and implement stats_TimerClean()).
parent
8bd5140a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
include/vlc_messages.h
include/vlc_messages.h
+6
-2
src/libvlc-common.c
src/libvlc-common.c
+1
-1
src/misc/stats.c
src/misc/stats.c
+27
-5
No files found.
include/vlc_messages.h
View file @
d5264484
...
@@ -195,6 +195,7 @@ struct counter_t
...
@@ -195,6 +195,7 @@ struct counter_t
unsigned
int
i_id
;
unsigned
int
i_id
;
char
*
psz_name
;
char
*
psz_name
;
int
i_type
;
int
i_type
;
void
*
p_obj
;
int
i_compute_type
;
int
i_compute_type
;
int
i_samples
;
int
i_samples
;
counter_sample_t
**
pp_samples
;
counter_sample_t
**
pp_samples
;
...
@@ -370,7 +371,10 @@ VLC_EXPORT( void,__stats_TimerStart, (vlc_object_t*, const char *, unsigned int
...
@@ -370,7 +371,10 @@ VLC_EXPORT( void,__stats_TimerStart, (vlc_object_t*, const char *, unsigned int
VLC_EXPORT
(
void
,
__stats_TimerStop
,
(
vlc_object_t
*
,
unsigned
int
)
);
VLC_EXPORT
(
void
,
__stats_TimerStop
,
(
vlc_object_t
*
,
unsigned
int
)
);
VLC_EXPORT
(
void
,
__stats_TimerDump
,
(
vlc_object_t
*
,
unsigned
int
)
);
VLC_EXPORT
(
void
,
__stats_TimerDump
,
(
vlc_object_t
*
,
unsigned
int
)
);
VLC_EXPORT
(
void
,
__stats_TimersDumpAll
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
void
,
__stats_TimersDumpAll
,
(
vlc_object_t
*
)
);
#define stats_TimersClean(a) __stats_TimersClean( VLC_OBJECT(a) )
#define stats_TimersCleanAll(a) __stats_TimersCleanAll( VLC_OBJECT(a) )
VLC_EXPORT
(
void
,
__stats_TimersClean
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
void
,
__stats_TimersCleanAll
,
(
vlc_object_t
*
)
);
#define stats_TimerClean(a,b) __stats_TimerClean( VLC_OBJECT(a), b )
VLC_EXPORT
(
void
,
__stats_TimerClean
,
(
vlc_object_t
*
,
int
)
);
#endif
#endif
src/libvlc-common.c
View file @
d5264484
...
@@ -988,7 +988,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
...
@@ -988,7 +988,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
vlc_object_release
(
p_libvlc
->
p_interaction
);
vlc_object_release
(
p_libvlc
->
p_interaction
);
stats_TimersDumpAll
(
p_libvlc
);
stats_TimersDumpAll
(
p_libvlc
);
stats_TimersClean
(
p_libvlc
);
stats_TimersClean
All
(
p_libvlc
);
/* Free announce handler(s?) */
/* Free announce handler(s?) */
while
(
(
p_announce
=
vlc_object_find
(
p_libvlc
,
VLC_OBJECT_ANNOUNCE
,
while
(
(
p_announce
=
vlc_object_find
(
p_libvlc
,
VLC_OBJECT_ANNOUNCE
,
...
...
src/misc/stats.c
View file @
d5264484
...
@@ -142,6 +142,7 @@ int __stats_Get( vlc_object_t *p_this, counter_t *p_counter, vlc_value_t *val )
...
@@ -142,6 +142,7 @@ int __stats_Get( vlc_object_t *p_this, counter_t *p_counter, vlc_value_t *val )
input_stats_t
*
stats_NewInputStats
(
input_thread_t
*
p_input
)
input_stats_t
*
stats_NewInputStats
(
input_thread_t
*
p_input
)
{
{
(
void
)
p_input
;
input_stats_t
*
p_stats
=
malloc
(
sizeof
(
input_stats_t
)
);
input_stats_t
*
p_stats
=
malloc
(
sizeof
(
input_stats_t
)
);
if
(
!
p_stats
)
if
(
!
p_stats
)
...
@@ -286,7 +287,8 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
...
@@ -286,7 +287,8 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
for
(
i
=
0
;
i
<
p_obj
->
p_libvlc
->
i_timers
;
i
++
)
for
(
i
=
0
;
i
<
p_obj
->
p_libvlc
->
i_timers
;
i
++
)
{
{
if
(
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
i_id
==
i_id
)
if
(
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
i_id
==
i_id
&&
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
p_obj
==
p_obj
)
{
{
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
break
;
break
;
...
@@ -304,6 +306,7 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
...
@@ -304,6 +306,7 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
}
}
p_counter
->
psz_name
=
strdup
(
psz_name
);
p_counter
->
psz_name
=
strdup
(
psz_name
);
p_counter
->
i_id
=
i_id
;
p_counter
->
i_id
=
i_id
;
p_counter
->
p_obj
=
p_obj
;
INSERT_ELEM
(
p_obj
->
p_libvlc
->
pp_timers
,
p_obj
->
p_libvlc
->
i_timers
,
INSERT_ELEM
(
p_obj
->
p_libvlc
->
pp_timers
,
p_obj
->
p_libvlc
->
i_timers
,
p_obj
->
p_libvlc
->
i_timers
,
p_counter
);
p_obj
->
p_libvlc
->
i_timers
,
p_counter
);
...
@@ -320,7 +323,7 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
...
@@ -320,7 +323,7 @@ void __stats_TimerStart( vlc_object_t *p_obj, const char *psz_name,
}
}
if
(
p_counter
->
pp_samples
[
0
]
->
value
.
b_bool
==
true
)
if
(
p_counter
->
pp_samples
[
0
]
->
value
.
b_bool
==
true
)
{
{
msg_Warn
(
p_obj
,
"timer
%s
was already started !"
,
psz_name
);
msg_Warn
(
p_obj
,
"timer
'%s'
was already started !"
,
psz_name
);
vlc_mutex_unlock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
vlc_mutex_unlock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
return
;
return
;
}
}
...
@@ -337,7 +340,8 @@ void __stats_TimerStop( vlc_object_t *p_obj, unsigned int i_id )
...
@@ -337,7 +340,8 @@ void __stats_TimerStop( vlc_object_t *p_obj, unsigned int i_id )
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
for
(
i
=
0
;
i
<
p_obj
->
p_libvlc
->
i_timers
;
i
++
)
for
(
i
=
0
;
i
<
p_obj
->
p_libvlc
->
i_timers
;
i
++
)
{
{
if
(
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
i_id
==
i_id
)
if
(
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
i_id
==
i_id
&&
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
p_obj
==
p_obj
)
{
{
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
break
;
break
;
...
@@ -364,7 +368,8 @@ void __stats_TimerDump( vlc_object_t *p_obj, unsigned int i_id )
...
@@ -364,7 +368,8 @@ void __stats_TimerDump( vlc_object_t *p_obj, unsigned int i_id )
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
for
(
i
=
0
;
i
<
p_obj
->
p_libvlc
->
i_timers
;
i
++
)
for
(
i
=
0
;
i
<
p_obj
->
p_libvlc
->
i_timers
;
i
++
)
{
{
if
(
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
i_id
==
i_id
)
if
(
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
i_id
==
i_id
&&
p_obj
->
p_libvlc
->
pp_timers
[
i
]
->
p_obj
==
p_obj
)
{
{
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
break
;
break
;
...
@@ -384,7 +389,24 @@ void __stats_TimersDumpAll( vlc_object_t *p_obj )
...
@@ -384,7 +389,24 @@ void __stats_TimersDumpAll( vlc_object_t *p_obj )
vlc_mutex_unlock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
vlc_mutex_unlock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
}
}
void
__stats_TimersClean
(
vlc_object_t
*
p_obj
)
void
__stats_TimerClean
(
vlc_object_t
*
p_obj
,
int
i_id
)
{
int
i
;
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
for
(
i
=
p_obj
->
p_libvlc
->
i_timers
-
1
;
i
>=
0
;
i
--
)
{
counter_t
*
p_counter
=
p_obj
->
p_libvlc
->
pp_timers
[
i
];
if
(
p_counter
->
i_id
==
i_id
&&
p_counter
->
p_obj
==
p_obj
)
{
REMOVE_ELEM
(
p_obj
->
p_libvlc
->
pp_timers
,
p_obj
->
p_libvlc
->
i_timers
,
i
);
stats_CounterClean
(
p_counter
);
}
}
vlc_mutex_unlock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
}
void
__stats_TimersCleanAll
(
vlc_object_t
*
p_obj
)
{
{
int
i
;
int
i
;
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
vlc_mutex_lock
(
&
p_obj
->
p_libvlc
->
timer_lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment