From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752897AbcAGKqF (ORCPT ); Thu, 7 Jan 2016 05:46:05 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33274 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbcAGKqC (ORCPT ); Thu, 7 Jan 2016 05:46:02 -0500 Date: Thu, 7 Jan 2016 19:45:07 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Stephane Eranian , Andi Kleen , Masami Hiramatsu , Wang Nan Subject: Re: [RFC/PATCH v2] perf report: Show random usage tip on the help line Message-ID: <20160107104507.GA5499@danjae.kornet> References: <1452152782-26892-1-git-send-email-namhyung@kernel.org> <20160107080717.GC20434@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160107080717.GC20434@krava.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 07, 2016 at 09:07:17AM +0100, Jiri Olsa wrote: > On Thu, Jan 07, 2016 at 04:46:22PM +0900, Namhyung Kim wrote: > > SNIP > > > > > struct callchain_param callchain_param = { > > .mode = CHAIN_GRAPH_ABS, > > @@ -663,3 +665,28 @@ fetch_kernel_version(unsigned int *puint, char *str, > > *puint = (version << 16) + (patchlevel << 8) + sublevel; > > return 0; > > } > > + > > +const char *perf_report_tip(const char *dirname) > > +{ > > + struct strlist *tips; > > + struct str_node *node; > > + char *tip = NULL; > > + struct strlist_config conf = { > > + .dirname = system_path(dirname) , > > + }; > > + > > + tips = strlist__new("tips.txt", &conf); > > + if (tips == NULL || strlist__nr_entries(tips) == 1) { > > + tip = (char *)"Cannot find tips.txt file"; > > + goto out; > > could we also try to read "./Documentation/tips.txt" ? > > so people who don't install perf and run it from 'tools/perf' > get some tips as well? ;-) I thought about that too. But using relative path is not a good idea IMHO since there's no guarantee we're in the perf source directory. Maybe we can path $srcdir or so, but given that only *very* few people like you will need it, I'd rather not doing that. :) Thanks, Namhyung > > [jolsa@krava perf]$ ./perf report --stdio | tail -3 > # > # (Cannot find tips.txt file) > # > [jolsa@krava perf]$ > > thanks, > jirka