[FFmpeg-devel] [PATCH] print memory usage with -benchmark

Reimar Döffinger Reimar.Doeffinger
Sun Feb 21 09:04:46 CET 2010


On Sun, Feb 21, 2010 at 12:22:29AM +0000, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> 
> > On Sun, Feb 21, 2010 at 12:13:21AM +0100, Reimar D?ffinger wrote:
> >> I fear it is untested, the Windows part because I don't have Windows at hand,
> >> and the Linux/BSD/... part because it seems my kernel is too old, it always
> >> returns 0.
> >> I hope someone else can confirm its usefulness...
> >
> > And already the first fix.
> > I think it needs a 2.6.32 or later kernel for Linux.
> >
> > Index: configure
> > ===================================================================
> > --- configure	(revision 21924)
> > +++ configure	(working copy)
> > @@ -1026,8 +1026,10 @@
> >      fork
> >      getaddrinfo
> >      gethrtime
> > +    GetProcessMemoryInfo
> >      GetProcessTimes
> >      getrusage
> > +    struct_rusage_ru_maxrss
> >      inet_aton
> >      inline_asm
> >      isatty
> > @@ -2491,6 +2493,7 @@
> >  check_func  getaddrinfo $network_extralibs
> >  check_func  gethrtime
> >  check_func  getrusage
> > +check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
> 
> Why the sys/time.h?  sys/resource.h doesn't require that.

My man page recommends it as more portable.

> > -        printf("bench: utime=%0.3fs\n", ti / 1000000.0);
> > +        int maxrss = getmaxrss() / 1024;
> > +        printf("bench: utime=%0.3fs maxrss: %i kB\n", ti / 1000000.0, maxrss);
> 
> I suggest printing maxrss=%i for consistency with the utime field.

Definitely, silly oversight.



More information about the ffmpeg-devel mailing list