diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2020-03-19 23:25:11 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-04-18 15:05:01 +0300 |
commit | 7f1d39317c071268b4204175df7cfbb2187acb72 (patch) | |
tree | 2454b93aa6a9c735b350a7bb9360d632393b671f /tools/perf/util/thread.h | |
parent | 9c6c3f471d85a9b0bcda3ce6fc1e2646685e3f60 (diff) | |
download | linux-7f1d39317c071268b4204175df7cfbb2187acb72.tar.xz |
perf callchain: Save previous cursor nodes for LBR stitching approach
The cursor nodes which generates from sample are eventually added into
callchain. To avoid generating cursor nodes from previous samples again,
the previous cursor nodes are also saved for LBR stitching approach.
Some option, e.g. hide-unresolved, may hide some LBRs. Add a variable
'valid' in struct callchain_cursor_node to indicate this case. The LBR
stitching approach will only append the valid cursor nodes from previous
samples later.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pavel Gerasimov <pavel.gerasimov@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vitaly Slobodskoy <vitaly.slobodskoy@intel.com>
Link: http://lore.kernel.org/lkml/20200319202517.23423-12-kan.liang@linux.intel.com
[ Use zfree() instead of open coded equivalent, and use it when freeing members of structs ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 34eb61cee6a4..8456174a52c5 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h @@ -15,6 +15,7 @@ #include <intlist.h> #include "rwsem.h" #include "event.h" +#include "callchain.h" struct addr_location; struct map; @@ -24,6 +25,7 @@ struct unwind_libunwind_ops; struct lbr_stitch { struct perf_sample prev_sample; + struct callchain_cursor_node *prev_lbr_cursor; }; struct thread { @@ -154,6 +156,12 @@ static inline bool thread__is_filtered(struct thread *thread) static inline void thread__free_stitch_list(struct thread *thread) { + struct lbr_stitch *lbr_stitch = thread->lbr_stitch; + + if (!lbr_stitch) + return; + + zfree(&lbr_stitch->prev_lbr_cursor); zfree(&thread->lbr_stitch); } |