Skip to content

Commit f2b9600

Browse files
authored
Revert "Assign a label for level of bloat diff (grpc#27880)" (grpc#27925)
This reverts commit 882cc12.
1 parent ef9ed33 commit f2b9600

4 files changed

Lines changed: 6 additions & 78 deletions

File tree

third_party/bloaty

Submodule bloaty updated 230 files

tools/profiling/bloat/bloat_diff.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
# limitations under the License.
1616

1717
import argparse
18-
import csv
1918
import glob
20-
import math
2119
import multiprocessing
2220
import os
23-
import pathlib
2421
import shutil
2522
import subprocess
2623
import sys
@@ -74,48 +71,27 @@ def _build(output_dir):
7471
subprocess.check_call(['git', 'checkout', where_am_i])
7572
subprocess.check_call(['git', 'submodule', 'update'])
7673

77-
pathlib.Path('bloaty-build').mkdir(exist_ok=True)
78-
subprocess.check_call(
79-
['cmake', '-G', 'Unix Makefiles', '../third_party/bloaty'],
80-
cwd='bloaty-build')
81-
subprocess.check_call('make -j%d' % args.jobs, shell=True, cwd='bloaty-build')
74+
subprocess.check_call('make -j%d' % args.jobs,
75+
shell=True,
76+
cwd='third_party/bloaty')
8277

8378
text = ''
84-
diff_size = 0
8579
for lib in LIBS:
8680
text += '****************************************************************\n\n'
8781
text += lib + '\n\n'
8882
old_version = glob.glob('bloat_diff_old/%s' % lib)
8983
new_version = glob.glob('bloat_diff_new/%s' % lib)
9084
assert len(new_version) == 1
91-
cmd = 'bloaty-build/bloaty -d compileunits,symbols'
85+
cmd = 'third_party/bloaty/bloaty -d compileunits,symbols'
9286
if old_version:
9387
assert len(old_version) == 1
9488
text += subprocess.check_output('%s %s -- %s' %
9589
(cmd, new_version[0], old_version[0]),
9690
shell=True).decode()
97-
for filename in [old_version, new_version]:
98-
subprocess.check_call('strip %s' % filename[0], shell=True)
99-
sections = [
100-
x for x in csv.reader(
101-
subprocess.check_output('bloaty-build/bloaty --csv %s -- %s' %
102-
(old_version[0], new_version[0]),
103-
shell=True).decode().splitlines())
104-
]
105-
print(sections)
106-
for section in sections[1:]:
107-
diff_size += int(section[2])
10891
else:
10992
text += subprocess.check_output('%s %s' % (cmd, new_version[0]),
11093
shell=True).decode()
11194
text += '\n\n'
11295

113-
severity = int(
114-
math.copysign(max(0, math.log(abs(diff_size) / 1000, 10),
115-
diff_size))) if diff_size != 0 else 0
116-
117-
print("SEVERITY: %d" % severity)
118-
11996
print(text)
12097
check_on_pr.check_on_pr('Bloat Difference', '```\n%s\n```' % text)
121-
check_on_pr.label_significance_on_pr('bloat', severity)

tools/run_tests/python_utils/check_on_pr.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@
3333
_ACCESS_TOKEN_FETCH_RETRIES = 6
3434
_ACCESS_TOKEN_FETCH_RETRIES_INTERVAL_S = 15
3535

36-
_CHANGE_LABELS = {
37-
-1: 'improvement',
38-
0: 'none',
39-
1: 'low',
40-
2: 'medium',
41-
3: 'high',
42-
}
43-
4436

4537
def _jwt_token():
4638
github_app_key = open(
@@ -147,43 +139,3 @@ def check_on_pr(name, summary, success=True):
147139
})
148140
print('Result of Creating/Updating Check on PR:',
149141
json.dumps(resp.json(), indent=2))
150-
151-
152-
def label_significance_on_pr(name, change):
153-
"""Add a label to the PR indicating the significance of the check.
154-
155-
Requires environment variable 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' to indicate which pull request
156-
should be updated.
157-
158-
Args:
159-
name: The name of the label.
160-
value: A str in Markdown to be used as the detail information of the label.
161-
"""
162-
if change < min(list(_CHANGE_LABELS.keys())):
163-
change = min(list(_CHANGE_LABELS.keys()))
164-
if change > max(list(_CHANGE_LABELS.keys())):
165-
change = max(list(_CHANGE_LABELS.keys()))
166-
value = _CHANGE_LABELS[change]
167-
if 'KOKORO_GIT_COMMIT' not in os.environ:
168-
print('Missing KOKORO_GIT_COMMIT env var: not checking')
169-
return
170-
if 'KOKORO_KEYSTORE_DIR' not in os.environ:
171-
print('Missing KOKORO_KEYSTORE_DIR env var: not checking')
172-
return
173-
if 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' not in os.environ:
174-
print('Missing KOKORO_GITHUB_PULL_REQUEST_NUMBER env var: not checking')
175-
return
176-
resp = _call(
177-
'/repos/%s/issues/%s/labels' %
178-
(_GITHUB_REPO, os.environ['KOKORO_GITHUB_PULL_REQUEST_NUMBER']),
179-
method='DELETE',
180-
json=[
181-
"%s/%s" % (name, v) for v in _CHANGE_LABELS.values() if v != value
182-
])
183-
print('Result of Deleting Labels on PR:', resp.text)
184-
resp = _call(
185-
'/repos/%s/issues/%s/labels' %
186-
(_GITHUB_REPO, os.environ['KOKORO_GITHUB_PULL_REQUEST_NUMBER']),
187-
method='POST',
188-
json=["%s/%s" % (name, value)])
189-
print('Result of Adding Label on PR:', resp.text)

tools/run_tests/sanity/check_submodules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ git submodule | awk '{ print $2 " " $1 }' | sort >"$submodules"
2727
cat <<EOF | sort >"$want_submodules"
2828
third_party/abseil-cpp 278e0a071885a22dcd2fd1b5576cc44757299343
2929
third_party/benchmark 0baacde3618ca617da95375e0af13ce1baadea47
30-
third_party/bloaty 60209eb1ccc34d5deefb002d1b7f37545204f7f2
30+
third_party/bloaty 73594cde8c9a52a102c4341c244c833aa61b9c06
3131
third_party/boringssl-with-bazel 95b3ed1b01f2ef1d72fed290ed79fe1b0e7dafc0
3232
third_party/cares/cares e982924acee7f7313b4baa4ee5ec000c5e373c30
3333
third_party/envoy-api 20b1b5fcee88a20a08b71051a961181839ec7268

0 commit comments

Comments
 (0)