Commit 9b231d9
perf/core: Fix time on IOC_ENABLE
Vince reported that when we do IOC_ENABLE/IOC_DISABLE while the task
is SIGSTOP'ed state the timestamps go wobbly.
It turns out we indeed fail to correctly account time while in 'OFF'
state and doing IOC_ENABLE without getting scheduled in exposes the
problem.
Further thinking about this problem, it occurred to me that we can
suffer a similar fate when we migrate an uncore event between CPUs.
The perf_event_install() on the 'new' CPU will do add_event_to_ctx()
which will reset all the time stamp, resulting in a subsequent
update_event_times() to overwrite the total_time_* fields with smaller
values.
Reported-by: Vince Weaver <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>1 parent bfe3349 commit 9b231d9
1 file changed
+36
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2217 | 2217 | | |
2218 | 2218 | | |
2219 | 2219 | | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
2220 | 2247 | | |
2221 | 2248 | | |
2222 | 2249 | | |
2223 | 2250 | | |
2224 | 2251 | | |
2225 | 2252 | | |
2226 | 2253 | | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
2230 | 2260 | | |
2231 | 2261 | | |
2232 | 2262 | | |
| |||
2471 | 2501 | | |
2472 | 2502 | | |
2473 | 2503 | | |
2474 | | - | |
| 2504 | + | |
2475 | 2505 | | |
| 2506 | + | |
2476 | 2507 | | |
2477 | | - | |
| 2508 | + | |
2478 | 2509 | | |
2479 | 2510 | | |
2480 | 2511 | | |
| |||
0 commit comments