-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnginx.d
executable file
·61 lines (52 loc) · 1.92 KB
/
nginx.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/sbin/dtrace -s
#pragma D option quiet
#pragma D option switchrate=10hz
#pragma D option dynvarsize=16m
#pragma D option bufsize=8m
BEGIN {
printf("[\n");
comma=" ";
}
END {
printf("]\n");
}
pid$target:nginx::entry
{
printf("%s {\"event\": \"%s:%s:%s:%s\", \"time\": %d, \"pid\": %d, \"tid\": %d, \"uid\": %d, \"exec\": \"%s\"}\n",
comma, probeprov, probemod, probefunc, probename, walltimestamp, pid, tid, uid, execname);
comma=",";
}
pid$target:nginx::return
{
printf("%s {\"event\": \"%s:%s:%s:%s\", \"time\": %d, \"pid\": %d, \"tid\": %d, \"uid\": %d, \"exec\": \"%s\"}\n",
comma, probeprov, probemod, probefunc, probename, walltimestamp, pid, tid, uid, execname);
comma=",";
}
/* Ugly hack to get HTTP request. Clean up when we have CTF */
pid$target::*ngx_http_process_request:entry
{
this->request_len = *(int *)copyin(arg0+816, sizeof(int));
this->request_ptr = *(uintptr_t *)copyin(arg0+824, sizeof(uintptr_t));
this->request = stringof(copyin(this->request_ptr, this->request_len));
printf("%s {\"event\": \"%s:%s:%s:%s\", \"time\": %d, \"pid\": %d, \"tid\": %d, \"uid\": %d, \"exec\": \"%s\", \"request\": \"%s\"}\n",
comma, probeprov, probemod, probefunc, probename, walltimestamp, pid, tid, uid, execname, this->request);
comma=",";
}
/*
pid$target:nginx:main:entry
{
printf("%s {\"event\": \"%s:%s:%s:%s\", \"time\": %d, \"pid\": %d, \"tid\": %d, \"uid\": %d, \"exec\": \"%s\", \"args\": \"%s\"}\n",
comma, probeprov, probemod, probefunc, probename, walltimestamp, pid, tid, uid, execname, "WIP");
comma=",";
}
pid$target:nginx:ngx_signal_process:entry
{
printf("%s {\"event\": \"%s:%s:%s:%s\", \"time\": %d, \"pid\": %d, \"tid\": %d, \"uid\": %d, \"exec\": \"%s\", \"args\": \"%s\"}\n",
comma, probeprov, probemod, probefunc, probename, walltimestamp, pid, tid, uid, execname, copyinstr(arg1));
comma=",";
}
pid$target::main:entry
{
printf("arg1: %s", copyinstr(arg1));
}
*/