Commit 03cec19
perf sched: Move curr_pid and cpu_last_switched initialization to perf_sched__{lat|map|replay}()
[ Upstream commit bd2cdf2 ]
The curr_pid and cpu_last_switched are used only for the
'perf sched replay/latency/map'. Put their initialization in
perf_sched__{lat|map|replay () to reduce unnecessary actions in other
commands.
Simple functional testing:
# perf sched record perf bench sched messaging
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 10 groups == 400 processes run
Total time: 0.209 [sec]
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 16.456 MB perf.data (147907 samples) ]
# perf sched lat
-------------------------------------------------------------------------------------------------------------------------------------------
Task | Runtime ms | Switches | Avg delay ms | Max delay ms | Max delay start | Max delay end |
-------------------------------------------------------------------------------------------------------------------------------------------
sched-messaging:(401) | 2990.699 ms | 38705 | avg: 0.661 ms | max: 67.046 ms | max start: 456532.624830 s | max end: 456532.691876 s
qemu-system-x86:(7) | 179.764 ms | 2191 | avg: 0.152 ms | max: 21.857 ms | max start: 456532.576434 s | max end: 456532.598291 s
sshd:48125 | 0.522 ms | 2 | avg: 0.037 ms | max: 0.046 ms | max start: 456532.514610 s | max end: 456532.514656 s
<SNIP>
ksoftirqd/11:82 | 0.063 ms | 1 | avg: 0.005 ms | max: 0.005 ms | max start: 456532.769366 s | max end: 456532.769371 s
kworker/9:0-mm_:34624 | 0.233 ms | 20 | avg: 0.004 ms | max: 0.007 ms | max start: 456532.690804 s | max end: 456532.690812 s
migration/13:93 | 0.000 ms | 1 | avg: 0.004 ms | max: 0.004 ms | max start: 456532.512669 s | max end: 456532.512674 s
-----------------------------------------------------------------------------------------------------------------
TOTAL: | 3180.750 ms | 41368 |
---------------------------------------------------
# echo $?
0
# perf sched map
*A0 456532.510141 secs A0 => migration/0:15
*. 456532.510171 secs . => swapper:0
. *B0 456532.510261 secs B0 => migration/1:21
. *. 456532.510279 secs
<SNIP>
L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 *L7 . . . . 456532.785979 secs
L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 *L7 . . . 456532.786054 secs
L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 *L7 . . 456532.786127 secs
L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 *L7 . 456532.786197 secs
L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 L7 *L7 456532.786270 secs
# echo $?
0
# perf sched replay
run measurement overhead: 108 nsecs
sleep measurement overhead: 66473 nsecs
the run test took 1000002 nsecs
the sleep test took 1082686 nsecs
nr_run_events: 49334
nr_sleep_events: 50054
nr_wakeup_events: 34701
target-less wakeups: 165
multi-target wakeups: 766
task 0 ( swapper: 0), nr_events: 15419
task 1 ( swapper: 1), nr_events: 1
task 2 ( swapper: 2), nr_events: 1
<SNIP>
task 715 ( sched-messaging: 110248), nr_events: 1438
task 716 ( sched-messaging: 110249), nr_events: 512
task 717 ( sched-messaging: 110250), nr_events: 500
task 718 ( sched-messaging: 110251), nr_events: 537
task 719 ( sched-messaging: 110252), nr_events: 823
------------------------------------------------------------
#1 : 1325.288, ravg: 1325.29, cpu: 7823.35 / 7823.35
#2 : 1363.606, ravg: 1329.12, cpu: 7655.53 / 7806.56
#3 : 1349.494, ravg: 1331.16, cpu: 7544.80 / 7780.39
#4 : 1311.488, ravg: 1329.19, cpu: 7495.13 / 7751.86
#5 : 1309.902, ravg: 1327.26, cpu: 7266.65 / 7703.34
#6 : 1309.535, ravg: 1325.49, cpu: 7843.86 / 7717.39
#7 : 1316.482, ravg: 1324.59, cpu: 7854.41 / 7731.09
#8 : 1366.604, ravg: 1328.79, cpu: 7955.81 / 7753.57
#9 : 1326.286, ravg: 1328.54, cpu: 7466.86 / 7724.90
#10 : 1356.653, ravg: 1331.35, cpu: 7566.60 / 7709.07
# echo $?
0
Signed-off-by: Yang Jihong <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Stable-dep-of: 1a5efc9 ("libsubcmd: Don't free the usage string")
Signed-off-by: Sasha Levin <[email protected]>1 parent 4078f1d commit 03cec19
1 file changed
+61
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3211 | 3211 | | |
3212 | 3212 | | |
3213 | 3213 | | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
3214 | 3240 | | |
3215 | 3241 | | |
| 3242 | + | |
3216 | 3243 | | |
3217 | 3244 | | |
3218 | 3245 | | |
3219 | 3246 | | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
3220 | 3250 | | |
3221 | | - | |
| 3251 | + | |
3222 | 3252 | | |
3223 | 3253 | | |
3224 | 3254 | | |
| |||
3247 | 3277 | | |
3248 | 3278 | | |
3249 | 3279 | | |
3250 | | - | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
3251 | 3285 | | |
3252 | 3286 | | |
3253 | 3287 | | |
| |||
3314 | 3348 | | |
3315 | 3349 | | |
3316 | 3350 | | |
3317 | | - | |
| 3351 | + | |
3318 | 3352 | | |
3319 | 3353 | | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
3320 | 3357 | | |
3321 | 3358 | | |
3322 | 3359 | | |
| |||
3340 | 3377 | | |
3341 | 3378 | | |
3342 | 3379 | | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
3343 | 3383 | | |
3344 | 3384 | | |
3345 | 3385 | | |
| |||
3353 | 3393 | | |
3354 | 3394 | | |
3355 | 3395 | | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3356 | 3400 | | |
3357 | 3401 | | |
3358 | 3402 | | |
3359 | 3403 | | |
3360 | 3404 | | |
3361 | 3405 | | |
3362 | 3406 | | |
3363 | | - | |
| 3407 | + | |
3364 | 3408 | | |
3365 | 3409 | | |
3366 | 3410 | | |
| |||
3386 | 3430 | | |
3387 | 3431 | | |
3388 | 3432 | | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
3389 | 3436 | | |
3390 | 3437 | | |
3391 | 3438 | | |
| |||
3624 | 3671 | | |
3625 | 3672 | | |
3626 | 3673 | | |
3627 | | - | |
3628 | | - | |
3629 | | - | |
3630 | | - | |
3631 | | - | |
3632 | | - | |
3633 | | - | |
3634 | | - | |
3635 | | - | |
3636 | | - | |
3637 | | - | |
3638 | | - | |
3639 | | - | |
3640 | | - | |
3641 | | - | |
| 3674 | + | |
3642 | 3675 | | |
3643 | 3676 | | |
3644 | 3677 | | |
| |||
3649 | 3682 | | |
3650 | 3683 | | |
3651 | 3684 | | |
3652 | | - | |
| 3685 | + | |
3653 | 3686 | | |
3654 | | - | |
| 3687 | + | |
3655 | 3688 | | |
3656 | 3689 | | |
3657 | 3690 | | |
| |||
3660 | 3693 | | |
3661 | 3694 | | |
3662 | 3695 | | |
3663 | | - | |
| 3696 | + | |
3664 | 3697 | | |
3665 | 3698 | | |
3666 | 3699 | | |
| |||
3669 | 3702 | | |
3670 | 3703 | | |
3671 | 3704 | | |
3672 | | - | |
| 3705 | + | |
3673 | 3706 | | |
3674 | 3707 | | |
3675 | 3708 | | |
3676 | 3709 | | |
3677 | 3710 | | |
3678 | 3711 | | |
3679 | 3712 | | |
3680 | | - | |
| 3713 | + | |
3681 | 3714 | | |
3682 | 3715 | | |
3683 | 3716 | | |
| |||
3693 | 3726 | | |
3694 | 3727 | | |
3695 | 3728 | | |
3696 | | - | |
3697 | | - | |
| 3729 | + | |
3698 | 3730 | | |
3699 | 3731 | | |
3700 | 3732 | | |
3701 | | - | |
| 3733 | + | |
3702 | 3734 | | |
3703 | | - | |
| 3735 | + | |
3704 | 3736 | | |
3705 | 3737 | | |
3706 | 3738 | | |
3707 | 3739 | | |
3708 | | - | |
3709 | | - | |
3710 | | - | |
3711 | | - | |
3712 | | - | |
| 3740 | + | |
3713 | 3741 | | |
0 commit comments