Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 8e87fca2f49595adc16d9aa519a6edad > files > 35

systemtap-1.6-1.fc14.x86_64.rpm

#!/usr/bin/stap

# Usage:   sizeof.stp TYPENAME
#          sizeof.stp TYPENAME kernelmodule
#          sizeof.stp TYPENAME /usr/bin/executable
#          sizeof.stp TYPENAME kernel:<include/linux/someheader.h>
#          sizeof.stp TYPENAME </usr/include/someheader.h>

probe begin {
  println("type ", @1, 
          %( $# > 1 %? " in ", @2, %)   /* module or header file name */
          " byte-size: ",
          & @cast(0,
                  @1 /* type name */
                  %( $# > 1 %? , @2 %)  )  /* module or header file name */
                 [1])
  exit ()
}