-
Notifications
You must be signed in to change notification settings - Fork 315
/
Copy pathgperftools.yaml
179 lines (163 loc) · 4.61 KB
/
gperftools.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Generated from https://git.alpinelinux.org/aports/plain/testing/gperftools/APKBUILD
package:
name: gperftools
version: "2.16"
epoch: 0
description: Fast, multi-threaded malloc and nifty performance analysis tools
copyright:
- license: BSD-3-Clause
environment:
contents:
packages:
- autoconf
- automake
- build-base
- busybox
- ca-certificates-bundle
- libtool
- libunwind-dev
- linux-headers
pipeline:
- uses: git-checkout
with:
expected-commit: e1014dead2029b341d06027b4f2b5562d799d5b1
repository: https://github.com/gperftools/gperftools.git
tag: gperftools-${{package.version}}
- uses: autoconf/configure
- uses: autoconf/make
- uses: autoconf/make-install
- uses: strip
subpackages:
- name: gperftools-doc
description: gperftools manpages
pipeline:
- uses: split/manpages
- runs: |
mkdir -p ${{targets.contextdir}}/usr/share
mv ${{targets.destdir}}/usr/share/doc ${{targets.contextdir}}/usr/share
test:
pipeline:
- uses: test/docs
- name: gperftools-static
description: gperftools static libraries
pipeline:
- uses: split/static
- name: tcmalloc
description: tcmalloc
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/lib/
mv ${{targets.destdir}}/usr/lib/libtcmalloc.so.* ${{targets.contextdir}}/usr/lib/
test:
pipeline:
- uses: test/tw/ldd-check
- name: tcmalloc-minimal
description: tcmalloc minimal
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/lib/
mv ${{targets.destdir}}/usr/lib/libtcmalloc_minimal.so.* ${{targets.contextdir}}/usr/lib/
test:
pipeline:
- uses: test/tw/ldd-check
- name: tcmalloc-debug
description: tcmalloc debug
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/lib/
mv ${{targets.destdir}}/usr/lib/libtcmalloc_debug.so.* ${{targets.contextdir}}/usr/lib/
test:
pipeline:
- uses: test/tw/ldd-check
- name: tcmalloc-minimal-debug
description: tcmalloc minimal debug
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/lib/
mv ${{targets.destdir}}/usr/lib/libtcmalloc_minimal_debug.so.* ${{targets.contextdir}}/usr/lib/
test:
pipeline:
- uses: test/tw/ldd-check
- name: tcmalloc-profiler
description: tcmalloc profiler
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/lib/
mv ${{targets.destdir}}/usr/lib/libtcmalloc_and_profiler.so.* ${{targets.contextdir}}/usr/lib/
test:
pipeline:
- uses: test/tw/ldd-check
- name: gperftools-dev
description: gperftools dev
dependencies:
runtime:
- gperftools
pipeline:
- uses: split/dev
test:
pipeline:
- uses: test/pkgconf
update:
enabled: true
github:
identifier: gperftools/gperftools
strip-prefix: gperftools-
test:
environment:
contents:
packages:
- build-base
- gcc
- binutils
- coreutils
- findutils
- tcmalloc # Explicit tcmalloc dependency
- tcmalloc-profiler # For profiling functionality
- gperftools-dev # For headers and development files
pipeline:
- name: "Test basic heap profiler functionality"
runs: |
cat > heap_test.cpp << 'EOF'
#include <cstdlib>
int main() {
for(int i = 0; i < 1000; i++) {
void* ptr = malloc(1024);
free(ptr);
}
return 0;
}
EOF
g++ -o heap_test heap_test.cpp -ltcmalloc
HEAPPROFILE=/tmp/test ./heap_test
test -f /tmp/test.0001.heap
- name: "Test CPU profiler functionality"
runs: |
cat > cpu_test.cpp << 'EOF'
#include <cstdlib>
void busy_work() {
for(int i = 0; i < 1000000; i++) { }
}
int main() {
busy_work();
return 0;
}
EOF
g++ -o cpu_test cpu_test.cpp -ltcmalloc_and_profiler
CPUPROFILE=/tmp/cpu.prof ./cpu_test
test -f /tmp/cpu.prof
- name: "Test linking against tcmalloc"
runs: |
cat > malloc_test.cpp << 'EOF'
#include <gperftools/tcmalloc.h>
int main() {
void* ptr = tc_malloc(1024);
tc_free(ptr);
return 0;
}
EOF
g++ -o malloc_test malloc_test.cpp -ltcmalloc
./malloc_test
- name: "Test minimal TCMalloc compilation"
runs: |
g++ -o minimal_test malloc_test.cpp -ltcmalloc_minimal
./minimal_test