android_kernel_samsung_univ.../tools/perf/util
Ravi Bangoria a6a3f3ddf6 perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data
commit 3caeaa562733c4836e61086ec07666635006a787 upstream.

While recording guest samples in host using perf kvm record, it will
populate unprocessable sample error, though samples will be recorded
properly. While generating report using perf kvm report, no samples will
be processed and same error will populate. We have seen this behaviour
with upstream perf(4.4-rc3) on x86 and ppc64 hardware.

Reason behind this failure is, when it tries to fetch machine from
rb_tree of machines, it fails. As a part of tracing a bug, we figured
out that this code was incorrectly refactored in commit 54245fdc35
("perf session: Remove wrappers to machines__find").

This patch will change the functionality such that if it can't fetch
machine in first trial, it will create one node of machine and add that to
rb_tree. So next time when it tries to fetch same machine from rb_tree,
it won't fail. Actually it was the case before refactoring of code in
aforementioned commit.

This patch is generated from acme perf/core branch.

Below I've mention an example that demonstrate the behaviour before and
after applying patch.

Before applying patch:
[Note: One needs to run guest before recording data in host]

  ravi@ravi-bangoria:~$ ./perf kvm record -a
  Warning:
  5903 unprocessable samples recorded.
  Do you have a KVM guest running and not using 'perf kvm'?
  [ perf record: Captured and wrote 1.409 MB perf.data.guest (285 samples) ]

  ravi@ravi-bangoria:~$ ./perf kvm report --stdio
  Warning:
  5903 unprocessable samples recorded.
  Do you have a KVM guest running and not using 'perf kvm'?
  # To display the perf.data header info, please use --header/--header-only options.
  #
  # Total Lost Samples: 0
  #
  # Samples: 285  of event 'cycles'
  # Event count (approx.): 88715406
  #
  # Overhead  Command  Shared Object  Symbol
  # ........  .......  .............  ......
  #

  # (For a higher level overview, try: perf report --sort comm,dso)
  #

After applying patch:

  ravi@ravi-bangoria:~$ ./perf kvm record -a
  [ perf record: Captured and wrote 1.188 MB perf.data.guest (17 samples) ]

  ravi@ravi-bangoria:~$ ./perf kvm report --stdio
  # To display the perf.data header info, please use --header/--header-only options.
  #
  # Total Lost Samples: 0
  #
  # Samples: 17  of event 'cycles'
  # Event count (approx.): 700746
  #
  # Overhead  Command  Shared Object     Symbol
  # ........  .......  ................  ......................
  #
      34.19%  :5758    [unknown]         [g] 0xffffffff818682ab
      22.79%  :5758    [unknown]         [g] 0xffffffff812dc7f8
      22.79%  :5758    [unknown]         [g] 0xffffffff818650d0
      14.83%  :5758    [unknown]         [g] 0xffffffff8161a1b6
       2.49%  :5758    [unknown]         [g] 0xffffffff818692bf
       0.48%  :5758    [unknown]         [g] 0xffffffff81869253
       0.05%  :5758    [unknown]         [g] 0xffffffff81869250

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Fixes: 54245fdc35 ("perf session: Remove wrappers to machines__find")
Link: http://lkml.kernel.org/r/1449471302-11283-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 12:01:20 -08:00
..
include
intel-pt-decoder
scripting-engines
abspath.c
alias.c
annotate.c perf annotate: Support full source file paths for srcline fix 2015-11-11 18:41:30 -03:00
annotate.h
auxtrace.c
auxtrace.h
bitmap.c
bpf-loader.c perf test: Add 'perf test BPF' 2015-11-06 17:50:03 -03:00
bpf-loader.h perf test: Add 'perf test BPF' 2015-11-06 17:50:03 -03:00
Build perf tools: Enable passing bpf object file to --event 2015-10-28 12:48:12 -03:00
build-id.c perf buildid-list: Show running kernel build id fix 2015-12-07 12:02:10 -03:00
build-id.h
cache.h
callchain.c perf tools: Defaults to 'caller' callchain order only if --children is enabled 2015-10-22 15:40:11 -03:00
callchain.h perf tools: Improve call graph documents and help messages 2015-10-22 16:23:19 -03:00
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c
comm.h
config.c
counts.c
counts.h
cpumap.c perf cpu_map: Add cpu_map__empty_new function 2015-10-27 15:05:36 -03:00
cpumap.h perf cpu_map: Add cpu_map__empty_new function 2015-10-27 15:05:36 -03:00
ctype.c
data-convert-bt.c
data-convert-bt.h
data.c
data.h
db-export.c
db-export.h
debug.c
debug.h
dso.c perf symbols: Fix dso lookup by long name and missing buildids 2015-11-13 11:14:36 -03:00
dso.h perf symbols: Fix dso lookup by long name and missing buildids 2015-11-13 11:14:36 -03:00
dwarf-aux.c
dwarf-aux.h
env.c
env.h
environment.c
event.c
event.h
evlist.c
evlist.h
evsel.c perf bpf: Attach eBPF filter to perf event 2015-10-29 17:16:22 -03:00
evsel.h perf bpf: Attach eBPF filter to perf event 2015-10-29 17:16:22 -03:00
exec_cmd.c
exec_cmd.h
find-vdso-map.c
generate-cmdlist.sh
header.c
header.h
help.c
help.h
hist.c
hist.h
intel-bts.c
intel-bts.h
intel-pt.c
intel-pt.h
intlist.c
intlist.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf tools: Make fetch_kernel_version() publicly available 2015-11-06 15:57:18 -03:00
llvm-utils.h
lzma.c
machine.c perf symbols: Fix dso lookup by long name and missing buildids 2015-11-13 11:14:36 -03:00
machine.h
map.c perf tools: Insert split maps correctly into origin group 2015-11-05 11:39:38 -03:00
map.h
ordered-events.c
ordered-events.h
pager.c
parse-branch-options.c perf record: Add ability to sample call branches 2015-10-20 10:30:55 +02:00
parse-branch-options.h
parse-events.c perf tools: tracepoint_error() can receive e=NULL, robustify it 2016-02-25 12:01:16 -08:00
parse-events.h perf tools: Compile scriptlets to BPF objects when passing '.c' to --event 2015-10-29 17:16:23 -03:00
parse-events.l perf tools: Compile scriptlets to BPF objects when passing '.c' to --event 2015-10-29 17:16:23 -03:00
parse-events.y perf tools: Compile scriptlets to BPF objects when passing '.c' to --event 2015-10-29 17:16:23 -03:00
parse-options.c perf tools: Search for more options when passing args to -h 2015-10-27 17:35:58 -03:00
parse-options.h perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
parse-regs-options.c
parse-regs-options.h
path.c
perf_regs.c
perf_regs.h
PERF-VERSION-GEN
pmu.c
pmu.h
pmu.l
pmu.y
probe-event.c perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy 2015-11-06 10:47:33 -03:00
probe-event.h
probe-file.c perf probe: Verify parameters in two functions 2015-11-11 18:41:32 -03:00
probe-file.h
probe-finder.c perf probe: Clear probe_trace_event when add_probe_trace_event() fails 2015-11-13 12:28:09 -03:00
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c
quote.c
quote.h
rblist.c
rblist.h
record.c
run-command.c
run-command.h
session.c perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data 2016-02-25 12:01:20 -08:00
session.h
setup.py
sigchain.c
sigchain.h
sort.c
sort.h
srcline.c
stat-shadow.c perf stat: Move sw clock metrics printout to stat-shadow 2015-11-04 15:11:41 -03:00
stat.c
stat.h
strbuf.c perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
strbuf.h perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
strfilter.c
strfilter.h
string.c
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c
symbol-minimal.c perf symbols: Fix type error when reading a build-id 2015-10-28 10:02:00 -03:00
symbol.c perf symbols: Allow forcing reading of non-root owned files by root 2015-11-12 18:58:18 -03:00
symbol.h perf symbols: Allow forcing reading of non-root owned files by root 2015-11-12 18:58:18 -03:00
target.c
target.h
thread_map.c
thread_map.h
thread-stack.c
thread-stack.h
thread.c
thread.h
tool.h
top.c
top.h
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
tsc.c
tsc.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind.c perf unwind: Pass symbol source to libunwind 2015-10-29 17:48:38 -03:00
unwind.h
usage.c
util.c perf tools: Make fetch_kernel_version() publicly available 2015-11-06 15:57:18 -03:00
util.h perf bpf: Improve BPF related error messages 2015-11-06 17:14:20 -03:00
values.c
values.h
vdso.c
vdso.h
wrapper.c
xyarray.c
xyarray.h
zlib.c