mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
perf lock contention: Update total/bad stats for hidden entries
When -E option is used, it only prints the given number of entries but the event stat at the end should have the numbers for entire entries. Likewise, -S option will hide entries that don't have the named function in the callstack. Also update event stat for them. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Hao Luo <haoluo@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Song Liu <song@kernel.org> Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230406210611.1622492-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
954cdac74e
commit
aae7e4534a
3 changed files with 15 additions and 1 deletions
|
@ -1726,6 +1726,17 @@ static void print_contention_result(struct lock_contention *con)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (print_nr_entries) {
|
||||||
|
/* update the total/bad stats */
|
||||||
|
while ((st = pop_from_result())) {
|
||||||
|
total += use_bpf ? st->nr_contended : 1;
|
||||||
|
if (st->broken)
|
||||||
|
bad++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* some entries are collected but hidden by the callstack filter */
|
||||||
|
total += con->nr_filtered;
|
||||||
|
|
||||||
if (use_bpf)
|
if (use_bpf)
|
||||||
print_bpf_events(total, &con->fails);
|
print_bpf_events(total, &con->fails);
|
||||||
else
|
else
|
||||||
|
|
|
@ -299,8 +299,10 @@ int lock_contention_read(struct lock_contention *con)
|
||||||
if (con->save_callstack) {
|
if (con->save_callstack) {
|
||||||
bpf_map_lookup_elem(stack, &key.stack_id, stack_trace);
|
bpf_map_lookup_elem(stack, &key.stack_id, stack_trace);
|
||||||
|
|
||||||
if (!match_callstack_filter(machine, stack_trace))
|
if (!match_callstack_filter(machine, stack_trace)) {
|
||||||
|
con->nr_filtered += data.count;
|
||||||
goto next;
|
goto next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (con->aggr_mode) {
|
switch (con->aggr_mode) {
|
||||||
|
|
|
@ -141,6 +141,7 @@ struct lock_contention {
|
||||||
int stack_skip;
|
int stack_skip;
|
||||||
int aggr_mode;
|
int aggr_mode;
|
||||||
int owner;
|
int owner;
|
||||||
|
int nr_filtered;
|
||||||
bool save_callstack;
|
bool save_callstack;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue