• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Measuring Real Time Performance (was Re: Using getrusage function in a CoreAudio callback)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Measuring Real Time Performance (was Re: Using getrusage function in a CoreAudio callback)


  • Subject: Measuring Real Time Performance (was Re: Using getrusage function in a CoreAudio callback)
  • From: Jeff Moore <email@hidden>
  • Date: Thu, 27 Mar 2003 11:19:24 -0800

What you are measuring is the time being spent in your IOProc, regardless of whether it is your code or not. This is the truly important figure due to the fact that you are running against a real time deadline. The HAL doesn't know anything about pre-emption. It just knows that your IOProc needed to be finished by a specific point in time.

If you want to measure the load of just your code, I suggest using our performance tools. I haven't used it myself, but I've heard that folks have had great results with the CHUD toolkit.

Perhaps others on the list could share their experience and techniques for measuring the performance of real time code.

On Thursday, March 27, 2003, at 01:05 AM, Stephane Letz wrote:

Message: 5
Date: Wed, 26 Mar 2003 11:23:01 -0800
Subject: Re: Using getrusage function in a CoreAudio callback
From: Jeff Moore <email@hidden>
To: email@hidden

I don't know too much about getrusage or how it's implemented. From
reading the man page, I would guess that it does sysctl or ioctl call
or possibly uses a mach message, probably including waiting for a
reply, directly. All these mechanisms involve system locks and other
things that can block. So, I would expect that calling getrusage from
inside an IOProc would interfere with the timing.

When I do profiling of the IO thread, I just use the host time clock as
follows:

OSStatus MyIOProc(...)
{
UInt64 theStartTime = AudioGetCurrentHostTime();

do the work;

UInt64 theEndTime = AudioGetCurrentHostTime();

log the performance metrics to a safe place so another thread can
write them out;
}


But what happens if other real-time applications are running at the same
time? The IOProc may be interrupted and AudioGetCurrentHostTime will not
only reflect time consumed in the measured code. The problem is to measure
the CPU consumed *only* for MyIOProc.

Stephane Letz


Grame: Centre National de creation musicale
9, Rue du Garet
69001 Lyon
Tel: 04-72-07-37-00
Fax: 04-72-07-37-01
Web: www.grame.fr

--

Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Measuring Real Time Performance (was Re: Using getrusage function in a CoreAudio callback)
      • From: Art Gillespie <email@hidden>
References: 
 >Re: Using getrusage function in a CoreAudio callback (From: Stephane Letz <email@hidden>)

  • Prev by Date: cleanup after CreateUI
  • Next by Date: Re: Measuring Real Time Performance (was Re: Using getrusage function in a CoreAudio callback)
  • Previous by thread: Re: Using getrusage function in a CoreAudio callback
  • Next by thread: Re: Measuring Real Time Performance (was Re: Using getrusage function in a CoreAudio callback)
  • Index(es):
    • Date
    • Thread