mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
tracers/rusage: ifdef the RUSAGE_THREAD usage
Some versions of andoid don't seem to have it.
This commit is contained in:
parent
8ddbf76626
commit
03045d428b
1 changed files with 4 additions and 0 deletions
|
@ -177,17 +177,21 @@ do_stats (GstTracer * obj, guint64 ts)
|
|||
GST_WARNING_OBJECT (obj,
|
||||
"clock_gettime (CLOCK_THREAD_CPUTIME_ID,...) failed: %s",
|
||||
g_strerror (errno));
|
||||
#ifdef RUSAGE_THREAD
|
||||
getrusage (RUSAGE_THREAD, &ru);
|
||||
tthread =
|
||||
GST_TIMEVAL_TO_TIME (ru.ru_utime) + GST_TIMEVAL_TO_TIME (ru.ru_stime);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
getrusage (RUSAGE_SELF, &ru);
|
||||
tproc = GST_TIMEVAL_TO_TIME (ru.ru_utime) + GST_TIMEVAL_TO_TIME (ru.ru_stime);
|
||||
#ifdef RUSAGE_THREAD
|
||||
getrusage (RUSAGE_THREAD, &ru);
|
||||
tthread =
|
||||
GST_TIMEVAL_TO_TIME (ru.ru_utime) + GST_TIMEVAL_TO_TIME (ru.ru_stime);
|
||||
#endif
|
||||
#endif
|
||||
/* get stats record for current thread */
|
||||
if (!(stats = g_hash_table_lookup (self->threads, thread_id))) {
|
||||
|
|
Loading…
Reference in a new issue