-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fmt and lint to benchmarks/ tests
- Loading branch information
Showing
7 changed files
with
81 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#! /usr/bin/env python | ||
"""Go through /bin and print out the number of symbols in each binary.""" | ||
|
||
import json | ||
import os | ||
import subprocess | ||
from collections import defaultdict | ||
|
||
data = defaultdict(lambda: 0) | ||
|
||
for root, dirs, files in os.walk("/bin"): | ||
for file in files: | ||
full_path_file = os.path.join(root, file) | ||
if not os.path.isfile(full_path_file) or not os.access(full_path_file, os.X_OK): | ||
pass | ||
result = subprocess.run( | ||
f"readelf -s {full_path_file} | wc -l", | ||
capture_output=True, | ||
text=True, | ||
shell=True, | ||
) | ||
num_symbols = int(result.stdout) | ||
data[full_path_file] = num_symbols | ||
|
||
with open("symbols.json", "w") as f: | ||
json.dump(data, f, indent=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters