linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xu Yang <xu.yang_2@nxp.com>
To: Ian Rogers <irogers@google.com>
Cc: "John Garry" <john.g.garry@oracle.com>,
	"Will Deacon" <will@kernel.org>,
	"James Clark" <james.clark@linaro.org>,
	"Mike Leach" <mike.leach@linaro.org>,
	"Leo Yan" <leo.yan@linux.dev>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Kan Liang" <kan.liang@linux.intel.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Athira Rajeev" <atrajeev@linux.vnet.ibm.com>,
	"Ben Zong-You Xie" <ben717@andestech.com>,
	"Alexandre Ghiti" <alexghiti@rivosinc.com>,
	"Sandipan Das" <sandipan.das@amd.com>,
	"Benjamin Gray" <bgray@linux.ibm.com>,
	"Ravi Bangoria" <ravi.bangoria@amd.com>,
	"Clément Le Goffic" <clement.legoffic@foss.st.com>,
	"Yicong Yang" <yangyicong@hisilicon.com>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	"Dima Kogan" <dima@secretsauce.net>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org
Subject: Re: [PATCH v1 0/7] Refactor cpuid and metric table lookup code
Date: Thu, 7 Nov 2024 17:03:30 +0800	[thread overview]
Message-ID: <20241107082807.ipb7xzqvs24tto2e@hippo> (raw)
In-Reply-To: <20241107071600.9082-1-irogers@google.com>

Hi Ian Rogers,

On Wed, Nov 06, 2024 at 11:15:53PM -0800, Ian Rogers wrote:
> Xu Yang <xu.yang_2@nxp.com> reported issues with the system metric
> lookup:
> https://lore.kernel.org/linux-perf-users/20241106085441.3945502-1-xu.yang_2@nxp.com/
> These patches remove a lot of the logic relating CPUIDs to PMUs so
> that the PMU isn't part of the question when finding a metric table.
> For time reasons, it doesn't go as far as allowing system metrics
> without a metric table as a metric table is needed for metrics to
> refer to other metrics, and the refactoring of that resolution is a
> hassle.
> 
> Ian Rogers (7):
>   perf header: Move is_cpu_online to numa bench
>   perf header: Refactor get_cpuid to take a CPU for ARM
>   perf arm64 header: Use cpu argument in get_cpuid
>   perf header: Avoid transitive PMU includes
>   perf header: Pass a perf_cpu rather than a PMU to get_cpuid_str
>   perf jevents: Add map_for_cpu
>   perf pmu: Move pmu_metrics_table__find and remove ARM override
> 
>  tools/perf/arch/arm64/util/arm-spe.c     | 14 +---
>  tools/perf/arch/arm64/util/header.c      | 73 ++++++++++-----------
>  tools/perf/arch/arm64/util/pmu.c         | 20 ------
>  tools/perf/arch/loongarch/util/header.c  |  4 +-
>  tools/perf/arch/powerpc/util/header.c    |  4 +-
>  tools/perf/arch/riscv/util/header.c      |  4 +-
>  tools/perf/arch/s390/util/header.c       |  6 +-
>  tools/perf/arch/x86/util/auxtrace.c      |  3 +-
>  tools/perf/arch/x86/util/header.c        |  5 +-
>  tools/perf/bench/numa.c                  | 51 +++++++++++++++

Meet error when build perf tool:

  CC      util/levenshtein.o
  CC      tests/mem.o
  CC      util/mmap.o
bench/numa.c: In function ‘is_cpu_online’:
bench/numa.c:550:21: error: storage size of ‘statbuf’ isn’t known
  550 |         struct stat statbuf;
      |                     ^~~~~~~
bench/numa.c:554:13: error: implicit declaration of function ‘stat’; did you mean ‘strcat’? [-Werror=implicit-function-declaration]
  554 |         if (stat(buf, &statbuf) != 0)
      |             ^~~~
      |             strcat
bench/numa.c:578:13: error: implicit declaration of function ‘sysfs__read_str’ [-Werror=implicit-function-declaration]
  578 |         if (sysfs__read_str(buf, &str, &strlen) < 0)
      |             ^~~~~~~~~~~~~~~
bench/numa.c:550:21: error: unused variable ‘statbuf’ [-Werror=unused-variable]
  550 |         struct stat statbuf;
      |                     ^~~~~~~
  CC      tests/cpumap.o
  CC      tests/stat.o

After remove these errors, my issue is disappeared.

Thanks,
Xu Yang

>  tools/perf/builtin-kvm.c                 |  4 +-
>  tools/perf/pmu-events/empty-pmu-events.c | 39 ++++++-----
>  tools/perf/pmu-events/jevents.py         | 39 ++++++-----
>  tools/perf/pmu-events/pmu-events.h       |  2 +-
>  tools/perf/tests/expr.c                  |  5 +-
>  tools/perf/util/env.c                    |  4 +-
>  tools/perf/util/expr.c                   |  6 +-
>  tools/perf/util/header.c                 | 82 ++++++++----------------
>  tools/perf/util/header.h                 | 23 +++----
>  tools/perf/util/pmu.c                    | 25 --------
>  tools/perf/util/pmu.h                    |  2 -
>  tools/perf/util/probe-event.c            |  1 +
>  22 files changed, 187 insertions(+), 229 deletions(-)
> 
> -- 
> 2.47.0.199.ga7371fff76-goog
> 

  parent reply	other threads:[~2024-11-07  9:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07  7:15 [PATCH v1 0/7] Refactor cpuid and metric table lookup code Ian Rogers
2024-11-07  7:15 ` [PATCH v1 1/7] perf header: Move is_cpu_online to numa bench Ian Rogers
2024-11-07  7:15 ` [PATCH v1 2/7] perf header: Refactor get_cpuid to take a CPU for ARM Ian Rogers
2024-11-07  7:15 ` [PATCH v1 3/7] perf arm64 header: Use cpu argument in get_cpuid Ian Rogers
2024-11-07  7:15 ` [PATCH v1 4/7] perf header: Avoid transitive PMU includes Ian Rogers
2024-11-07  7:15 ` [PATCH v1 5/7] perf header: Pass a perf_cpu rather than a PMU to get_cpuid_str Ian Rogers
2024-11-07  7:15 ` [PATCH v1 6/7] perf jevents: Add map_for_cpu Ian Rogers
2024-11-07  7:16 ` [PATCH v1 7/7] perf pmu: Move pmu_metrics_table__find and remove ARM override Ian Rogers
2024-11-07  9:03 ` Xu Yang [this message]
2024-11-07 15:57   ` [PATCH v1 0/7] Refactor cpuid and metric table lookup code Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241107082807.ipb7xzqvs24tto2e@hippo \
    --to=xu.yang_2@nxp.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=ben717@andestech.com \
    --cc=bgray@linux.ibm.com \
    --cc=chenhuacai@kernel.org \
    --cc=clement.legoffic@foss.st.com \
    --cc=dima@secretsauce.net \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@treblig.org \
    --cc=maobibo@loongson.cn \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.com \
    --cc=will@kernel.org \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).