Systemtap: learning notes

Posted sansna

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Systemtap: learning notes相关的知识,希望对你有一定的参考价值。

Before using stap, the kernel-debuginfo-$(uname -r), kernel-debuginfo-common-$(uname -m)-$(uname -r) and kernel-devel-$(uname -r) should be installed. (CentOS)

stap-prep is a shortcut, but in the end, the above 3 packages should present.

verbose manpage over stap: man stapprobes

Another doc of stap will be included as file  of this blog.

Normal usage of stap file: (its format is loose)

#!/bin/stap
global cntread, cntwrite, cntother

probe kernel.function("vfs_read"), kernel.function("vfs_write"), kernel.function(@1)
{
        if (probefunc() == "vfs_read")
                cntread++;
        else if (probefunc() == "vfs_write")
                cntwrite++;
        else
                cntother++;
}

probe timer.s(5){
        exit();
}

probe end {
        printf("Read: %d
Write: %d
Other: %d
", cntread, cntwrite, cntother);
}

Run by: stap stap.stp -v/-vvv -- vfs_open (Note: vfs_open as first argument passed to stp script which replaces @1)

 

以上是关于Systemtap: learning notes的主要内容,如果未能解决你的问题,请参考以下文章

OSCP Learning Notes - Enumeration

Notes of Reinforcement Learning

Note for Coursera《Machine Learning》1 | What is machine learning?

PHP: Learning Notes

OSCP Learning Notes - Netcat

OSCP Learning Notes - Overview