Snap for 11510257 from eb4bb7c513362eea24833fd9989ef6b7c6dccd98 to simpleperf-release

Change-Id: I797e552e747b1f1708d278793755eddcb245950d
tree: 816a39318cf25a492bac3026fab8d5ad5d2a9ea5
  1. cmake/
  2. doc/
  3. fuzz/
  4. test_cases/
  5. testdata/
  6. abigail_reader.cc
  7. abigail_reader.h
  8. abigail_reader_test.cc
  9. Android.bp
  10. btf_reader.cc
  11. btf_reader.h
  12. catch.cc
  13. CMakeLists.txt
  14. comparison.cc
  15. comparison.h
  16. CONTRIBUTING.md
  17. deduplication.cc
  18. deduplication.h
  19. Dockerfile
  20. dwarf_processor.cc
  21. dwarf_processor.h
  22. dwarf_wrappers.cc
  23. dwarf_wrappers.h
  24. elf_loader.cc
  25. elf_loader.h
  26. elf_reader.cc
  27. elf_reader.h
  28. elf_reader_test.cc
  29. equality.h
  30. equality_cache.h
  31. error.h
  32. error_test.cc
  33. fidelity.cc
  34. fidelity.h
  35. file_descriptor.cc
  36. file_descriptor.h
  37. file_descriptor_test.cc
  38. filter.cc
  39. filter.h
  40. filter_test.cc
  41. fingerprint.cc
  42. fingerprint.h
  43. graph.cc
  44. graph.h
  45. hashing.h
  46. input.cc
  47. input.h
  48. LICENSE
  49. METADATA
  50. MODULE_LICENSE_LLVM
  51. naming.cc
  52. naming.h
  53. order.h
  54. order_test.cc
  55. OWNERS
  56. post_processing.cc
  57. post_processing.h
  58. proto_reader.cc
  59. proto_reader.h
  60. proto_writer.cc
  61. proto_writer.h
  62. reader_options.h
  63. README.md
  64. reporting.cc
  65. reporting.h
  66. reporting_test.cc
  67. runtime.cc
  68. runtime.h
  69. runtime_test.cc
  70. scc.h
  71. scc_test.cc
  72. scope.h
  73. stable_hash.cc
  74. stable_hash.h
  75. stg.cc
  76. stg.proto
  77. stgdiff.cc
  78. stgdiff_test.cc
  79. substitution.h
  80. type_normalisation.cc
  81. type_normalisation.h
  82. type_resolution.cc
  83. type_resolution.h
  84. unification.cc
  85. unification.h
README.md

Symbol-Type Graph (STG)

The STG (symbol-type graph) is an ABI representation and this project contains tools for the creation and comparison of such representations.

The ABI extraction tool, stg, emits a native ABI format. Parsers exist for libabigail's XML format, BTF and ELF / DWARF.

The ABI diff tool, stgdiff, supports multiple reporting options.

STG has a versioned native file format. Older formats can be read and rewritten as the latest.

NOTE: STG is under active developement. Tool arguments and behaviour are subject to change.

Getting STG

Distributions

We intend to package STG for major distributions. Currently we have packages as follows:

DistributionPackage
Arch Linux (AUR)stg-git

Source Code

This source code is available at https://android.googlesource.com/platform/external/stg/.

Building from Source

Instructions are included for local and Docker builds.

Dependencies

STG is written in C++20. It is known to compile with GCC 11, Clang 15 or later versions.

DependencyDebianRedHat
buildcmakecmake
ELF, BTFlibelf-develfutils-devel
DWARFlibdw-develfutils-devel
XMLlibxml2-devlibxml2-devel
BTFlinux-libc-devkernel-headers
native formatlibprotobuf-devprotobuf-devel
native formatprotobuf-compilerprotobuf-compiler
allocator[^1]libjemalloc-devjemalloc-devel
catch2[^2]catch2catch2-devel

[^1]: jemalloc is optional, but will likely improve performance. [^2]: catch2 is optional, but required to build the test suite.

Local Build

Build STG using CMake as follows:

$ mkdir build && cd build
$ cmake ..
$ cmake --build . --parallel

Run the STG unit test suite:

$ ctest

Docker Build

A Dockerfile is provided to build a container with the STG tools:

$ docker build -t stg .

And then enter the container:

$ docker run -it stg

Note that the Dockerfile provides only a production image. To use Docker as a development environment, you can comment out everything after the line # second stage.

After that you may bind your development code to the container:

$ docker run -it $PWD:/src -it stg

The source code is added to /src, so when your code is bound you can edit on your host and re-compile in the container.

Contributions

See CONTRIBUTING.md for details.

Contact Information

Please send feedback, questions and bug reports to kernel-team@android.com.