亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1144 | 回復(fù): 0
打印 上一主題 下一主題

Systemtap usage [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2007-09-03 09:53 |只看該作者 |倒序瀏覽

       
       
       
       
       
       
       
       
        bibliography:
http://www.ibm.com/developerworks/cn/linux/l-systemtap/
man
stap(1)
man
stapprobes(5)
man
stapex(5)
less
/usr/share/doc/systemtap-0.5.13/*
probe
syntax:
        probe
PROBEPOINT [, PROBEPOINT] { [STMT ...] }
The
probe  handler  is  interpreted relative to the context of each
event. For events associated with kernel code, this context may
include variables defined in the source code at that spot.  These
[color="#ff0000"]"target variables"  are
presented  to  the script as variables whose names are prefixed with
[color="#ff0000"]"$".
[color="#ff0000"]Important:
        most
of the local variables are optimized and omitted. So be aware of the
variables exported by “nm ”
probe
point:
begin/end:
        begin:
when session starting.
        End:
when session ending, i.e. After calling exit().
Never:
        never
insert probe point, just check to see if error.
Timers:
        timer.jiffies(N)
        timer.jiffies(N).randomize(M)
        timer.ms(N)                //
millisecond
        timer.ms(N).randomize(M)
dwarf:
        kernel.function(PATTERN)
        kernel.function(PATTERN).return
        kernel.inline(PATTERN)
        module(MPATTERN).function(PATTERN)
        module(MPATTERN).function(PATTERN).return
        module(MPATTERN).inline(PATTERN)
        kernel.statement(PATTERN)
        kernel.statement(ADDRESS).absolute
        module(MPATTERN).statement(PATTERN)
        notation:
                MPATTERN:
module pattern (without “.ko”)
                PATTERN:
func[@pathname[:line num]]
                statement:
a point to relative or absolute address
markers:
        unknown
yet.
[color="#ff0000"]STATISTICS:
  • define
            varible as global
           
  • use
            “
           
  • invoke
            functions defined by systemtap to fetch statistics, i.e.  @count(v),
            @sum(v), @min(v), @max(v), @avg(v)
    [color="#ff0000"]expressions:
    %(
    CONDITION %? TRUE_VALUE %: FALSE_VALUE %)
    #
    eg. Attention $arch
    %(
    [color="#ff0000"]arch == "ia64" %? probe
    syscall.vliw = kernel.function("vliw_widget") {} %)
    #
    else, we could use kernel_vr or kernel_r to express like “2.6.18”
    some
    examples:
    #!/usr/bin/stap
    #
    Usage: stap   
    #
    when invoking arguments for filename, @1 is expressed as strings, $2
    is expressed as integer
    probe
    syscall.read
    {
          printf("fd = %d\n",fd)
            printf("strings:
    %s\n", @1)
            printf("integer:
    %d\n", $2)
    }
    probe
    syscall.read.return
    {
    exit() }
    #!/usr/bin/stap
    #
    To aggregate statistics
    global
    x
    probe
    foo
    {
            x
    }
    probe
    stat
    {
            printf(“sum
    is: %d”, @sum(x))
            exit()
    }
    #!/usr/bin/stap
    #
    note: we could get parameters to function before calling the function
    probe
    module("cdrom").function("cdrom_open")
    {
            printf("before
    running\n")
    [color="#800000"]      
    printf("give me local
    variable ret: %d\n", $cdi->speed)
    }
    probe
    module("cdrom").statement("cdrom_open@drivers/cdrom/cdrom.c:997")
    {
            printf("into
    func\n")
    }
    probe
    module("cdrom").function("cdrom_open").return
    {
            printf("after
    running\n")
            exit()
    }
                   
                   
                   

    本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/7356/showart_373121.html
  • 您需要登錄后才可以回帖 登錄 | 注冊

    本版積分規(guī)則 發(fā)表回復(fù)

      

    北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年舉報專區(qū)
    中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
    感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP