Inspired by this, a few hacks to record latency numbers and plot a
histogram with many bins:
http://www.anderswallin.net/2012/12/latency-histogram/

Something that populates and shows the histogram updating as we record
latency numbers is probably doable also. I may or may not have inspiration
to throw that together soon - but if anyone has a good idea on how to do
this please let us know!

Asides:
1. Is there a programmatic way in userspace C or Python to read the FIFO
that sampler writes? Always going through a file or stdout stream with
halsampler seems cumbersome. I'd like to read the FIFO e.g. in Python and
not have to do type-coversion of float/s32/bit etc from/to the stdout
format.
2. There are probably historic reasons for the names sampler/halsampler and
streamer/halstreamer. Without the docs I'm not sure I could describe what
each does just by looking at the names. I'd suggest something like hal2FIFO
/ FIFO2File and FIFO2HAL / File2FIFO or similar descriptive names.

Anders


On Thu, Dec 6, 2012 at 2:55 AM, Dewey Garrett <[email protected]> wrote:

> Here is a simple comp named lhisto.comp to show
> a histogram for latency values in 1,2,5 bin sizes
> over 4 decades:
>
>   http://www.panix.com/~dgarrett/stuff/lhisto.comp
>
> The default minimum bin is 1uS (1000 nS)
>
> To Install:
> $ comp --install lhisto.comp
>
> A file (example named "go" here) to simplify running it
> with halrun is:
>
>   $ cat go
>   # start threads for base and servo periods
>   loadrt threads name1=base period1=25000 name2=servo period2=1000000
>   loadrt lhisto names=shisto,bhisto
>   addf shisto servo
>   addf bhisto base
>   start
>
> Example usage with halrun (dont run Linuxcnc simultaneously)
> ( # annotation added for xenomai on a sl510 laptop):
>
>   $ halrun
>   halcmd: source go
>   halcmd: show pin bhisto
>   Component Pins:
>   Owner   Type  Dir     Value  Name
>        9  s32   OUT  86021994  bhisto.h00001   # bin for lat < 1*tmin
>        9  s32   OUT    143633  bhisto.h00002   # bin for 1*tmin <= lat <
> 2*tmin
>        9  s32   OUT     39154  bhisto.h00005   # etc
>        9  s32   OUT     10918  bhisto.h00010   # etc
>        9  s32   OUT         5  bhisto.h00020
>        9  s32   OUT         0  bhisto.h00050
>        9  s32   OUT         0  bhisto.h00100
>        9  s32   OUT         0  bhisto.h00200
>        9  s32   OUT         0  bhisto.h00500
>        9  s32   OUT         0  bhisto.h01000
>        9  s32   OUT         0  bhisto.h02000
>        9  s32   OUT         0  bhisto.h05000
>        9  s32   OUT         0  bhisto.h10000
>        9  s32   OUT         0  bhisto.h20000
>        9  s32   OUT         0  bhisto.h50000   # 20000*tmin <= lat <
> 50000*tmin
>        9  s32   OUT         0  bhisto.hmax     # bin for lat >=50000*tmin
>        9  s32   OUT  86215707  bhisto.hsamples # total samples
>        9  s32   OUT     11390  bhisto.latmax   # max latency for thread
>        9  bit   IN      FALSE  bhisto.reset    # INPUT to restart
>        9  s32   OUT         0  bhisto.restarts # count of restarts or
> overflows
>        9  s32   IN       1000  bhisto.tmin     # INPUT tmin size
> (default=1000nS)
>   ...
>
>
> Alternatively, you could specify the "go" file and remain interactive:
>   $ halrun -I -f go
>   halcmd: show pin bhisto
>   halcmd: show pin shisto
>   ...
>
> An example of saving the base thread histogram info to a file
> (from an independent shell):
>   $ halcmd show pin bhisto|grep -v Value|cut -c18- >|result
> --
> Dewey Garrett
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to