Measuring how many cores used by Gstreamer pipeline

Nicolas Dufresne nicolas at ndufresne.ca
Mon Apr 2 00:00:43 UTC 2018


Le dimanche 01 avril 2018 à 13:44 -0700, evaluat0r a écrit :
> Hi,
> 
> What tools are available for measuring how many cores used for a given
> Gstreamer pipeline?
> 
> I have a server that constructs multiple Gstreamer pipelines (same type of
> pipeline) but would like to isolate my measurement down to a single pipeline
> such that I can have an idea of how many cores are devoted to transcoding.
> 
> If there are no such tools that can do this, then what would be my best bet
> here for an accurate enough approximation?

On Linux, you can get per thread usage with getrusage + RUSAGE_THREAD,
so I think what you'll be missing is the threads. It won't get you all
threads, but there is a message in GStreamer that tells you when a
thread starts, GST_MESSAGE_STREAM_STATUS. If you catch this message
using the sync message callback, you can read the thread ID using
appropriate APIs. The threads that are hard to catch are the one create
by third party libraries, like ffmpeg. I'm not sure if there is a trick
to list these.

Nicolas


More information about the gstreamer-devel mailing list