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-04-26 16:02:20 +02:00
|
|
|
if (NOT CMAKE_BUILD_TYPE)
|
|
|
|
set (CMAKE_BUILD_TYPE Debug CACHE STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
|
|
|
endif (NOT CMAKE_BUILD_TYPE)
|
2006-12-23 16:16:30 +01:00
|
|
|
|
2006-12-12 03:37:23 +01:00
|
|
|
find_package(DWARF REQUIRED)
|
|
|
|
|
2007-04-19 23:01:47 +02:00
|
|
|
_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${__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-05-06 19:50:28 +02:00
|
|
|
set(dwarves_emit_LIB_SRCS dwarves_emit.c)
|
|
|
|
add_library(dwarves_emit SHARED ${dwarves_emit_LIB_SRCS})
|
|
|
|
set_target_properties(dwarves_emit PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
|
|
|
target_link_libraries(dwarves_emit ${DWARF_LIBRARIES} dwarves)
|
|
|
|
|
2007-05-07 05:30:02 +02:00
|
|
|
set(dwarves_reorganize_LIB_SRCS dwarves_reorganize.c)
|
|
|
|
add_library(dwarves_reorganize SHARED ${dwarves_reorganize_LIB_SRCS})
|
|
|
|
set_target_properties(dwarves_reorganize PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
|
|
|
target_link_libraries(dwarves_reorganize ${DWARF_LIBRARIES} dwarves)
|
|
|
|
|
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-05-07 05:30:02 +02:00
|
|
|
target_link_libraries(ctracer dwarves dwarves_emit dwarves_reorganize)
|
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-05-07 05:30:02 +02:00
|
|
|
target_link_libraries(pahole dwarves dwarves_reorganize)
|
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-04-19 23:01:47 +02:00
|
|
|
pfunct pglobal prefcnt RUNTIME DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/bin)
|
2007-02-25 20:43:59 +01:00
|
|
|
install(TARGETS dwarves LIBRARY DESTINATION ${LIB_INSTALL_DIR})
|
2007-05-07 05:30:02 +02:00
|
|
|
install(TARGETS dwarves dwarves_emit dwarves_reorganize LIBRARY DESTINATION ${LIB_INSTALL_DIR})
|
|
|
|
install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
|
2007-04-19 23:01:47 +02:00
|
|
|
install(FILES ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
2007-02-25 20:43:59 +01:00
|
|
|
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)
|