dash/contrib/auto_gdb
Wladimir J. van der Laan d1200755f1 Merge #13448: Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python
c8176b3cc7556d7bcec39a55ae4d6ba16453baaa Add linter: Make sure we explicitly open all text files using UTF-8 or ASCII encoding in Python (practicalswift)
634bd970013eca90f4b4c1f9044eec8c97ba62c2 Explicitly specify encoding when opening text files in Python code (practicalswift)

Pull request description:

  Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python.

  As requested by @laanwj in #13440.

Tree-SHA512: 1651c00fe220ceb273324abd6703aee504029b96c7ef0e3029145901762c733c9b9d24927da281394fd4681a5bff774336c04eed01fafea997bb32192c334c06
Signed-off-by: pasta <pasta@dashboost.org>

# Conflicts:
#	contrib/devtools/circular-dependencies.py
#	contrib/linearize/linearize-data.py
#	contrib/linearize/linearize-hashes.py
#	contrib/seeds/generate-seeds.py
#	contrib/verify-commits/verify-commits.py
#	test/functional/multiwallet.py
#	test/functional/notifications.py
#	test/functional/test_runner.py
#	test/util/rpcauth-test.py
2020-07-07 11:50:56 -05:00
..
common_helpers.py fix lint failures 2020-06-27 11:02:43 -05:00
dash_dbg.sh GDB automation with Python script to measure memory usage in dashd (#1609) 2018-10-23 14:15:08 +03:00
debug.gdb GDB automation with Python script to measure memory usage in dashd (#1609) 2018-10-23 14:15:08 +03:00
log_size.py Merge #13448: Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python 2020-07-07 11:50:56 -05:00
README.md GDB automation with Python script to measure memory usage in dashd (#1609) 2018-10-23 14:15:08 +03:00
simple_class_obj.py fix lint failures 2020-06-27 11:02:43 -05:00
stl_containers.py fix lint failures 2020-06-27 11:02:43 -05:00
test_used_size.gdb GDB automation with Python script to measure memory usage in dashd (#1609) 2018-10-23 14:15:08 +03:00
used_size.py fix lint failures 2020-06-27 11:02:43 -05:00

Contents

This directory contains tools to automatically get data about the memory consumption by some objects in dashd process with the help of GDB debugger.

dash_dbg.sh

This shell script attaches GDB to the running dashd process (should be built with debug info), executes debug.gdb script and detaches. By default it uses testnet settings, see script comments to attach it to mainnet dashd.

debug.gdb

Contains debugger instructions to execute during attach: loads python code and executes it for the objects we want to investigate.

log_size.py

Contains definition of the gdb command log_size. After this script loads it can be called from gdb command line or other gdb scripts. Command params: log_size arg0 arg1 arg0 - name of object whose memory will be written in log file arg1 - name of the log file Example:

log_size mnodeman "memlog.txt"

used_size.py

Contains definition of the gdb command used_size. After loading of this script it can be called from gdb command line or other gdb scripts. Command params: used_size arg0 arg1 arg0 - variable to store memory used by the object arg1 - name of object whose memory will be calculated and stored in the first argument Example:

>(gdb) set $size = 0
>(gdb) used_size $size mnodeman
>(gdb) p $size

stl_containers.py

Contains helper classes to calculate memory used by the STL containers (list, vector, map, set, pair).

simple_class_obj.py

Contains a helper class to calculate the memory used by an object as a sum of the memory used by its fields. All processed objects of such type are listed in the this file, you can add new types you are interested in to this list. If a type is not listed here, its size is the return of sizeof (except STL containers which are processed in stl_containers.py).

common_helpers.py

Several helper functions that are used in other python code.