Object Introspection (OI) enables on-demand, hierarchical profiling of objects in arbitrary C/C++ programs with no recompilation.
Go to file
2024-08-15 16:10:12 +01:00
.circleci nix: add building oid to the flake 2024-08-15 16:02:26 +01:00
.github support and test LLVM versions 16 and 17 2024-08-15 16:10:12 +01:00
cmake nix: add building oid to the flake 2024-08-15 16:02:26 +01:00
examples clang-format: set BinPackParameters=false 2023-04-24 11:28:22 +02:00
extern nix: update flake lock 2024-08-13 16:11:22 +01:00
include/oi tbv2: remove unnecessary copy in Element (#457) 2024-02-07 07:51:22 -08:00
oi nix: add building oid to the flake 2024-08-15 16:02:26 +01:00
resources Compile Time OIL for OIL v2 2023-08-30 04:28:02 -07:00
test bump python version to 3.9 (#492) 2024-04-16 12:06:47 +01:00
tools nix: add building oid to the flake 2024-08-15 16:02:26 +01:00
types Make folly::Optional TBv2 compliant (#490) 2024-04-15 16:38:49 +01:00
website add cppcon presentation links (#478) 2024-02-06 12:54:59 +00:00
.clang-format clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
.clang-tidy Initial commit 2022-12-19 06:37:51 -08:00
.editorconfig Initial commit 2022-12-19 06:37:51 -08:00
.git-blame-ignore-revs Initial commit 2022-12-19 06:37:51 -08:00
.gitignore Delete old files from test/ 2023-01-27 12:45:35 +00:00
.gitmodules drgn: add split dwarf support 2023-06-02 17:52:53 +02:00
CHANGELOG.md Initial commit 2022-12-19 06:37:51 -08:00
CMakeLists.txt support and test LLVM versions 16 and 17 2024-08-15 16:10:12 +01:00
CODE_OF_CONDUCT.md Initial commit 2022-12-19 06:37:51 -08:00
CONTRIBUTING.md Initial commit 2022-12-19 06:37:51 -08:00
dev.oid.toml Implement new container for F14ValueMap 2023-09-08 16:31:36 +02:00
flake.lock nix: update flake lock 2024-08-13 16:11:22 +01:00
flake.nix support and test LLVM versions 16 and 17 2024-08-15 16:10:12 +01:00
LICENSE Initial commit 2022-12-19 06:37:51 -08:00
oss.oid.toml Initial commit 2022-12-19 06:37:51 -08:00
README.md nix: add building oid to the flake 2024-08-15 16:02:26 +01:00

object-introspection

Matrix Chat CppCon 2023 Presentation

OI Logo

Object Introspection is a memory profiling technology for C++ objects. It provides the ability to dynamically instrument applications to capture the precise memory occupancy of entire object hierarchies including all containers and dynamic allocations. All this with no code modification or recompilation!

For more information on the technology and how to get started applying it to your applications please check out the Object Introspection website.

Join the Object Introspection community

See the CONTRIBUTING file for how to help out.

License

Object Introspection is licensed under the Apache 2.0 License.

Getting started with Nix

Nix is the easiest way to get started with oid as it is non-trivial to build otherwise. Explicit Nix support for Object Introspection as a Library will come down the line, but Nix can currently provide you a reproducible development environment in which to build it.

These examples expect you to have nix installed and available with no other dependencies required. Find the installation guide at https://nixos.org/download.html.

We also required flake support. To enable flakes globally run:

$ mkdir -p ~/.config/nix
$ echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf

Or suffix every nix command with nix --extra-experimental-features 'nix-command flakes'.

Run upstream OID without modifying the source

$ nix run github:facebookexperimental/object-introspection -- --help

This will download the latest source into your Nix store along with all of its dependencies, running help afterwards.

Build OID locally

$ git clone https://github.com/facebookexperimental/object-introspection
$ nix build
$ ./result/bin/oid --help

This will build OID from your local sources. Please note that this will NOT pick up changes to extern/drgn or extern/drgn/libdrgn/velfutils.

Get a development environment

$ nix develop
$ cmake -B build -G Ninja -DFORCE_BOOST_STATIC=Off
$ ninja -C build
$ build/oid --help

This command provides a development shell with all the required dependencies. This is the most flexible option and will pick up source changes as CMake normally would.

Sometimes this developer environment can be polluted by things installed on your normal system. If this is an issue, use:

$ nix develop -i

This removes the environment from your host system and makes the build pure.

Run the tests

$ nix develop
$ cmake -B build -G Ninja -DFORCE_BOOST_STATIC=Off
$ ninja -C build
$ ./tools/config_gen.py -c clang++ build/testing.oid.toml
$ ctest -j --test-dir build/test

Running tests under nix is new to the project and may take some time to mature. The CI is the source of truth for now.

Format source

$ nix fmt

This formats the Nix, C++, and Python code in the repository.