summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2019-02-09 07:53:02 +0300
committerJens Axboe <axboe@kernel.dk>2019-02-09 17:18:32 +0300
commite4db37fb69d56d9523bb540bd8e07bf221aa9f6d (patch)
treebb3ec98aebd4ad6e39bd6b85b2d77f876279da99 /tools/perf/scripts/python/export-to-sqlite.py
parent8c27a3953e92eb0b22dbb03d599f543a05f9574e (diff)
downloadlinux-e4db37fb69d56d9523bb540bd8e07bf221aa9f6d.tar.xz
bcache: add sysfs_strtoul_bool() for setting bit-field variables
When setting bool values via sysfs interface, e.g. writeback_metadata, if writing 1 into writeback_metadata file, dc->writeback_metadata is set to 1, but if writing 2 into the file, dc->writeback_metadata is 0. This is misleading, a better result should be 1 for all non-zero input value. It is because dc->writeback_metadata is a bit-field variable, and current code simply use d_strtoul() to convert a string into integer and takes the lowest bit value. To fix such error, we need a routine to convert the input string into unsigned integer, and set target variable to 1 if the converted integer is non-zero. This patch introduces a new macro called sysfs_strtoul_bool(), it can be used to convert input string into bool value, we can use it to set bool value for bit-field vairables. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions