Skip to content

Commit 2adad54

Browse files
committed
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
2 parents 14a244a + e162cb2 commit 2adad54

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

tools/perf/builtin-daemon.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
691691

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

696696
fprintf(out, "\n");
697697
} else {
@@ -702,7 +702,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
702702
fprintf(out, " lock: %s/lock\n",
703703
daemon->base);
704704
fprintf(out, " up: %" PRIu64 " minutes\n",
705-
(curr - daemon->start) / 60);
705+
(uint64_t)((curr - daemon->start) / 60));
706706
}
707707
}
708708

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

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

735735
fprintf(out, "\n");
736736
} else {
@@ -747,7 +747,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
747747
fprintf(out, " ack: %s/%s\n",
748748
session->base, SESSION_ACK);
749749
fprintf(out, " up: %" PRIu64 " minutes\n",
750-
(curr - session->start) / 60);
750+
(uint64_t)((curr - session->start) / 60));
751751
}
752752
}
753753

tools/perf/tests/pmu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,13 @@ static int test__name_cmp(struct test_suite *test __maybe_unused, int subtest __
456456
/**
457457
* Test perf_pmu__match() that's used to search for a PMU given a name passed
458458
* on the command line. The name that's passed may also be a filename type glob
459-
* match.
459+
* match. If the name does not match, perf_pmu__match() attempts to match the
460+
* alias of the PMU, if provided.
460461
*/
461462
static int test__pmu_match(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
462463
{
463464
struct perf_pmu test_pmu;
465+
test_pmu.alias_name = NULL;
464466

465467
test_pmu.name = "pmuname";
466468
TEST_ASSERT_EQUAL("Exact match", perf_pmu__match(&test_pmu, "pmuname"), true);

tools/perf/util/bpf_lock_contention.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ static void account_end_timestamp(struct lock_contention *con)
286286
goto next;
287287

288288
for (int i = 0; i < total_cpus; i++) {
289+
if (cpu_data[i].lock == 0)
290+
continue;
291+
289292
update_lock_stat(stat_fd, -1, end_ts, aggr_mode,
290293
&cpu_data[i]);
291294
}

tools/perf/util/python.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "util/env.h"
2121
#include "util/kvm-stat.h"
2222
#include "util/kwork.h"
23+
#include "util/sample.h"
2324
#include "util/lock-contention.h"
2425
#include <internal/lib.h>
2526
#include "../builtin.h"

0 commit comments

Comments
 (0)