object-introspection/oi/CMakeLists.txt
Jake Hillion 71e734b120 tbv2: calculate total memory footprint
Add the option to calculate total size (inclusive size) by wrapping the
existing iterator. This change provides a new iterator, `SizedIterator`, which
wraps an existing iterator and adds a new field `size` to the output element.

This is achieved with a two pass algorithm on the existing iterator:
1. Gather metadata for each element. This includes the total size up until that
   element and the range of elements that should be included in the size.
2. Return the result from the underlying iterator with the additional
   field.

This algorithm is `O(N)` time on the number of elements in the iterator and
`O(N)` time, storing 16 bytes per element. This isn't super expensive but is a
lot more than the current algorithm which requires close to constant space.
Because of this I've implemented it as a wrapper on the iterator rather than on
by default, though it is now on in every one of our integration test cases.

Test plan:
- Added to the integration tests for full coverage.
2024-01-04 09:21:35 +00:00

63 lines
1.0 KiB
CMake

add_library(toml
support/Toml.cpp
)
target_link_libraries(toml PUBLIC tomlplusplus::tomlplusplus)
add_library(drgn_utils DrgnUtils.cpp)
target_link_libraries(drgn_utils
glog::glog
"-L${DRGN_PATH}/.libs"
drgn
)
add_dependencies(drgn_utils libdrgn)
add_library(symbol_service
Descs.cpp
SymbolService.cpp
)
target_link_libraries(symbol_service
drgn_utils
Boost::headers
${Boost_LIBRARIES}
glog::glog
dw
)
add_library(features Features.cpp)
target_link_libraries(features glog::glog)
add_library(container_info
ContainerInfo.cpp
)
target_link_libraries(container_info
features
glog::glog
toml
)
add_library(codegen
CodeGen.cpp
FuncGen.cpp
OICodeGen.cpp
)
target_link_libraries(codegen
container_info
resources
symbol_service
type_graph
Boost::headers
${Boost_LIBRARIES}
folly_headers
glog::glog
)
add_library(exporters_csv exporters/CSV.cpp)
target_include_directories(exporters_csv PUBLIC ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(exporters_csv oil)
add_subdirectory(type_graph)