STAPREF(1) General Commands Manual STAPREF(1) JMENO stapref - referencni prirucka pro skriptovaci jazyk systemtapu POUZiTI stapref POPIS Referencni prirucka pro skriptovaci jazyk systemtapu. JAZYK Klicova slova o break o continue o delete o else o exit o foreach o for o function o global o private o if o in o next o probe o return o try/catch o while Datove typy a operatory Cela cisla o var1 = 5 o global var2 = 10 Retezce o var1 = "string1" o global var2 = "string2" Asociativni pole o global array1[] o global array2[SIZE] o array[index] = 5 Kontextove promenne o $var o $var$ ("pekny vypis" retezce) Binarni ciselne operatory o * / % + - << >> & ^ | && || Binarni retezcove operatory o . (spojeni retezcu) Operatory pro ciselne prirazeni o = += -= *= /= %= >>= <<= &= ^= |= Prirazovaci operatory pro retezce o = .= Unarni ciselne operatory o + - ! ~ ++ -- Operatory pro porovnavani cisel a retezcu o < > <= >= == != Operatory pro srovnani proti regularnimu vyrazu o =~ !~ Ternarni operator o cond ? exp1 : exp2 Seskupovaci operator o ( expression ) Operatory nad poli o array[index] (array read/write) o [index] in array Agregacni operator. o var <<< value Prikazy Skok o continue o break o next o return expression o try prikaz catch (zprava) Prikazy vetveni o if (vyraz) prikaz o else prikaz Prikazy pro iterovani o foreach (promenna in pole) prikaz o foreach ([var1,var2,...] in pole) prikaz o for (vyraz; vyraz; vyraz) prikaz o while (vyraz) prikaz Deklarace o function jmeno (promenna : type, ...) { prikaz } o function jmeno : type (promenna : type, ...) { prikaz } o function jmeno : type (promenna : type, ...) %{ c_prikaz %} o probe sondazni_bod { prikaz } o probe label = sondazni_bod { prikaz } Lexikalni struktury Komentare o # ... komentar o // ... komentar o /* ... komentar ... */ Znacky pro preprocesor o %( vyraz %? true_tokens %: false_tokens %) o @define znacka (promenna, ...) %{ prikaz %} Vestavene funkce Vestavene agregacni funkce o @avg (promenna) o @count (promenna) o @hist_linear (promenna, N, N, N) o @hist_log (promenna) o @max (promenna) o @min (promenna) o @sum (promenna) Vestavene funkce pro vystup o print (promenna) o printf (format:retezec, promenna, ...) kde format ma tvar: %[flags][sirka][.presnost][delka]specifiaktor o printd (oddelovac:retezec, promenna, ...) o printdln (oddelovac:retezec, promenna, ...) o println () o sprint:retezec (promenna) o sprintf:retezec (format:retezec, promenna, ...) Vestavene funkce pro pristup k promennym o @cast (variable, "type_name"[, "module"]) o @defined (variable) Sondazni body Nektere bezne sondazni body o kernel.function(PATTERN) kernel.function(PATTERN).call o kernel.function(PATTERN).return o kernel.FUNCTION (PATTERN).return.maxactive(VALUE) o kernel.FUNCTION (PATTERN).inline o kernel.FUNCTION (PATTERN).label(LPATTERN) o module(MPATTERN).FUNCTION (PATTERN) o module(MPATTERN).FUNCTION (PATTERN).call o module(MPATTERN).FUNCTION (PATTERN).return.maxactive(VALUE) o module(MPATTERN).FUNCTION (PATTERN).inline o kernel.statement(PATTERN) o kernel.statement(ADDRESS).absolute o module(MPATTERN).statement(PATTERN) o kprobe.FUNCTION (FUNCTION) o kprobe.FUNCTION (FUNCTION).return o kprobe.module(NAME).FUNCTION (FUNCTION) o kprobe.module(NAME).FUNCTION (FUNCTION).return o kprobe.statement(ADDRESS).absolute o process.begin process("PATH").begin o process(PID).begin process.thread.begin o process("PATH").thread.begin o process(PID).thread.begin o process.end o process("PATH").end o process(PID).end o process.thread.end o process("PATH").thread.end o process(PID).thread.end o process("PATH").syscall o process(PID).syscall o process.syscall.return o process("PATH").syscall.return o process(PID).syscall.return o process("PATH").FUNCTION ("NAME") o process("PATH").statement("*@FILE.c:123") o process("PATH").FUNCTION ("*").return o process("PATH").FUNCTION ("myfun").label("foo") o process("PATH").mark("LABEL") o java("PNAME").class("CLASSNAME").method("PATTERN") o java("PNAME").class("CLASSNAME").method("PATTERN").return o java(PID).class("CLASSNAME").method("PATTERN") o java(PID).class("CLASSNAME").method("PATTERN").return o python2.module("MODULENAME").function("PATTERN") o python2.module("MODULENAME").function("PATTERN").return o python3.module("MODULENAME").function("PATTERN") o python3.module("MODULENAME").function("PATTERN").return Funkce standardniho tapsetu Nektere beznejsi funkce standardniho tapsetu o addr:long () o backtrace:string () o caller:string () o caller_addr:long () o cmdline_arg:string (N:long) o cmdline_args:string (N:long,m:long,delim:string) o cmdline_str:string () o env_var:string (name:string) o execname:string () o int_arg:long (N:long) o isinstr:long(s1:string,s2:string) o long_arg:long (N:long) o modname:string () o module_name:string () o pid:long () o pn:string () o pointer_arg:string (N:long) o pp:string () o print_backtrace () o probefunc:string () o register:long(name:string) o str_replace:string(prnt_str:string,srch_str:string,rplc_str:string) o stringat:long(str:string,pos:long) o strlen:long(str:string) o strtol:long(str:string,base:long) o substr:string(str:string,start:long,length:long) o user_long:long(addr:long) o user_string:string(addr:long) VIZ TEZ stap(1) CHYBY Pouzijte projektovou bugzillu, nebo mailing list. http://sourceware.org/systemtap/, . error::reporting(7stap), https://sourceware.org/systemtap/wiki/HowToReportBugs STAPREF(1)