* [PATCH v1 0/6] Various 32-bit and test fixes
@ 2024-08-31 7:04 Ian Rogers
2024-08-31 7:04 ` [PATCH v1 1/6] perf pmus: Fix name comparisons on 32-bit systems Ian Rogers
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
Running `perf test` as an i386 executable yielded a number of
failures, some of which are addressed here.
The first 2 are straightforward use strtoull issues when parsing a
64-bit quantity in 32-bit land.
The 3rd patch just avoids a fail when `perf probe` isn't compiled in
(in my case as LIBELF wasn't present).
The 4th and 5th cases fix the breakpoint length, on i386 so the
sizeof(long) used matches the kernel's sizeof(long). On aarch64 the
value is change to 4 instead of sizeof(long), ie 8, as future kernels
may make 8 an invalid argument.
The final change addresses i386 watchpoint support not supporting
8-byte values.
Ian Rogers (6):
perf pmus: Fix name comparisons on 32-bit systems
perf time-utils: Fix 32-bit nsec parsing
perf test: Skip uprobe test if probe command isn't present
perf parse-events: Add default_breakpoint_len helper
perf parse-events: Vary default_breakpoint_len on i386 and arm64
perf test: Make watchpoint data 32-bits on i386
tools/perf/tests/bp_account.c | 4 +++-
tools/perf/tests/bp_signal.c | 3 ++-
tools/perf/tests/bp_signal_overflow.c | 3 ++-
tools/perf/tests/parse-events.c | 3 ++-
.../shell/test_uprobe_from_different_cu.sh | 7 ++++++
tools/perf/tests/wp.c | 5 ++++
tools/perf/util/parse-events.c | 23 ++++++++++++++++++-
tools/perf/util/parse-events.h | 2 ++
tools/perf/util/pmus.c | 6 ++---
tools/perf/util/time-utils.c | 4 ++--
10 files changed, 50 insertions(+), 10 deletions(-)
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 1/6] perf pmus: Fix name comparisons on 32-bit systems
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
@ 2024-08-31 7:04 ` Ian Rogers
2024-08-31 7:04 ` [PATCH v1 2/6] perf time-utils: Fix 32-bit nsec parsing Ian Rogers
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
The hex PMU suffix maybe 64-bit but the comparisons were "unsigned
long" or 32-bit on 32-bit systems. This was causing the "PMU name
comparison" test to fail in a 32-bit build.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/pmus.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
index 3fcabfd8fca1..769b920d9250 100644
--- a/tools/perf/util/pmus.c
+++ b/tools/perf/util/pmus.c
@@ -69,7 +69,7 @@ size_t pmu_name_len_no_suffix(const char *str)
int pmu_name_cmp(const char *lhs_pmu_name, const char *rhs_pmu_name)
{
- unsigned long lhs_num = 0, rhs_num = 0;
+ unsigned long long lhs_num = 0, rhs_num = 0;
size_t lhs_pmu_name_len = pmu_name_len_no_suffix(lhs_pmu_name);
size_t rhs_pmu_name_len = pmu_name_len_no_suffix(rhs_pmu_name);
int ret = strncmp(lhs_pmu_name, rhs_pmu_name,
@@ -79,9 +79,9 @@ int pmu_name_cmp(const char *lhs_pmu_name, const char *rhs_pmu_name)
return ret;
if (lhs_pmu_name_len + 1 < strlen(lhs_pmu_name))
- lhs_num = strtoul(&lhs_pmu_name[lhs_pmu_name_len + 1], NULL, 16);
+ lhs_num = strtoull(&lhs_pmu_name[lhs_pmu_name_len + 1], NULL, 16);
if (rhs_pmu_name_len + 1 < strlen(rhs_pmu_name))
- rhs_num = strtoul(&rhs_pmu_name[rhs_pmu_name_len + 1], NULL, 16);
+ rhs_num = strtoull(&rhs_pmu_name[rhs_pmu_name_len + 1], NULL, 16);
return lhs_num < rhs_num ? -1 : (lhs_num > rhs_num ? 1 : 0);
}
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 2/6] perf time-utils: Fix 32-bit nsec parsing
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
2024-08-31 7:04 ` [PATCH v1 1/6] perf pmus: Fix name comparisons on 32-bit systems Ian Rogers
@ 2024-08-31 7:04 ` Ian Rogers
2024-08-31 7:04 ` [PATCH v1 3/6] perf test: Skip uprobe test if probe command isn't present Ian Rogers
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
The "time utils" test fails in 32-bit builds:
```
...
parse_nsec_time("18446744073.709551615")
Failed. ptime 4294967295709551615 expected 18446744073709551615
...
```
Switch strtoul to strtoull as an unsigned long in 32-bit build isn't
64-bits.
Fixes: c284d669a20d ("perf tools: Move parse_nsec_time to time-utils.c")
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/time-utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
index 302443921681..1b91ccd4d523 100644
--- a/tools/perf/util/time-utils.c
+++ b/tools/perf/util/time-utils.c
@@ -20,7 +20,7 @@ int parse_nsec_time(const char *str, u64 *ptime)
u64 time_sec, time_nsec;
char *end;
- time_sec = strtoul(str, &end, 10);
+ time_sec = strtoull(str, &end, 10);
if (*end != '.' && *end != '\0')
return -1;
@@ -38,7 +38,7 @@ int parse_nsec_time(const char *str, u64 *ptime)
for (i = strlen(nsec_buf); i < 9; i++)
nsec_buf[i] = '0';
- time_nsec = strtoul(nsec_buf, &end, 10);
+ time_nsec = strtoull(nsec_buf, &end, 10);
if (*end != '\0')
return -1;
} else
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 3/6] perf test: Skip uprobe test if probe command isn't present
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
2024-08-31 7:04 ` [PATCH v1 1/6] perf pmus: Fix name comparisons on 32-bit systems Ian Rogers
2024-08-31 7:04 ` [PATCH v1 2/6] perf time-utils: Fix 32-bit nsec parsing Ian Rogers
@ 2024-08-31 7:04 ` Ian Rogers
2024-08-31 7:04 ` [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper Ian Rogers
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
The probe command is dependent on libelf. Skip the test if the
required probe command isn't present.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/shell/test_uprobe_from_different_cu.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
index 82bc774a078a..33387c329f92 100755
--- a/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
+++ b/tools/perf/tests/shell/test_uprobe_from_different_cu.sh
@@ -4,6 +4,13 @@
set -e
+# Skip if there's no probe command.
+if ! perf | grep probe
+then
+ echo "Skip: probe command isn't present"
+ exit 2
+fi
+
# skip if there's no gcc
if ! [ -x "$(command -v gcc)" ]; then
echo "failed: no gcc compiler"
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
` (2 preceding siblings ...)
2024-08-31 7:04 ` [PATCH v1 3/6] perf test: Skip uprobe test if probe command isn't present Ian Rogers
@ 2024-08-31 7:04 ` Ian Rogers
2024-09-01 12:47 ` kernel test robot
2024-08-31 7:04 ` [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64 Ian Rogers
2024-08-31 7:04 ` [PATCH v1 6/6] perf test: Make watchpoint data 32-bits on i386 Ian Rogers
5 siblings, 1 reply; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
The default breakpoint length is "sizeof(long)" however this is
incorrect on platforms like Aarch64 where sizeof(long) is 8 but the
breakpoint length is 4. Add a helper function that can be used to
determine the correct breakpoint length, in this change it just
returns the existing default sizeof(long) value.
Use the helper in the bp_account test so that, when modifying the
event from a watchpoint to a breakpoint, the breakpoint length is
appropriate for the architecture and not just sizeof(long).
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/bp_account.c | 4 +++-
tools/perf/tests/bp_signal.c | 3 ++-
tools/perf/tests/bp_signal_overflow.c | 3 ++-
tools/perf/tests/parse-events.c | 3 ++-
tools/perf/util/parse-events.c | 7 ++++++-
tools/perf/util/parse-events.h | 2 ++
6 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c
index 6f921db33cf9..4cb7d486b5c1 100644
--- a/tools/perf/tests/bp_account.c
+++ b/tools/perf/tests/bp_account.c
@@ -16,6 +16,7 @@
#include "tests.h"
#include "debug.h"
#include "event.h"
+#include "parse-events.h"
#include "../perf-sys.h"
#include "cloexec.h"
@@ -50,7 +51,7 @@ static int __event(bool is_x, void *addr, struct perf_event_attr *attr)
attr->config = 0;
attr->bp_type = is_x ? HW_BREAKPOINT_X : HW_BREAKPOINT_W;
attr->bp_addr = (unsigned long) addr;
- attr->bp_len = sizeof(long);
+ attr->bp_len = is_x ? default_breakpoint_len() : sizeof(long);
attr->sample_period = 1;
attr->sample_type = PERF_SAMPLE_IP;
@@ -92,6 +93,7 @@ static int bp_accounting(int wp_cnt, int share)
attr_mod = attr;
attr_mod.bp_type = HW_BREAKPOINT_X;
attr_mod.bp_addr = (unsigned long) test_function;
+ attr_mod.bp_len = default_breakpoint_len();
ret = ioctl(fd[0], PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr_mod);
TEST_ASSERT_VAL("failed to modify wp\n", ret == 0);
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index 1f2908f02389..3faeb5b6fe0b 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -26,6 +26,7 @@
#include "tests.h"
#include "debug.h"
#include "event.h"
+#include "parse-events.h"
#include "perf-sys.h"
#include "cloexec.h"
@@ -111,7 +112,7 @@ static int __event(bool is_x, void *addr, int sig)
pe.config = 0;
pe.bp_type = is_x ? HW_BREAKPOINT_X : HW_BREAKPOINT_W;
pe.bp_addr = (unsigned long) addr;
- pe.bp_len = sizeof(long);
+ pe.bp_len = is_x ? default_breakpoint_len() : sizeof(long);
pe.sample_period = 1;
pe.sample_type = PERF_SAMPLE_IP;
diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c
index 4e897c2cf26b..ee560e156be6 100644
--- a/tools/perf/tests/bp_signal_overflow.c
+++ b/tools/perf/tests/bp_signal_overflow.c
@@ -25,6 +25,7 @@
#include "tests.h"
#include "debug.h"
#include "event.h"
+#include "parse-events.h"
#include "../perf-sys.h"
#include "cloexec.h"
@@ -88,7 +89,7 @@ static int test__bp_signal_overflow(struct test_suite *test __maybe_unused, int
pe.config = 0;
pe.bp_type = HW_BREAKPOINT_X;
pe.bp_addr = (unsigned long) test_function;
- pe.bp_len = sizeof(long);
+ pe.bp_len = default_breakpoint_len();
pe.sample_period = THRESHOLD;
pe.sample_type = PERF_SAMPLE_IP;
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index edc2adcf1bae..0681653b12d2 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -5,6 +5,7 @@
#include <api/fs/fs.h>
#include "tests.h"
#include "debug.h"
+#include "parse-events.h"
#include "pmu.h"
#include "pmus.h"
#include <dirent.h>
@@ -262,7 +263,7 @@ static int test__checkevent_breakpoint_x(struct evlist *evlist)
TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
TEST_ASSERT_VAL("wrong bp_type",
HW_BREAKPOINT_X == evsel->core.attr.bp_type);
- TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len);
+ TEST_ASSERT_VAL("wrong bp_len", default_breakpoint_len() == (int)evsel->core.attr.bp_len);
return TEST_OK;
}
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index fab01ba54e34..dfb951bb184b 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -670,6 +670,11 @@ static int add_tracepoint_multi_sys(struct parse_events_state *parse_state,
}
#endif /* HAVE_LIBTRACEEVENT */
+int default_breakpoint_len(void)
+{
+ return sizeof(long);
+}
+
static int
parse_breakpoint_type(const char *type, struct perf_event_attr *attr)
{
@@ -728,7 +733,7 @@ int parse_events_add_breakpoint(struct parse_events_state *parse_state,
/* Provide some defaults if len is not specified */
if (!len) {
if (attr.bp_type == HW_BREAKPOINT_X)
- len = sizeof(long);
+ len = default_breakpoint_len();
else
len = HW_BREAKPOINT_LEN_4;
}
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index b735cd9e0acf..f79d076cd1bd 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -286,4 +286,6 @@ static inline bool is_sdt_event(char *str __maybe_unused)
}
#endif /* HAVE_LIBELF_SUPPORT */
+int default_breakpoint_len(void);
+
#endif /* __PERF_PARSE_EVENTS_H */
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
` (3 preceding siblings ...)
2024-08-31 7:04 ` [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper Ian Rogers
@ 2024-08-31 7:04 ` Ian Rogers
2024-09-03 14:24 ` Arnaldo Carvalho de Melo
2024-08-31 7:04 ` [PATCH v1 6/6] perf test: Make watchpoint data 32-bits on i386 Ian Rogers
5 siblings, 1 reply; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
On arm64 the breakpoint length should be 4-bytes but 8-bytes is
tolerated as perf passes that as sizeof(long). Just pass the correct
value.
On i386 the sizeof(long) check in the kernel needs to match the
kernel's long size. Check using an environment (uname checks) whether
4 or 8 bytes needs to be passed. Cache the value in a static.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/parse-events.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index dfb951bb184b..c7fe8b4167d7 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -8,6 +8,7 @@
#include <sys/ioctl.h>
#include <sys/param.h>
#include "term.h"
+#include "env.h"
#include "evlist.h"
#include "evsel.h"
#include <subcmd/parse-options.h>
@@ -672,7 +673,22 @@ static int add_tracepoint_multi_sys(struct parse_events_state *parse_state,
int default_breakpoint_len(void)
{
+#if defined(__i386__)
+ static int len;
+
+ if (len == 0) {
+ struct perf_env env = {};
+
+ perf_env__init(&env);
+ len = perf_env__kernel_is_64_bit(&env) ? sizeof(u64) : sizeof(long);
+ perf_env__exit(&env);
+ }
+ return len;
+#elif defined(__aarch64__)
+ return 4;
+#else
return sizeof(long);
+#endif
}
static int
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 6/6] perf test: Make watchpoint data 32-bits on i386
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
` (4 preceding siblings ...)
2024-08-31 7:04 ` [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64 Ian Rogers
@ 2024-08-31 7:04 ` Ian Rogers
5 siblings, 0 replies; 10+ messages in thread
From: Ian Rogers @ 2024-08-31 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Athira Rajeev,
Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
i386 only supports watchpoints up to size 4, 8 bytes causes extra
counts and test failures.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/wp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/tests/wp.c b/tools/perf/tests/wp.c
index cc8719609b19..6c178985e37f 100644
--- a/tools/perf/tests/wp.c
+++ b/tools/perf/tests/wp.c
@@ -20,7 +20,12 @@ do { \
TEST_ASSERT_VAL(text, count == val); \
} while (0)
+#ifdef __i386__
+/* Only breakpoint length less-than 8 has hardware support on i386. */
+volatile u32 data1;
+#else
volatile u64 data1;
+#endif
volatile u8 data2[3];
#ifndef __s390x__
--
2.46.0.469.g59c65b2a67-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper
2024-08-31 7:04 ` [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper Ian Rogers
@ 2024-09-01 12:47 ` kernel test robot
0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2024-09-01 12:47 UTC (permalink / raw)
To: Ian Rogers, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Adrian Hunter, Kan Liang, Athira Rajeev, Dominique Martinet,
Yang Jihong, Colin Ian King, Chaitanya S Prakash,
Masami Hiramatsu (Google), James Clark, John Garry, Junhao He,
David Ahern, linux-perf-users, linux-kernel
Cc: oe-kbuild-all
Hi Ian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on perf-tools-next/perf-tools-next]
[also build test WARNING on tip/perf/core perf-tools/perf-tools linus/master v6.11-rc5 next-20240830]
[cannot apply to acme/perf/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/perf-pmus-Fix-name-comparisons-on-32-bit-systems/20240831-150738
base: https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git perf-tools-next
patch link: https://lore.kernel.org/r/20240831070415.506194-5-irogers%40google.com
patch subject: [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202409011605.G583kE4G-lkp@intel.com/
includecheck warnings: (new ones prefixed by >>)
>> tools/perf/tests/parse-events.c: parse-events.h is included more than once.
vim +2 tools/perf/tests/parse-events.c
> 2 #include "parse-events.h"
3 #include "evsel.h"
4 #include "evlist.h"
5 #include <api/fs/fs.h>
6 #include "tests.h"
7 #include "debug.h"
> 8 #include "parse-events.h"
9 #include "pmu.h"
10 #include "pmus.h"
11 #include <dirent.h>
12 #include <errno.h>
13 #include "fncache.h"
14 #include <sys/types.h>
15 #include <sys/stat.h>
16 #include <unistd.h>
17 #include <linux/kernel.h>
18 #include <linux/hw_breakpoint.h>
19 #include <api/fs/tracing_path.h>
20
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64
2024-08-31 7:04 ` [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64 Ian Rogers
@ 2024-09-03 14:24 ` Arnaldo Carvalho de Melo
2024-09-04 5:03 ` Ian Rogers
0 siblings, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-09-03 14:24 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kan Liang,
Athira Rajeev, Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
On Sat, Aug 31, 2024 at 12:04:14AM -0700, Ian Rogers wrote:
> On arm64 the breakpoint length should be 4-bytes but 8-bytes is
> tolerated as perf passes that as sizeof(long). Just pass the correct
> value.
>
> On i386 the sizeof(long) check in the kernel needs to match the
> kernel's long size. Check using an environment (uname checks) whether
> 4 or 8 bytes needs to be passed. Cache the value in a static.
⬢[acme@toolbox perf-tools-next]$ gcc --version
gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
⬢[acme@toolbox perf-tools-next]$ gcc --version
gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
⬢[acme@toolbox perf-tools-next]$ uname -a
Linux toolbox 6.10.4-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Aug 11 15:32:50 UTC 2024 x86_64 GNU/Linux
⬢[acme@toolbox perf-tools-next]$ head /etc/os-release
NAME="Fedora Linux"
VERSION="40 (Toolbx Container Image)"
ID=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux 40 (Toolbx Container Image)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:40"
⬢[acme@toolbox perf-tools-next]$
CC /tmp/build/perf-tools-next/tests/bp_signal_overflow.o
tests/bp_signal.c: In function ‘__event’:
tests/bp_signal.c:115:28: error: operand of ‘?:’ changes signedness from ‘int’ to ‘long unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]
115 | pe.bp_len = is_x ? default_breakpoint_len() : sizeof(long);
| ^~~~~~~~~~~~~~~~~~~~~~~~
LD /tmp/build/perf-tools-next/pmu-events/pmu-events-in.o
cc1: all warnings being treated as errors
make[4]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:105: /tmp/build/perf-tools-next/tests/bp_signal.o] Error 1
CC /tmp/build/perf-tools-next/builtin-mem.o
make[4]: *** Waiting for unfinished jobs....
CC /tmp/build/perf-tools-next/util/symbol.o
CC /tmp/build/perf-tools-next/builtin-version.o
AR /tmp/build/perf-tools-next/libpmu-events.a
CC /tmp/build/perf-tools-next/util/metricgroup.o
CC /tmp/build/perf-tools-next/builtin-c2c.o
CC /tmp/build/perf-tools-next/util/header.o
make[3]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:158: tests] Error 2
make[2]: *** [Makefile.perf:777: /tmp/build/perf-tools-next/perf-test-in.o] Error 2
make[2]: *** Waiting for unfinished jobs....
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64
2024-09-03 14:24 ` Arnaldo Carvalho de Melo
@ 2024-09-04 5:03 ` Ian Rogers
0 siblings, 0 replies; 10+ messages in thread
From: Ian Rogers @ 2024-09-04 5:03 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kan Liang,
Athira Rajeev, Dominique Martinet, Yang Jihong, Colin Ian King,
Chaitanya S Prakash, Masami Hiramatsu (Google), James Clark,
John Garry, Junhao He, David Ahern, linux-perf-users,
linux-kernel
On Tue, Sep 3, 2024 at 7:24 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> On Sat, Aug 31, 2024 at 12:04:14AM -0700, Ian Rogers wrote:
> > On arm64 the breakpoint length should be 4-bytes but 8-bytes is
> > tolerated as perf passes that as sizeof(long). Just pass the correct
> > value.
> >
> > On i386 the sizeof(long) check in the kernel needs to match the
> > kernel's long size. Check using an environment (uname checks) whether
> > 4 or 8 bytes needs to be passed. Cache the value in a static.
>
> ⬢[acme@toolbox perf-tools-next]$ gcc --version
> gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> ⬢[acme@toolbox perf-tools-next]$ gcc --version
> gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> ⬢[acme@toolbox perf-tools-next]$ uname -a
> Linux toolbox 6.10.4-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Aug 11 15:32:50 UTC 2024 x86_64 GNU/Linux
> ⬢[acme@toolbox perf-tools-next]$ head /etc/os-release
> NAME="Fedora Linux"
> VERSION="40 (Toolbx Container Image)"
> ID=fedora
> VERSION_ID=40
> VERSION_CODENAME=""
> PLATFORM_ID="platform:f40"
> PRETTY_NAME="Fedora Linux 40 (Toolbx Container Image)"
> ANSI_COLOR="0;38;2;60;110;180"
> LOGO=fedora-logo-icon
> CPE_NAME="cpe:/o:fedoraproject:fedora:40"
> ⬢[acme@toolbox perf-tools-next]$
>
> CC /tmp/build/perf-tools-next/tests/bp_signal_overflow.o
> tests/bp_signal.c: In function ‘__event’:
> tests/bp_signal.c:115:28: error: operand of ‘?:’ changes signedness from ‘int’ to ‘long unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]
> 115 | pe.bp_len = is_x ? default_breakpoint_len() : sizeof(long);
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> LD /tmp/build/perf-tools-next/pmu-events/pmu-events-in.o
Teach me to build only with clang. Fixed in v2.
Thanks,
Ian
> cc1: all warnings being treated as errors
> make[4]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:105: /tmp/build/perf-tools-next/tests/bp_signal.o] Error 1
> CC /tmp/build/perf-tools-next/builtin-mem.o
> make[4]: *** Waiting for unfinished jobs....
> CC /tmp/build/perf-tools-next/util/symbol.o
> CC /tmp/build/perf-tools-next/builtin-version.o
> AR /tmp/build/perf-tools-next/libpmu-events.a
> CC /tmp/build/perf-tools-next/util/metricgroup.o
> CC /tmp/build/perf-tools-next/builtin-c2c.o
> CC /tmp/build/perf-tools-next/util/header.o
> make[3]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:158: tests] Error 2
> make[2]: *** [Makefile.perf:777: /tmp/build/perf-tools-next/perf-test-in.o] Error 2
> make[2]: *** Waiting for unfinished jobs....
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-09-04 5:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31 7:04 [PATCH v1 0/6] Various 32-bit and test fixes Ian Rogers
2024-08-31 7:04 ` [PATCH v1 1/6] perf pmus: Fix name comparisons on 32-bit systems Ian Rogers
2024-08-31 7:04 ` [PATCH v1 2/6] perf time-utils: Fix 32-bit nsec parsing Ian Rogers
2024-08-31 7:04 ` [PATCH v1 3/6] perf test: Skip uprobe test if probe command isn't present Ian Rogers
2024-08-31 7:04 ` [PATCH v1 4/6] perf parse-events: Add default_breakpoint_len helper Ian Rogers
2024-09-01 12:47 ` kernel test robot
2024-08-31 7:04 ` [PATCH v1 5/6] perf parse-events: Vary default_breakpoint_len on i386 and arm64 Ian Rogers
2024-09-03 14:24 ` Arnaldo Carvalho de Melo
2024-09-04 5:03 ` Ian Rogers
2024-08-31 7:04 ` [PATCH v1 6/6] perf test: Make watchpoint data 32-bits on i386 Ian Rogers
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).