Commit 3cec9fd
perf/x86/lbr: Fix shorter LBRs call stacks for the system-wide mode
In the system-wide mode, LBR callstacks are shorter in comparison to
the per-process mode.
LBR MSRs are reset during a context switch in the system-wide mode. For
the LBR call stack, the LBRs should be always saved/restored during a
context switch.
Use the space in task_struct to save/restore the LBR call stack data.
For a system-wide event, it's unnecessagy to update the
lbr_callstack_users for each threads. Add a variable in x86_pmu to
indicate whether the system-wide event is active.
Fixes: 76cb2c6 ("perf/x86/intel: Save/restore LBR stack during context switch")
Reported-by: Andi Kleen <ak@linux.intel.com>
Reported-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Debugged-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250314172700.438923-5-kan.liang@linux.intel.com1 parent d57e94f commit 3cec9fd
2 files changed
+40
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
428 | 434 | | |
429 | | - | |
| 435 | + | |
430 | 436 | | |
431 | 437 | | |
432 | 438 | | |
| |||
503 | 509 | | |
504 | 510 | | |
505 | 511 | | |
506 | | - | |
| 512 | + | |
507 | 513 | | |
508 | 514 | | |
509 | 515 | | |
| |||
543 | 549 | | |
544 | 550 | | |
545 | 551 | | |
| 552 | + | |
546 | 553 | | |
547 | 554 | | |
548 | 555 | | |
| |||
553 | 560 | | |
554 | 561 | | |
555 | 562 | | |
556 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
557 | 566 | | |
558 | 567 | | |
559 | 568 | | |
560 | 569 | | |
561 | 570 | | |
| 571 | + | |
562 | 572 | | |
563 | 573 | | |
| 574 | + | |
564 | 575 | | |
565 | 576 | | |
566 | 577 | | |
| |||
589 | 600 | | |
590 | 601 | | |
591 | 602 | | |
592 | | - | |
593 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
594 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
595 | 616 | | |
596 | 617 | | |
597 | 618 | | |
| |||
665 | 686 | | |
666 | 687 | | |
667 | 688 | | |
668 | | - | |
669 | | - | |
670 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
671 | 702 | | |
672 | 703 | | |
673 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
| 923 | + | |
923 | 924 | | |
924 | 925 | | |
925 | 926 | | |
| |||
0 commit comments