Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3951389pxb; Mon, 21 Feb 2022 08:58:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk+bT39mbyj2NxU6CTjeg034PTrinKpMDS+Rw9vVmj4bor9WhBDymBZl+LMdE4H4+LIxcr X-Received: by 2002:a17:90a:a795:b0:1b9:2f9a:c049 with SMTP id f21-20020a17090aa79500b001b92f9ac049mr22492052pjq.240.1645462712382; Mon, 21 Feb 2022 08:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645462712; cv=none; d=google.com; s=arc-20160816; b=JLxScl+K3ziLWJAIoJ3KmxDvQhIhtKR4+agTJU/lDh+tfhXzRvDzgBJRn7jQXZ0u2O aupzgFXznHXcjBd8RT2CkSylsIDSU9j8Yo2ip72RL9fMjiBYNxkSaVt3BC75uVKcJv1I Vi6JX6oVcfqimx4LZB/GsVAOjkNRBewYVcgSrCWDKjTEqKkHvzsMhVN1D7yNMNhbqsOE mJnvBKP9Rs0SLGJ+F7tACoKuCmDY7RnhXv3d+rpsCz0LpBuTEyua5DJ5etZM2F1aGW5c FtGt0zbcnk/jL36Uou8b4LpdODvLg8j2z1bXPLyaBRXI/A6+J7Y0/cFN8/q818hjF8OF vLsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=WhaejFAF7UNAsu2tvEnjwTCPMy9jSEsI3yPMKb6waS8=; b=B6AJY4MRnApguJBNWDjny9w5a2y1WrfLoEo0DO+qMEF0NEb9wFXr6m8E7ybsqsc+3c gUjnkIQCQeGGReB1THXVOw3s2OCzINDyYWS0mIPciapU0z4oe0if2QQ7XhB71suAxiOo LMijvlXQJ/WrhGo+ZP6/oc6myZd/9R4clAfNnhh61U+OhO5eJUCuBll7E5MqLthjluOm LLZZ5RYtLb+SIdZcE5Q2y1MFRVsRJ9wnmuLOgwMAI7EzX7SzwX1nEqRJ/6jEjvS9aVWV lBqDmfQzomcxA/g9z9O9CHcyo+8Wigm8/hHtAwh1lh6SWvmd2hQc08LY788UgWJOPlrq IDig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g5L6xecS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17si2862303pju.142.2022.02.21.08.58.16; Mon, 21 Feb 2022 08:58:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g5L6xecS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230249AbiBUNZA (ORCPT + 99 others); Mon, 21 Feb 2022 08:25:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359028AbiBUNY6 (ORCPT ); Mon, 21 Feb 2022 08:24:58 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B33220C6 for ; Mon, 21 Feb 2022 05:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645449875; x=1676985875; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=BY3O+U22wmHQzj1Bw29UYgQWBmjpUnWFMJ+oi7gNy8I=; b=g5L6xecSJDD989qN9poyM0OvucHf6xkzNvnY/pHocK+dGBKgSWEe44ZT IDiBs0K4o5gX7yy9FoDRcWrH3MJWMwWCyoXh7sYjIH142Ulmk4LN9siC/ WCCGTqSol5ApFe5Bckuxuw7MGRGpz7MbOLFlKtMMx9WyLN14y93sw8pA4 2eY8xWJ6+K1wjGKnD9MNqr5e3CJZQhKSmeOdYBY3uRi4+AF0g8kHvaCmL Zb3Zsyhnab2K256XS0n95Gbi1GbvI2TITfpIbussHDkjRhoHxy9nxWw8s I8/lPNlGcYuI1R/VnXasaqn93g85J6t2bBnny+LQ1o/tN2ly4MrQ+2msS g==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="238921981" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="238921981" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 05:24:34 -0800 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="547334141" Received: from abaydur-mobl1.ccr.corp.intel.com (HELO [10.249.228.66]) ([10.249.228.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 05:24:31 -0800 Message-ID: <60253e6d-e8c5-550e-73b5-40720114c2a4@linux.intel.com> Date: Mon, 21 Feb 2022 16:24:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH core] perf data: Adding error message if perf_data__create_dir fails Content-Language: en-GB To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel , Andi Kleen , Adrian Hunter , Alexander Antonov , Alexei Budankov References: <20220218152341.5197-1-alexey.v.bayduraev@linux.intel.com> From: "Bayduraev, Alexey V" Organization: Intel Corporation In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.02.2022 1:43, Jiri Olsa wrote: > On Fri, Feb 18, 2022 at 06:23:40PM +0300, Alexey Bayduraev wrote: >> There is no notification about data directory creation failure. Add it. >> >> Signed-off-by: Alexey Bayduraev >> --- >> tools/perf/builtin-record.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c >> index 0bc6529814b2..0306d5911de2 100644 >> --- a/tools/perf/builtin-record.c >> +++ b/tools/perf/builtin-record.c >> @@ -1186,8 +1186,10 @@ static int record__mmap_evlist(struct record *rec, >> >> if (record__threads_enabled(rec)) { >> ret = perf_data__create_dir(&rec->data, evlist->core.nr_mmaps); >> - if (ret) >> + if (ret) { >> + pr_err("Failed to create data directory: %s\n", strerror(errno)); > > errno will be misleading in here, because perf_data__create_dir > calls other syscalls on error path Mostly I want to output something like: Failed to create data dir: Too many open files This will trigger the user to increase the open files limit. Would it be better to place such message to perf_data__create_dir after open() syscall? Regards, Alexey > > jirka > >> return ret; >> + } >> for (i = 0; i < evlist->core.nr_mmaps; i++) { >> if (evlist->mmap) >> evlist->mmap[i].file = &rec->data.dir.files[i]; >> -- >> 2.19.0 >>