Skip to content

Instantly share code, notes, and snippets.

View call_graph.stp
function trace(entry_p, extra) {
%( $# > 1 %? if (tid() in trace) %)
printf("%s%s%s %s\n",
thread_indent (entry_p),
(entry_p>0?"->":"<-"),
ppfunc (),
extra)
}
//probe module("nfs").function("*").call { trace(1, $$parms) }
//probe module("nfs").function("*").return { trace(-1, $$return) }
View profile_time.stp
global total_time, entry_time
probe begin {
printf("================================================ Syslog Monitoring Started\n")
}
#probe module("nfs").function("*")
#{
# entry_time[pid(), tid()] = gettimeofday_us()
#}
#probe module("nfs").function("*").return
View profile_count.stp
global syscalllist
probe begin {
printf("================================================ Syslog Monitoring Started\n")
}
probe module("nfs").function("*").return
{
syscalllist[execname(), pid(), probefunc()]++
}
probe module("ext4").function("*").return
View callgraph
// vboxsfの結果
0 fio(21210):->sf_file_read iocb=0xffff880006803eb0 iov=0xffff880006803e88
1 fio(21210): ->sf_inode_revalidate dentry=0xffff88000a74aa98
2 fio(21210): <-sf_inode_revalidate return=0x0
4 fio(21210): ->generic_file_read_iter iocb=0xffff880006803eb0 iter=0xffff880006803e88
6 fio(21210): ->page_cache_sync_readahead mapping=0xffff88000a749398 ra=0xffff8800069f0aa0 filp=0xffff8800069f0a00 offset=0xfc req_size=0x4
8 fio(21210): <-page_cache_sync_readahead
10 fio(21210): ->sf_readpage file=0xffff8800069f0a00 page=0xffffea00005d86d8
12 fio(21210): ->vboxCallRead pClient=0xffffffffa03cfa80 pMap=0xffff88001d057400 hFile=0x1fe offset=0xfc000 pcbBuffer=0xffff880006803d9c pBuffer=0xffff88001ab8d000 fLocked=0x0
View vboxsf_callgraph
0 fio(21210):->sf_file_read iocb=0xffff880006803eb0 iov=0xffff880006803e88
1 fio(21210): ->sf_inode_revalidate dentry=0xffff88000a74aa98
2 fio(21210): <-sf_inode_revalidate return=0x0
4 fio(21210): ->generic_file_read_iter iocb=0xffff880006803eb0 iter=0xffff880006803e88
6 fio(21210): ->page_cache_sync_readahead mapping=0xffff88000a749398 ra=0xffff8800069f0aa0 filp=0xffff8800069f0a00 offset=0xfc req_size=0x4
8 fio(21210): <-page_cache_sync_readahead
10 fio(21210): ->sf_readpage file=0xffff8800069f0a00 page=0xffffea00005d86d8
12 fio(21210): ->vboxCallRead pClient=0xffffffffa03cfa80 pMap=0xffff88001d057400 hFile=0x1fe offset=0xfc000 pcbBuffer=0xffff880006803d9c pBuffer=0xffff88001ab8d000 fLocked=0x0
14 fio(21210): ->VbglHGCMCall handle=0xffffffffa03cfcb0 pData=0xffff880006803d10 cbData=0x60
17 fio(21210): ->vbglDriverIOCtl pDriver=0xffffffffa03cfcb4 u32Function=0xc0605692 pvData=0xffff880006803d10 cbData=0x60
View ext4_callgraph
0 fio(21152):->generic_file_read_iter iocb=0xffff8800182abeb0 iter=0xffff8800182abe88
5 fio(21152): ->page_cache_async_readahead mapping=0xffff880006fb29e8 ra=0xffff88001a649fa0 filp=0xffff88001a649f00 page=0xffffea00006f0828 offset=0xb8 req_size=0x4
9 fio(21152): ->ondemand_readahead mapping=0xffff880006fb29e8 ra=0xffff88001a649fa0 filp=0xffff88001a649f00 hit_readahead_marker=0x1 offset=0xb8 req_size=0x4
14 fio(21152): ->__do_page_cache_readahead mapping=0xffff880006fb29e8 filp=0xffff88001a649f00 offset=0xf8 nr_to_read=0x40 lookahead_size=0x40
36 fio(21152): ->ext4_readpages
39 fio(21152): ->ext4_has_inline_data
41 fio(21152): <-ext4_has_inline_data
44 fio(21152): ->ext4_get_block
46 fio(21152): ->_ext4_get_block
48 fio(21152): ->ext4_has_inline_data
View git-complete.bash
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
View call_graph.stp
function trace(entry_p, extra) {
%( $# > 1 %? if (tid() in trace) %)
printf("%s%s%s %s\n",
thread_indent (entry_p),
(entry_p>0?"->":"<-"),
ppfunc (),
extra)
}
//probe module("nfs").function("*").call { trace(1, $$parms) }
//probe module("nfs").function("*").return { trace(-1, $$return) }
View syslog_profile.stp
global syscalllist
probe begin {
printf("================================================ Syslog Monitoring Started\n")
}
probe module("nfs").function("*").return
{
syscalllist[execname(), pid(), probefunc()]++
}
probe module("ext4").function("*").return
You can’t perform that action at this time.