Skip to content

Commit a09b7fc

Browse files
committed
Split debug - add an extra folder to the META-INF outputs
1 parent 6ab90a7 commit a09b7fc

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,39 @@ The project includes both Java and C++ unit tests. You can run them using:
6464
### Cross-JDK Testing
6565
`JAVA_TEST_HOME=<path to test JDK> ./gradlew testDebug`
6666

67+
## Release Builds and Debug Information
68+
69+
### Split Debug Information
70+
Release builds automatically generate split debug information to optimize deployment size while preserving debugging capabilities:
71+
72+
- **Stripped libraries** (~1.2MB): Production-ready binaries with symbols removed for deployment
73+
- **Debug symbol files** (~6.1MB): Separate `.debug` files containing full debugging information
74+
- **Debug links**: Stripped libraries include `.gnu_debuglink` sections pointing to debug files
75+
76+
### Build Artifacts Structure
77+
```
78+
ddprof-lib/build/
79+
├── lib/main/release/linux/x64/
80+
│ ├── libjavaProfiler.so # Original library with debug symbols
81+
│ ├── stripped/
82+
│ │ └── libjavaProfiler.so # Stripped library (83% smaller)
83+
│ └── debug/
84+
│ └── libjavaProfiler.so.debug # Debug symbols only
85+
├── native/release/
86+
│ └── META-INF/native-libs/linux-x64/
87+
│ └── libjavaProfiler.so # Final stripped library (deployed)
88+
└── native/release-debug/
89+
└── META-INF/native-libs/linux-x64/
90+
└── libjavaProfiler.so.debug # Debug symbols package
91+
```
92+
93+
### Build Options
94+
- **Skip debug extraction**: `./gradlew buildRelease -Pskip-debug-extraction=true`
95+
- **Debug extraction requires**: `objcopy` (Linux) or `dsymutil` (macOS)
96+
- Ubuntu/Debian: `sudo apt-get install binutils`
97+
- Alpine: `apk add binutils`
98+
- macOS: Included with Xcode command line tools
99+
67100
## Development
68101

69102
### Code Quality

ddprof-lib/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ def setupDebugExtraction(config, linkTask) {
176176
if (copyTask != null) {
177177
copyTask.dependsOn stripTask
178178
copyTask.inputs.files stripTask.get().outputs.files
179+
180+
// Create an extra folder for the debug symbols
181+
copyTask.dependsOn copyDebugTask
179182
}
180183
}
181184
}

0 commit comments

Comments
 (0)