/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Analysis/instrumentation/systap/examples/socket_trace.stp

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-21 03:52:00 UTC
  • Revision ID: csa@suren.me-20150821035200-xu1zh22cqlk2omcq
Profiling

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env stap
 
2
 
 
3
global sizes;
 
4
 
 
5
probe kernel.function("*@net/socket.c").call {
 
6
    if (@defined($size)) {
 
7
        sizes <<< $size
 
8
        printf("%s -> %s (%u bytes)\n", thread_indent(1), ppfunc(), $size);
 
9
    }
 
10
}
 
11
 
 
12
probe kernel.function("*@net/socket.c").return {
 
13
    if (@defined($size)) {
 
14
        printf("%s <- %s\n", thread_indent(-1), ppfunc());
 
15
    }
 
16
}
 
17
 
 
18
probe timer.ms(1000) {
 
19
    if (@count(sizes) > 0) {
 
20
        print (@hist_linear(sizes, 0, 65536, 4096))
 
21
        delete sizes
 
22
    }
 
23
}