1. 09 Nov, 2023 10 commits
  2. 06 Nov, 2023 2 commits
  3. 03 Nov, 2023 2 commits
  4. 31 Oct, 2023 1 commit
  5. 30 Oct, 2023 1 commit
  6. 28 Oct, 2023 13 commits
  7. 26 Oct, 2023 3 commits
  8. 25 Oct, 2023 8 commits
    • Ian Rogers's avatar
      perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric · 3779416e
      Ian Rogers authored
      Broadwell-de has a consumer core and server uncore. The uncore_arb PMU
      isn't present and the broadwellx style cbox PMU should be used
      instead. Fix the tma_info_system_dram_bw_use metric to use the server
      metric rather than client.
      
      The associated converter script fix is in:
      https://github.com/intel/perfmon/pull/111
      
      Fixes: 7d124303 ("perf vendor events intel: Update broadwell variant events/metrics")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Link: https://lore.kernel.org/r/20230926031034.1201145-1-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      3779416e
    • Ian Rogers's avatar
      perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit · 56e144fe
      Ian Rogers authored
      Fix leak where mem_info__put wouldn't release the maps/map as used by
      perf mem. Add exit functions and use elsewhere that the maps and map
      are released.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-12-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      56e144fe
    • Ian Rogers's avatar
      perf callchain: Minor layout changes to callchain_list · dec07fe5
      Ian Rogers authored
      Avoid 6 byte hole for padding. Place more frequently used fields
      first in an attempt to use just 1 cacheline in the common case.
      
      Before:
      ```
      struct callchain_list {
              u64                        ip;                   /*     0     8 */
              struct map_symbol          ms;                   /*     8    24 */
              struct {
                      _Bool              unfolded;             /*    32     1 */
                      _Bool              has_children;         /*    33     1 */
              };                                               /*    32     2 */
      
              /* XXX 6 bytes hole, try to pack */
      
              u64                        branch_count;         /*    40     8 */
              u64                        from_count;           /*    48     8 */
              u64                        predicted_count;      /*    56     8 */
              /* --- cacheline 1 boundary (64 bytes) --- */
              u64                        abort_count;          /*    64     8 */
              u64                        cycles_count;         /*    72     8 */
              u64                        iter_count;           /*    80     8 */
              u64                        iter_cycles;          /*    88     8 */
              struct branch_type_stat *  brtype_stat;          /*    96     8 */
              const char  *              srcline;              /*   104     8 */
              struct list_head           list;                 /*   112    16 */
      
              /* size: 128, cachelines: 2, members: 13 */
              /* sum members: 122, holes: 1, sum holes: 6 */
      };
      ```
      
      After:
      ```
      struct callchain_list {
              struct list_head           list;                 /*     0    16 */
              u64                        ip;                   /*    16     8 */
              struct map_symbol          ms;                   /*    24    24 */
              const char  *              srcline;              /*    48     8 */
              u64                        branch_count;         /*    56     8 */
              /* --- cacheline 1 boundary (64 bytes) --- */
              u64                        from_count;           /*    64     8 */
              u64                        cycles_count;         /*    72     8 */
              u64                        iter_count;           /*    80     8 */
              u64                        iter_cycles;          /*    88     8 */
              struct branch_type_stat *  brtype_stat;          /*    96     8 */
              u64                        predicted_count;      /*   104     8 */
              u64                        abort_count;          /*   112     8 */
              struct {
                      _Bool              unfolded;             /*   120     1 */
                      _Bool              has_children;         /*   121     1 */
              };                                               /*   120     2 */
      
              /* size: 128, cachelines: 2, members: 13 */
              /* padding: 6 */
      };
      ```
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-11-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      dec07fe5
    • Ian Rogers's avatar
      perf callchain: Make brtype_stat in callchain_list optional · 6ba29fbb
      Ian Rogers authored
      struct callchain_list is 352bytes in size, 232 of which are
      brtype_stat. brtype_stat is only used for certain callchain_list
      items so make it optional, allocating when necessary. So that
      printing doesn't need to deal with an optional brtype_stat, pass
      an empty/zero version.
      
      Before:
      ```
      struct callchain_list {
              u64                        ip;                   /*     0     8 */
              struct map_symbol          ms;                   /*     8    24 */
              struct {
                      _Bool              unfolded;             /*    32     1 */
                      _Bool              has_children;         /*    33     1 */
              };                                               /*    32     2 */
      
              /* XXX 6 bytes hole, try to pack */
      
              u64                        branch_count;         /*    40     8 */
              u64                        from_count;           /*    48     8 */
              u64                        predicted_count;      /*    56     8 */
              /* --- cacheline 1 boundary (64 bytes) --- */
              u64                        abort_count;          /*    64     8 */
              u64                        cycles_count;         /*    72     8 */
              u64                        iter_count;           /*    80     8 */
              u64                        iter_cycles;          /*    88     8 */
              struct branch_type_stat    brtype_stat;          /*    96   232 */
              /* --- cacheline 5 boundary (320 bytes) was 8 bytes ago --- */
              const char  *              srcline;              /*   328     8 */
              struct list_head           list;                 /*   336    16 */
      
              /* size: 352, cachelines: 6, members: 13 */
              /* sum members: 346, holes: 1, sum holes: 6 */
              /* last cacheline: 32 bytes */
      };
      ```
      
      After:
      ```
      struct callchain_list {
              u64                        ip;                   /*     0     8 */
              struct map_symbol          ms;                   /*     8    24 */
              struct {
                      _Bool              unfolded;             /*    32     1 */
                      _Bool              has_children;         /*    33     1 */
              };                                               /*    32     2 */
      
              /* XXX 6 bytes hole, try to pack */
      
              u64                        branch_count;         /*    40     8 */
              u64                        from_count;           /*    48     8 */
              u64                        predicted_count;      /*    56     8 */
              /* --- cacheline 1 boundary (64 bytes) --- */
              u64                        abort_count;          /*    64     8 */
              u64                        cycles_count;         /*    72     8 */
              u64                        iter_count;           /*    80     8 */
              u64                        iter_cycles;          /*    88     8 */
              struct branch_type_stat *  brtype_stat;          /*    96     8 */
              const char  *              srcline;              /*   104     8 */
              struct list_head           list;                 /*   112    16 */
      
              /* size: 128, cachelines: 2, members: 13 */
              /* sum members: 122, holes: 1, sum holes: 6 */
      };
      ```
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-10-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      6ba29fbb
    • Ian Rogers's avatar
      perf callchain: Make display use of branch_type_stat const · d47d876d
      Ian Rogers authored
      Display code doesn't modify the branch_type_stat so switch uses to
      const. This is done to aid refactoring struct callchain_list where
      current the branch_type_stat is embedded even if not used.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-9-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      d47d876d
    • Ian Rogers's avatar
      perf offcpu: Add missed btf_free · 67a3ebf1
      Ian Rogers authored
      Caught by address/leak sanitizer.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-8-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      67a3ebf1
    • Ian Rogers's avatar
      perf threads: Remove unused dead thread list · 7b2e444b
      Ian Rogers authored
      Commit 40826c45 ("perf thread: Remove notion of dead threads")
      removed dead threads but the list head wasn't removed. Remove it here.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-7-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      7b2e444b
    • Ian Rogers's avatar
      perf hist: Add missing puts to hist__account_cycles · c1149037
      Ian Rogers authored
      Caught using reference count checking on perf top with
      "--call-graph=lbr". After this no memory leaks were detected.
      
      Fixes: 57849998 ("perf report: Add processing for cycle histograms")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Changbin Du <changbin.du@huawei.com>
      Cc: liuwenyu <liuwenyu7@huawei.com>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lore.kernel.org/r/20231024222353.3024098-6-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      c1149037