]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools/power turbostat: Fix delimiter bug in print functions
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 11 Mar 2026 09:00:34 +0000 (11:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Apr 2026 11:30:35 +0000 (13:30 +0200)
commit5ffa3a72bfc617e9188312186a1ad8a52cb25a14
tree493016da7e2df9d4e19c58e65cc2dcb621261308
parent59bd9088336d2bb7e713dcf4df5cbda86bb3c611
tools/power turbostat: Fix delimiter bug in print functions

[ Upstream commit cdbefe9d4029d4834d404f7ba13a960b38a69e88 ]

Commands that add counters, such as 'turbostat --show C1,C1+'
display merged columns without a delimiter.

This is caused by the bad syntax: '(*printed++ ? delim : "")', shared by
print_name()/print_hex_value()/print_decimal_value()/print_float_value()

Use '((*printed)++ ? delim : "")' to correctly increment the value at *printed.

[lenb: fix code and commit message typo, re-word]
Fixes: 56dbb878507b ("tools/power turbostat: Refactor added column header printing")
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/power/x86/turbostat/turbostat.c