SYNOPSIS

loadrt latencybinstream [count=N|names=name1[,name2…]] [keys=value[,value…]]

keys

Stream shmem unique key for each instance

DESCRIPTION

Calculates a latency histogram of the thread the component is running in. The histogram data is sent in a HAL stream for maximum transfer speed and streaming prevents any RT to non-RT data race condition.

Read the availablebins pin for the number of bins available. Set the maxbinnumber pin for the number of ±;bins. Ensure maxbinnumberavailablebins.

For maxbinnumber = N, the bins are numbered:

  • -N … 0 … +N bins
    (total effective bins = 2 * maxbinnumber + 1)

  • Any data outside the bins is counted and available at the start and end of the data stream (ntail and ptail, see stream format below).

Set nsbinsize pin for the bin width in nanoseconds (ns).

Stream format and how to obtain the histogram data:

  • Set stream pin to high

  • Read the fifo data when it becomes available. The data streamed has the following sequence:

    • ntail -N … 0 … N ptail

    • This gives 2 * maxbinnumber + 1 + 2 values streamed

  • Read the latency pins that reflect the values at the time when stream was asserted.

  • Set stream pin to low

The reset pin may be used to restart. Note that the reset pin is set to high at startup. You must set it to low before data collection begins.

The latency pin outputs the instantaneous latency. The average, minimum, maximum and variance available from pins latency-avg, latency-min, latency-max and variance respectively, but they are only updated on the rising edge of the stream pin.

Maintainers note: hardcoded for MAXBINNUMBER==1000

FUNCTIONS

latencybinstream.N

PINS

latencybinstream.N.maxbinnumber s64 in (default: 1000)

Number of active bins N on each side (-N…0…N).

latencybinstream.N.nsbinsize s64 in

Time interval for one bin in nanoseconds (ns).

latencybinstream.N.reset bit in (default: 1)

Reset state and bins.

latencybinstream.N.stream bit in (default: 0)

Set to high to stream all bins and tails on rising edge.

latencybinstream.N.stream-error bit out

Set if the data stream did not fit and was never sent.

latencybinstream.N.latency s64 out

Last measured latency.

latencybinstream.N.latency-avg s64 out

Average latency (when stream pin is asserted).

latencybinstream.N.latency-max s64 out

Maximum latency (when stream pin is asserted).

latencybinstream.N.latency-min s64 out

Minimum latency (when stream pin is asserted).

latencybinstream.N.variance s64 out

Variance of the latency (when stream pin is asserted).

latencybinstream.N.stream-time s64 out

The time it took for the stream data to be pushed out in nanoseconds (ns).

latencybinstream.N.availablebins s64 out (default: 1000)

Hard-coded maximum number of bins. You need to change the source code if you need more bins.

AUTHOR

B.Stultiens

LICENSE

GPL