Skip to content

Commit

Permalink
Merge tag 'perf-tools-fixes-for-v6.11-2024-09-04' of git://git.kernel…
Browse files Browse the repository at this point in the history
….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
  • Loading branch information
Linus Torvalds committed Sep 4, 2024
2 parents 14a244a + e162cb2 commit 2adad54
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tools/perf/builtin-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)

fprintf(out, "%c%" PRIu64,
/* session up time */
csv_sep, (curr - daemon->start) / 60);
csv_sep, (uint64_t)((curr - daemon->start) / 60));

fprintf(out, "\n");
} else {
Expand All @@ -702,7 +702,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
fprintf(out, " lock: %s/lock\n",
daemon->base);
fprintf(out, " up: %" PRIu64 " minutes\n",
(curr - daemon->start) / 60);
(uint64_t)((curr - daemon->start) / 60));
}
}

Expand Down Expand Up @@ -730,7 +730,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)

fprintf(out, "%c%" PRIu64,
/* session up time */
csv_sep, (curr - session->start) / 60);
csv_sep, (uint64_t)((curr - session->start) / 60));

fprintf(out, "\n");
} else {
Expand All @@ -747,7 +747,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
fprintf(out, " ack: %s/%s\n",
session->base, SESSION_ACK);
fprintf(out, " up: %" PRIu64 " minutes\n",
(curr - session->start) / 60);
(uint64_t)((curr - session->start) / 60));
}
}

Expand Down
4 changes: 3 additions & 1 deletion tools/perf/tests/pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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)
{
struct perf_pmu test_pmu;
test_pmu.alias_name = NULL;

test_pmu.name = "pmuname";
TEST_ASSERT_EQUAL("Exact match", perf_pmu__match(&test_pmu, "pmuname"), true);
Expand Down
3 changes: 3 additions & 0 deletions tools/perf/util/bpf_lock_contention.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ static void account_end_timestamp(struct lock_contention *con)
goto next;

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,
&cpu_data[i]);
}
Expand Down
1 change: 1 addition & 0 deletions tools/perf/util/python.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "util/env.h"
#include "util/kvm-stat.h"
#include "util/kwork.h"
#include "util/sample.h"
#include "util/lock-contention.h"
#include <internal/lib.h>
#include "../builtin.h"
Expand Down

0 comments on commit 2adad54

Please sign in to comment.