PageRenderTime 15ms CodeModel.GetById 2ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/support/debugging/macfuse_u_fuse_fs.d

http://macfuse.googlecode.com/
D | 67 lines | 54 code | 13 blank | 0 comment | 4 complexity | 1602b5cc02fbb6e9c11999f52a2f13f5 MD5 | raw file
 1#! /usr/sbin/dtrace -s
 2
 3#pragma D option quiet
 4
 5BEGIN
 6{
 7    begints = timestamp;
 8}
 9
10pid$1:libfuse*dylib:fuse_fs_init:entry,
11pid$1:libfuse*dylib:fuse_fs_destroy:entry
12{
13    self->begints = timestamp;
14    self->init_destroy = 1;
15}
16
17pid$1:libfuse*dylib:fuse_fs_init:return,
18pid$1:libfuse*dylib:fuse_fs_destroy:return
19/ self->init_destroy /
20{
21    this->elapsed = timestamp - self->begints;
22
23    printf("+%-12d %3d.%03d %-8d%-16s\n", (timestamp - begints) / 1000,
24           this->elapsed / 1000000, (this->elapsed / 1000) % 1000,
25           (int)arg1, probefunc + 8);
26
27    self->begints = 0;
28    self->init_destroy = 0;
29}
30
31pid$1:libfuse*dylib:fuse_fs*:entry
32/ !self->init_destroy /
33{
34    self->traceme = 1;
35    self->pathptr = arg1;
36    self->begints = timestamp;
37    self->arg2 = arg2;
38}
39
40pid$1:libfuse*dylib:fuse_fs*:return
41/ self->traceme && probefunc != "fuse_fs_getattr" /
42{
43    this->elapsed = timestamp - self->begints;
44
45    printf("+%-12d %3d.%03d %-8d%-16s%s\n", (timestamp - begints) / 1000,
46           this->elapsed / 1000000, (this->elapsed / 1000) % 1000,
47           (int)arg1, probefunc + 8, copyinstr(self->pathptr));
48
49    self->traceme = 0;
50    self->pathptr = 0;
51    self->begints = 0;
52}
53
54pid$1:libfuse*dylib:fuse_fs*:return
55/ self->traceme && probefunc == "fuse_fs_getattr" /
56{
57    this->elapsed = timestamp - self->begints;
58    this->st = (struct stat *)copyin(self->arg2, sizeof(struct stat));
59
60    printf("+%-12d %3d.%03d %-8d%-16s%s (st_size=%lld)\n", (timestamp - begints) / 1000,
61           this->elapsed / 1000000, (this->elapsed / 1000) % 1000,
62           (int)arg1, probefunc + 8, copyinstr(self->pathptr), this->st->st_size);
63
64    self->traceme = 0;
65    self->pathptr = 0;
66    self->begints = 0;
67}