Implemented project structure
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
BEGIN
|
||||
{
|
||||
printf("probe: success\n");
|
||||
exit(0);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
probe begin
|
||||
{
|
||||
println("probe: success")
|
||||
exit ()
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
self int indent;
|
||||
|
||||
python$target:::function-entry
|
||||
/copyinstr(arg1) == "start"/
|
||||
{
|
||||
self->trace = 1;
|
||||
}
|
||||
|
||||
python$target:::function-entry
|
||||
/self->trace/
|
||||
{
|
||||
printf("%d\t%*s:", timestamp, 15, probename);
|
||||
printf("%*s", self->indent, "");
|
||||
printf("%s:%s:%d\n", basename(copyinstr(arg0)), copyinstr(arg1), arg2);
|
||||
self->indent++;
|
||||
}
|
||||
|
||||
python$target:::function-return
|
||||
/self->trace/
|
||||
{
|
||||
self->indent--;
|
||||
printf("%d\t%*s:", timestamp, 15, probename);
|
||||
printf("%*s", self->indent, "");
|
||||
printf("%s:%s:%d\n", basename(copyinstr(arg0)), copyinstr(arg1), arg2);
|
||||
}
|
||||
|
||||
python$target:::function-return
|
||||
/copyinstr(arg1) == "start"/
|
||||
{
|
||||
self->trace = 0;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
function-entry:call_stack.py:start:23
|
||||
function-entry: call_stack.py:function_1:1
|
||||
function-entry: call_stack.py:function_3:9
|
||||
function-return: call_stack.py:function_3:10
|
||||
function-return: call_stack.py:function_1:2
|
||||
function-entry: call_stack.py:function_2:5
|
||||
function-entry: call_stack.py:function_1:1
|
||||
function-entry: call_stack.py:function_3:9
|
||||
function-return: call_stack.py:function_3:10
|
||||
function-return: call_stack.py:function_1:2
|
||||
function-return: call_stack.py:function_2:6
|
||||
function-entry: call_stack.py:function_3:9
|
||||
function-return: call_stack.py:function_3:10
|
||||
function-entry: call_stack.py:function_4:13
|
||||
function-return: call_stack.py:function_4:14
|
||||
function-entry: call_stack.py:function_5:18
|
||||
function-return: call_stack.py:function_5:21
|
||||
function-return:call_stack.py:start:28
|
||||
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
global tracing
|
||||
|
||||
function basename:string(path:string)
|
||||
{
|
||||
last_token = token = tokenize(path, "/");
|
||||
while (token != "") {
|
||||
last_token = token;
|
||||
token = tokenize("", "/");
|
||||
}
|
||||
return last_token;
|
||||
}
|
||||
|
||||
probe process.mark("function__entry")
|
||||
{
|
||||
funcname = user_string($arg2);
|
||||
|
||||
if (funcname == "start") {
|
||||
tracing = 1;
|
||||
}
|
||||
}
|
||||
|
||||
probe process.mark("function__entry"), process.mark("function__return")
|
||||
{
|
||||
filename = user_string($arg1);
|
||||
funcname = user_string($arg2);
|
||||
lineno = $arg3;
|
||||
|
||||
if (tracing) {
|
||||
printf("%d\t%s:%s:%s:%d\n", gettimeofday_us(), $$name,
|
||||
basename(filename), funcname, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
probe process.mark("function__return")
|
||||
{
|
||||
funcname = user_string($arg2);
|
||||
|
||||
if (funcname == "start") {
|
||||
tracing = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
function__entry:call_stack.py:start:23
|
||||
function__entry:call_stack.py:function_1:1
|
||||
function__return:call_stack.py:function_1:2
|
||||
function__entry:call_stack.py:function_2:5
|
||||
function__entry:call_stack.py:function_1:1
|
||||
function__return:call_stack.py:function_1:2
|
||||
function__return:call_stack.py:function_2:6
|
||||
function__entry:call_stack.py:function_3:9
|
||||
function__return:call_stack.py:function_3:10
|
||||
function__entry:call_stack.py:function_4:13
|
||||
function__return:call_stack.py:function_4:14
|
||||
function__entry:call_stack.py:function_5:18
|
||||
function__return:call_stack.py:function_5:21
|
||||
function__return:call_stack.py:start:28
|
||||
@@ -0,0 +1,18 @@
|
||||
python$target:::function-entry
|
||||
/copyinstr(arg1) == "start"/
|
||||
{
|
||||
self->trace = 1;
|
||||
}
|
||||
|
||||
python$target:::gc-start,
|
||||
python$target:::gc-done
|
||||
/self->trace/
|
||||
{
|
||||
printf("%d\t%s:%ld\n", timestamp, probename, arg0);
|
||||
}
|
||||
|
||||
python$target:::function-return
|
||||
/copyinstr(arg1) == "start"/
|
||||
{
|
||||
self->trace = 0;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
gc-start:0
|
||||
gc-done:0
|
||||
gc-start:1
|
||||
gc-done:0
|
||||
gc-start:2
|
||||
gc-done:0
|
||||
gc-start:2
|
||||
gc-done:1
|
||||
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
global tracing
|
||||
|
||||
probe process.mark("function__entry")
|
||||
{
|
||||
funcname = user_string($arg2);
|
||||
|
||||
if (funcname == "start") {
|
||||
tracing = 1;
|
||||
}
|
||||
}
|
||||
|
||||
probe process.mark("gc__start"), process.mark("gc__done")
|
||||
{
|
||||
if (tracing) {
|
||||
printf("%d\t%s:%ld\n", gettimeofday_us(), $$name, $arg1);
|
||||
}
|
||||
}
|
||||
|
||||
probe process.mark("function__return")
|
||||
{
|
||||
funcname = user_string($arg2);
|
||||
|
||||
if (funcname == "start") {
|
||||
tracing = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
gc__start:0
|
||||
gc__done:0
|
||||
gc__start:1
|
||||
gc__done:0
|
||||
gc__start:2
|
||||
gc__done:0
|
||||
gc__start:2
|
||||
gc__done:1
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
python$target:::line
|
||||
/(copyinstr(arg1)=="test_line")/
|
||||
{
|
||||
printf("%d\t%s:%s:%s:%d\n", timestamp,
|
||||
probename, basename(copyinstr(arg0)),
|
||||
copyinstr(arg1), arg2);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
line:line.py:test_line:2
|
||||
line:line.py:test_line:3
|
||||
line:line.py:test_line:4
|
||||
line:line.py:test_line:5
|
||||
line:line.py:test_line:6
|
||||
line:line.py:test_line:7
|
||||
line:line.py:test_line:8
|
||||
line:line.py:test_line:9
|
||||
line:line.py:test_line:10
|
||||
line:line.py:test_line:11
|
||||
line:line.py:test_line:4
|
||||
line:line.py:test_line:5
|
||||
line:line.py:test_line:6
|
||||
line:line.py:test_line:7
|
||||
line:line.py:test_line:8
|
||||
line:line.py:test_line:10
|
||||
line:line.py:test_line:11
|
||||
line:line.py:test_line:4
|
||||
line:line.py:test_line:12
|
||||
line:line.py:test_line:13
|
||||
Binary file not shown.
Reference in New Issue
Block a user