iovisor / ply

Dynamic Tracing in Linux
GNU General Public License v2.0
972 stars 92 forks source link

Add 'sum' function for aggregation #72

Closed namhyung closed 3 years ago

namhyung commented 3 years ago

Add sum() function to calculate total number of some events.

# cat readsize.ply
tracepoint:syscalls/sys_exit_read { 
    if (data->ret > 0)
        @bytes[comm] = sum(data->ret);
}

# ply -c 'dd if=/dev/zero of=/dev/null bs=1k count=400' readsize.ply
ply: active
400+0 records in
400+0 records out
409600 bytes (410 kB, 400 KiB) copied, 0.000530946 s, 771 MB/s
ply: deactivating

@bytes:
{ ply             }: 4
{ pipewire-media- }: 64
{ gnome-terminal- }: 161
{ sh              }: 2496
{ dd              }: 413428
namhyung commented 3 years ago

Looks like the arm-check is unstable.

wkz commented 3 years ago

It is very stable - :100: % fail rate :grin:

Since #70 has now been merged, do you mind updating this?

Thanks for these awesome contributions! :heart:

namhyung commented 3 years ago

Updated, thanks!