#!/usr/sbin/dtrace -s /* * isns_client_stat.d - Report iSNS stat counters for the management requests. * * This traces the timings for iSNS server response for management requests. * * The output reports the receive/respond time for each request. * * USAGE: isns_mgmt_stat.d # Hit Ctrl-C to end * * FIELDS: * PROBENAME * TID thread id of door interface. * OPERATION operatioin name * OBJECT object name * TIME nsecs for operation duration. * * AGGREGATION Total number of managment requests. * duration time distributioin. */ #pragma ident "@(#)isns_mgmt_stat.d 1.1 07/08/20 SMI" #pragma D option quiet #pragma D option dynvarsize=64m self int t; self string op; self string obj; dtrace:::BEGIN { printf("Tracing... Hit Ctrl-C to end.\n"); } isns*:::mgmt-request-received { self->t = timestamp; printf("%s/%d\n", probename, tid); @counts["iSNS management request"] = count(); } isns*:::mgmt-request-responded /self->t != 0 && self->op != NULL && self->obj != NULL/ { @mgmtavgtime[self->op, self->obj] = quantize(timestamp - self->t); printf(" %s/%d : spent %d nsecs\n", probename, tid, timestamp - self->t); self->t = 0; self->op = NULL; self->obj = NULL; } isns*:::mgmt-operation-type /self->t != 0/ { operation[100ul] = "get"; operation[101ul] = "enumerate"; operation[102ul] = "getAssociated"; operation[103ul] = "createModify"; operation[104ul] = "delete"; printf("\toperation: %s \n", operation[args[0]]); self->op = (string)operation[args[0]]; } isns*:::mgmt-object-type /self->t != 0/ { object[100ul] = "Node"; object[101ul] = "Discovery Domain"; object[102ul] = "Discovery Domain Set"; object[103ul] = "Discovery Domain Member"; object[104ul] = "Discovery Domain Set Member"; object[105ul] = "Server Configuration"; printf("\tobject: %s \n", object[args[0]]); self->obj = (string)object[args[0]]; } dtrace:::END { end = timestamp; }