2006-12-12 03:37:23 +01:00
|
|
|
project(pahole)
|
|
|
|
|
2007-01-30 22:07:28 +01:00
|
|
|
# Try to parse this later, Helio just showed me a KDE4 example to support
|
|
|
|
# x86-64 builds.
|
|
|
|
# the following are directories where stuff will be installed to
|
|
|
|
set(__LIB "" CACHE STRING "Define suffix of directory name (32/64)" )
|
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
macro(_set_fancy _var _value _comment)
|
2007-01-30 22:07:28 +01:00
|
|
|
if (NOT DEFINED ${_var})
|
|
|
|
set(${_var} ${_value})
|
|
|
|
else (NOT DEFINED ${_var})
|
|
|
|
set(${_var} "${${_var}}" CACHE PATH "${_comment}")
|
|
|
|
endif (NOT DEFINED ${_var})
|
2007-02-25 20:43:59 +01:00
|
|
|
endmacro(_set_fancy)
|
2007-01-30 22:07:28 +01:00
|
|
|
|
2006-12-12 03:37:23 +01:00
|
|
|
# where to look first for cmake modules,
|
|
|
|
# before ${CMAKE_ROOT}/Modules/ is checked
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(CMAKE_BUILD_TYPE debug)
|
2006-12-23 16:16:30 +01:00
|
|
|
|
2006-12-12 03:37:23 +01:00
|
|
|
find_package(DWARF REQUIRED)
|
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/usr/${__LIB}" "libdir")
|
2007-01-30 22:07:28 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(dwarves_LIB_SRCS dwarves.c)
|
|
|
|
add_library(dwarves SHARED ${dwarves_LIB_SRCS})
|
|
|
|
set_target_properties(dwarves PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(dwarves ${DWARF_LIBRARIES})
|
2006-12-12 03:37:23 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(codiff_SRCS codiff.c)
|
|
|
|
add_executable(codiff ${codiff_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(codiff dwarves)
|
2006-12-12 03:37:23 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(ctracer_SRCS ctracer.c)
|
|
|
|
add_executable(ctracer ${ctracer_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(ctracer dwarves)
|
2006-12-20 15:16:16 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(dtagnames_SRCS dtagnames.c)
|
|
|
|
add_executable(dtagnames ${dtagnames_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(dtagnames dwarves)
|
2006-12-28 17:03:42 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(pahole_SRCS pahole.c)
|
|
|
|
add_executable(pahole ${pahole_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(pahole dwarves)
|
2006-12-12 03:37:23 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(pdwtags_SRCS pdwtags.c)
|
|
|
|
add_executable(pdwtags ${pdwtags_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(pdwtags dwarves)
|
2007-01-19 00:13:56 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(pglobal_SRCS pglobal.c)
|
|
|
|
add_executable(pglobal ${pglobal_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(pglobal dwarves)
|
2007-02-02 14:56:53 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(pfunct_SRCS pfunct.c )
|
|
|
|
add_executable(pfunct ${pfunct_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(pfunct dwarves)
|
2006-12-12 03:37:23 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
set(prefcnt_SRCS prefcnt.c)
|
|
|
|
add_executable(prefcnt ${prefcnt_SRCS})
|
2007-03-28 15:18:57 +02:00
|
|
|
target_link_libraries(prefcnt dwarves)
|
2007-01-11 19:41:54 +01:00
|
|
|
|
2007-02-25 20:43:59 +01:00
|
|
|
install(TARGETS codiff ctracer dtagnames pahole pdwtags
|
2007-02-02 15:30:56 +01:00
|
|
|
pfunct pglobal prefcnt RUNTIME DESTINATION /usr/bin)
|
2007-02-25 20:43:59 +01:00
|
|
|
install(TARGETS dwarves LIBRARY DESTINATION ${LIB_INSTALL_DIR})
|
|
|
|
install(FILES dwarves.h DESTINATION /usr/include)
|
|
|
|
install(FILES ostra/ostra-cg DESTINATION /usr/bin)
|
|
|
|
install(FILES ostra/python/ostra.py DESTINATION ${LIB_INSTALL_DIR}/ctracer/python)
|
|
|
|
install(FILES lib/Makefile lib/ctracer_jprobe.c
|
[CTRACER]: Lots of improvements
1. We now use relayfs
2. ostra-cg is shipped and used in the Makefile
3. README.ctracer has all the details
I followed README.ctracer and the result, in my workstation, was this one:
http://oops.ghostprotocols.net:81/acme/dwarves/callgraphs/acme_eating_his_dog_food/6.html
I've started on the 6th page as it is more interesting, having tcp and netlink
callchains, don't be disappointed by some pages having just one level of
nesting, that is just the lack of containers and aliases (to follow tcp_sock,
skb->sk, etc) from the OSTRA days, but it's getting there! :-)
Ah, it is collecting all the base types in the specified struct by doing a
struct "view", i.e. trimming the struct to have just members that are
"reducible" to basic types (int, long, char, signed and unsigned), then
reorganizing it with the code introduced in pahole --reorganize to get it to
the best layout possible, reducing the size of the entry probe points trace
entries.
Updated rpms are available at the usual place:
http://oops.ghostprotocols.net:81/acme/dwarves/rpm/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-02-02 18:15:27 +01:00
|
|
|
lib/ctracer_relay.c lib/ctracer_relay.h
|
|
|
|
DESTINATION ${LIB_INSTALL_DIR}/ctracer)
|