#!/bin/probevue /* mmapsline.e */ /* Demonstation of single line output and running average */ /* typedef unsigned long size_t; <--- Known issue in TL2 */ typedef unsigned int size_t; typedef long long off_t; void *mmap(void *, size_t, int, int, int, off_t); long long totalcalls; long long avgrequest; long long maxrequest; long long minrequest; @@BEGIN { totalcalls = 0; avgrequest = 0; maxrequest = 0; minrequest = -1; printf("mmap\n"); printf("Count__________Average________Max____________Min_____________\n"); } @@syscall:*:mmap:entry { long long request; request = __arg2; totalcalls++; if (request > maxrequest) maxrequest = request; if (minrequest == -1) minrequest = request; if (request < minrequest) minrequest = request; avgrequest = avgrequest + (( request - avgrequest ) / totalcalls); } @@interval:*:clock:1000 { long long minreq; if(minrequest == -1) minreq = 0; else minreq = minrequest; printf("\r%-14ld %-14ld %-14ld %-14ld ", totalcalls, avgrequest, maxrequest, minreq); } @@END { printf("\n"); }