Commit b6398bc
tools/power turbostat: Fix --show/--hide for individual cpuidle counters
Problem: individual swidle counter names (C1, C1+, C1-, etc.) cannot be
selected via --show/--hide due to two bugs in probe_cpuidle_counts():
1. The function returns immediately when BIC_cpuidle is not enabled,
without checking deferred_add_index.
2. The deferred name check runs against name_buf before the trailing
newline is stripped, so is_deferred_add("C1\n") never matches "C1".
Fix:
1. Relax the early return to pass through when deferred names are
queued.
2. Strip the trailing newline from name_buf before performing deferred
name checks.
3. Check each suffixed variant (C1+, C1, C1-) individually so that
e.g. "--show C1+" enables only the requested metric.
In addition, introduce a helper function to avoid repeating the
condition (readability cleanup).
Fixes: ec4acd3 ("tools/power turbostat: disable "cpuidle" invocation counters, by default")
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>1 parent 23cb4f5 commit b6398bc
1 file changed
Lines changed: 21 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11285 | 11285 | | |
11286 | 11286 | | |
11287 | 11287 | | |
| 11288 | + | |
| 11289 | + | |
| 11290 | + | |
| 11291 | + | |
| 11292 | + | |
| 11293 | + | |
| 11294 | + | |
| 11295 | + | |
11288 | 11296 | | |
11289 | 11297 | | |
11290 | 11298 | | |
| |||
11294 | 11302 | | |
11295 | 11303 | | |
11296 | 11304 | | |
11297 | | - | |
| 11305 | + | |
11298 | 11306 | | |
11299 | 11307 | | |
11300 | 11308 | | |
| |||
11309 | 11317 | | |
11310 | 11318 | | |
11311 | 11319 | | |
11312 | | - | |
11313 | | - | |
11314 | | - | |
11315 | | - | |
11316 | | - | |
11317 | | - | |
11318 | 11320 | | |
11319 | 11321 | | |
11320 | 11322 | | |
| |||
11329 | 11331 | | |
11330 | 11332 | | |
11331 | 11333 | | |
11332 | | - | |
11333 | 11334 | | |
11334 | 11335 | | |
11335 | | - | |
11336 | | - | |
| 11336 | + | |
| 11337 | + | |
| 11338 | + | |
| 11339 | + | |
11337 | 11340 | | |
11338 | 11341 | | |
11339 | 11342 | | |
11340 | | - | |
11341 | | - | |
| 11343 | + | |
| 11344 | + | |
| 11345 | + | |
| 11346 | + | |
11342 | 11347 | | |
11343 | 11348 | | |
11344 | 11349 | | |
| |||
11347 | 11352 | | |
11348 | 11353 | | |
11349 | 11354 | | |
11350 | | - | |
11351 | | - | |
| 11355 | + | |
| 11356 | + | |
| 11357 | + | |
| 11358 | + | |
11352 | 11359 | | |
11353 | 11360 | | |
11354 | 11361 | | |
| |||
0 commit comments