===========================
What is systemtap?
Ans : Scripting tool to debug and monitor the whole system processes or any events.
How to install it on linux machine ?
Ans :
yum install kernel-devel
yum install kernel-debuginfo
yum install systemtap
Tool to do the job :
Ans : stap
Syntax to use it :
-------------
probe {handler}
Where event is kernel.function, process.statement, timer.ms, begin, end etc
and handler can be filtering/control statement and
helper function : log, printf, pid etc
-------------
Example :
[root@vm80 systamexample]# cat hellworld.stp
probe begin
{
print("This is hello world\n")
exit()
}
[root@vm80 systamexample]
Execution :
[root@vm80 systamexample]# stap hellworld.stp
This is hello world
[root@vm80 systamexample]#
[root@vm80 systamexample]# cat primecheck.stp
function isprime (x) {
if (x < 2) return 0
for (i = 2; i < x; i++) {
if (x % i == 0) return 0
if (i * i > x) break
}
return 1
}
probe begin {
for (i = 0; i < 50; i++)
if (isprime (i)) printf("%d\n", i)
exit()
}
stap-authorize-signing-cert stap-report
[root@vm80 systamexample]# stap primecheck.stp
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
[root@vm80 systamexample]#
==============================
By : blog.snapshotit.com

Responses
0 Respones to "Flow diagram of systemtap debugging scripting tool?"
Post a Comment
»Thank you for reading this article
If you have questions or comments, please leave a comment
»You can click on the Subscribe by email to subscribe comments of this post
»You can register directly link pictures, mp3, video on the comment form.
»You may use some HTML tags such
»Please post comments polite and typing accented Vietnamese if possible
»Thank the good faith comment