From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755924AbdDMTgB (ORCPT ); Thu, 13 Apr 2017 15:36:01 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:60251 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755626AbdDMTft (ORCPT ); Thu, 13 Apr 2017 15:35:49 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, David Carrillo-Cisneros , Alexander Shishkin , Andi Kleen , He Kuang , Masami Hiramatsu , Paul Turner , Peter Zijlstra , Simon Que , Stephane Eranian , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 6/7] perf util: Hint missing file when tool tips fail to load Date: Thu, 13 Apr 2017 16:35:35 -0300 Message-Id: <20170413193536.3667-7-acme@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170413193536.3667-1-acme@kernel.org> References: <20170413193536.3667-1-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Carrillo-Cisneros Besides memory allocation failure, tips.txt may fail to load because the file is not found (a more likely cause). Communicate that to the user in tips failure warning. Signed-off-by: David Carrillo-Cisneros Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: He Kuang Cc: Masami Hiramatsu Cc: Paul Turner Cc: Peter Zijlstra Cc: Simon Que Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/r/20170412064919.92449-5-davidcc@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index d8b45cea54d0..6097d87429e2 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -696,7 +696,8 @@ const char *perf_tip(const char *dirpath) tips = strlist__new("tips.txt", &conf); if (tips == NULL) - return errno == ENOENT ? NULL : "Tip: get more memory! ;-p"; + return errno == ENOENT ? NULL : + "Tip: check path of tips.txt or get more memory! ;-p"; if (strlist__nr_entries(tips) == 0) goto out; -- 2.9.3