All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bayduraev, Alexey V" <alexey.v.bayduraev@linux.intel.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexander Antonov <alexander.antonov@linux.intel.com>,
	Alexei Budankov <abudankov@huawei.com>
Subject: Re: [PATCH core] perf data: Adding error message if perf_data__create_dir fails
Date: Mon, 21 Feb 2022 16:24:28 +0300	[thread overview]
Message-ID: <60253e6d-e8c5-550e-73b5-40720114c2a4@linux.intel.com> (raw)
In-Reply-To: <YhLEHCttvXmRu78G@krava>

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 <alexey.v.bayduraev@linux.intel.com>
>> ---
>>  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
>>

  reply	other threads:[~2022-02-21 13:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 15:23 [PATCH core] perf data: Adding error message if perf_data__create_dir fails Alexey Bayduraev
2022-02-18 15:23 ` [PATCH urgent] perf data: Fix double free in perf_session__delete Alexey Bayduraev
2022-02-20 22:46   ` Jiri Olsa
2022-02-20 22:43 ` [PATCH core] perf data: Adding error message if perf_data__create_dir fails Jiri Olsa
2022-02-21 13:24   ` Bayduraev, Alexey V [this message]
2022-02-21 18:24     ` Jiri Olsa
2022-02-21 18:45       ` Bayduraev, Alexey V
2022-02-21 19:16         ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60253e6d-e8c5-550e-73b5-40720114c2a4@linux.intel.com \
    --to=alexey.v.bayduraev@linux.intel.com \
    --cc=abudankov@huawei.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.antonov@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.