Re: [PATCH 4/4] perf tools: Fallback to srcdir/Documentation/tips.txt

From: Arnaldo Carvalho de Melo
Date: Tue Jan 12 2016 - 10:39:35 EST


Em Tue, Jan 12, 2016 at 12:34:35PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Jan 11, 2016 at 10:18:20AM +0100, Jiri Olsa escreveu:
> > On Sat, Jan 09, 2016 at 07:16:29PM +0900, Namhyung Kim wrote:
> > > + help = perf_tip(DOCDIR);
> > > + if (help == NULL)
> > > + help = "Cannot load tips.txt file, please install perf!";
> > > + }
> >
> > hum, I can't get this one.. seems like perf_tip does
> > not retun NULL if there's no tip.txt file
>
> Neither me, fixing it up, this fallback will never take place.

With this patch on top, it works:

[root@felicio ~]# perf trace --no-inherit -e access perf report --stdio
0.094 ( 0.017 ms): access(filename: /etc/ld.so.preload, mode: R ) = -1 ENOENT No such file or directory
1.940 ( 0.008 ms): access(filename: /home/acme/etc/perfconfig, mode: R ) = -1 ENOENT No such file or directory
1.979 ( 0.004 ms): access(filename: /home/acme/etc/perfconfig, mode: R ) = -1 ENOENT No such file or directory
2.000 ( 0.004 ms): access(filename: /home/acme/etc/perfconfig, mode: R ) = -1 ENOENT No such file or directory
2.177 ( 0.006 ms): access(filename: /usr/bin/pager, mode: X ) = -1 ENOENT No such file or directory
2.189 ( 0.011 ms): access(filename: /usr/bin/less, mode: X ) = 0
17.250 ( 0.018 ms): access(filename: /home/acme/share/doc/perf-tip/tips.txt ) = -1 ENOENT No such file or directory
17.259 ( 0.006 ms): access(filename: /home/acme/git/linux/tools/perf/Documentation/tips.txt) = 0
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 5 of event 'cycles:pp'
# Event count (approx.): 24954605
#
# Overhead Command Shared Object Symbol
# ........ ....... ................ .........................
#
99.68% usleep [kernel.vmlinux] [k] vma_rb_erase
0.32% perf [kernel.vmlinux] [k] nmi_cpu_backtrace
0.00% perf [kernel.vmlinux] [k] native_write_msr_safe


#
# (Tip: To see callchains in a more compact form: perf report -g folded)
#
[root@felicio ~]#