Commit 2adad548 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'perf-tools-fixes-for-v6.11-2024-09-04' of...

Merge tag 'perf-tools-fixes-for-v6.11-2024-09-04' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools

Pull perf tools fixes from Namhyung Kim:
 "A number of small fixes for the late cycle:

   - Two more build fixes on 32-bit archs

   - Fixed a segfault during perf test

   - Fixed spinlock/rwlock accounting bug in perf lock contention"

* tag 'perf-tools-fixes-for-v6.11-2024-09-04' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools:
  perf daemon: Fix the build on more 32-bit architectures
  perf python: include "util/sample.h"
  perf lock contention: Fix spinlock and rwlock accounting
  perf test pmu: Set uninitialized PMU alias to null
parents 14a244a9 e162cb25
...@@ -691,7 +691,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) ...@@ -691,7 +691,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
fprintf(out, "%c%" PRIu64, fprintf(out, "%c%" PRIu64,
/* session up time */ /* session up time */
csv_sep, (curr - daemon->start) / 60); csv_sep, (uint64_t)((curr - daemon->start) / 60));
fprintf(out, "\n"); fprintf(out, "\n");
} else { } else {
...@@ -702,7 +702,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) ...@@ -702,7 +702,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
fprintf(out, " lock: %s/lock\n", fprintf(out, " lock: %s/lock\n",
daemon->base); daemon->base);
fprintf(out, " up: %" PRIu64 " minutes\n", fprintf(out, " up: %" PRIu64 " minutes\n",
(curr - daemon->start) / 60); (uint64_t)((curr - daemon->start) / 60));
} }
} }
...@@ -730,7 +730,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) ...@@ -730,7 +730,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
fprintf(out, "%c%" PRIu64, fprintf(out, "%c%" PRIu64,
/* session up time */ /* session up time */
csv_sep, (curr - session->start) / 60); csv_sep, (uint64_t)((curr - session->start) / 60));
fprintf(out, "\n"); fprintf(out, "\n");
} else { } else {
...@@ -747,7 +747,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) ...@@ -747,7 +747,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
fprintf(out, " ack: %s/%s\n", fprintf(out, " ack: %s/%s\n",
session->base, SESSION_ACK); session->base, SESSION_ACK);
fprintf(out, " up: %" PRIu64 " minutes\n", fprintf(out, " up: %" PRIu64 " minutes\n",
(curr - session->start) / 60); (uint64_t)((curr - session->start) / 60));
} }
} }
......
...@@ -456,11 +456,13 @@ static int test__name_cmp(struct test_suite *test __maybe_unused, int subtest __ ...@@ -456,11 +456,13 @@ static int test__name_cmp(struct test_suite *test __maybe_unused, int subtest __
/** /**
* Test perf_pmu__match() that's used to search for a PMU given a name passed * Test perf_pmu__match() that's used to search for a PMU given a name passed
* on the command line. The name that's passed may also be a filename type glob * on the command line. The name that's passed may also be a filename type glob
* match. * match. If the name does not match, perf_pmu__match() attempts to match the
* alias of the PMU, if provided.
*/ */
static int test__pmu_match(struct test_suite *test __maybe_unused, int subtest __maybe_unused) static int test__pmu_match(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_pmu test_pmu; struct perf_pmu test_pmu;
test_pmu.alias_name = NULL;
test_pmu.name = "pmuname"; test_pmu.name = "pmuname";
TEST_ASSERT_EQUAL("Exact match", perf_pmu__match(&test_pmu, "pmuname"), true); TEST_ASSERT_EQUAL("Exact match", perf_pmu__match(&test_pmu, "pmuname"), true);
......
...@@ -286,6 +286,9 @@ static void account_end_timestamp(struct lock_contention *con) ...@@ -286,6 +286,9 @@ static void account_end_timestamp(struct lock_contention *con)
goto next; goto next;
for (int i = 0; i < total_cpus; i++) { for (int i = 0; i < total_cpus; i++) {
if (cpu_data[i].lock == 0)
continue;
update_lock_stat(stat_fd, -1, end_ts, aggr_mode, update_lock_stat(stat_fd, -1, end_ts, aggr_mode,
&cpu_data[i]); &cpu_data[i]);
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "util/env.h" #include "util/env.h"
#include "util/kvm-stat.h" #include "util/kvm-stat.h"
#include "util/kwork.h" #include "util/kwork.h"
#include "util/sample.h"
#include "util/lock-contention.h" #include "util/lock-contention.h"
#include <internal/lib.h> #include <internal/lib.h>
#include "../builtin.h" #include "../builtin.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment