Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1944781yba; Mon, 15 Apr 2019 01:29:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOAn9/R9eeKoTC26tDjOHn13vIezjTxV/ApeVr+3m1B0RYKgWzxiaYU2whYod7VC/Df8tt X-Received: by 2002:a63:fd06:: with SMTP id d6mr69046983pgh.183.1555316948900; Mon, 15 Apr 2019 01:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555316948; cv=none; d=google.com; s=arc-20160816; b=P9KvAO81QiBts/ybE9R0nCk2uU1cO25H5H+vGzysTuQMAdTM6+b+IaZpH/3SAeG2fG +5vWNX8G7hZGuZL9i8GfkKdqn/X74Zj6aGrXUpHQkPPJ75MP9lD9WbVR5n0yzv6JMFve aoaQZ7RyNc4pj4GJOe+7z3kddaIp7PAbUgaetUMrQRfUqOtJkn+yWtRM5NpZFk87MWtv Hstc9a10SeLahsg4TFDJmNESMWSCILL7qjAilbNWi86FEqfdxYM7jI8MDVLYiY3uu+vf 3XYnGFLR7rWOkE68TzdIjXVwcoSh6ZhfIJdzDCwH1WBwu9OpsnkqjGN17VxUmGh0sd0f vP1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hiF/fB2OB0wCILcz64eOcPiWFoCvrBWVgrq/ed9ZkDQ=; b=dudfy5qzc3DoPiPcido+nylaOtUkda5ph70dSC1dRSbjPT9dU4hUtagUXRg5QRp6Az AHUCF7fchNKmqhJOjNoPzs282wZmVC+trEDjQfcMIhKdrvQzpcNAvKBaPP7G4uh77RBr zOXeAzpxHqDlge0cZ35MRQZGp/Qbjdf0NrPPPPXbIbjYBhS+pJRQ5/UnzjcCJCW2bpT2 IMN/j7bSkhdZOp6YKi6VUDvG8Kh/xA804c8GeGRnct/IKD05AFiW4Xq1Go8x+lizeMJY JtSbdN73QwX6oRa/4UO5XJ7cxocS1fPsDtrDX4u+pg/6eJMVVlrMOxp+LeHrR2NOw3LH QBIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si27658909plt.161.2019.04.15.01.28.52; Mon, 15 Apr 2019 01:29:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726531AbfDOI2M (ORCPT + 99 others); Mon, 15 Apr 2019 04:28:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfDOI2L (ORCPT ); Mon, 15 Apr 2019 04:28:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A30DCC05D3F9; Mon, 15 Apr 2019 08:28:11 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29ED56013A; Mon, 15 Apr 2019 08:28:09 +0000 (UTC) Date: Mon, 15 Apr 2019 10:28:09 +0200 From: Jiri Olsa To: Thomas-Mich Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: Re: [PATCH] perf/report: [RFC] Handling OOM in perf report Message-ID: <20190415082809.GA13124@krava> References: <20190401142000.17679-1-tmricht@linux.ibm.com> <20190409104205.GB29688@krava> <06273b1f-faea-5d88-1696-eb686ef47a6c@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <06273b1f-faea-5d88-1696-eb686ef47a6c@linux.ibm.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 15 Apr 2019 08:28:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 10, 2019 at 09:17:30AM +0200, Thomas-Mich Richter wrote: SNIP > > > > > > --- > > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > > index b17f1c9bc965..eea247a26ad8 100644 > > --- a/tools/perf/util/session.c > > +++ b/tools/perf/util/session.c > > @@ -1933,7 +1933,7 @@ reader__process_events(struct reader *rd, struct perf_session *session, > > pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", > > file_offset + head, event->header.size, > > event->header.type); > > - err = -EINVAL; > > + err = skip; > > goto out; > > } > > > > > > Above patch does not help, you simply return -ENOMEM instead of -EINVAL and processing > stops with no indication that perf ran out of memory. Bailing out in this case is ok. > > I am fine with your patch, as long as it gives a reason why processing stopped. > In the GUI it shows on the bottom line the reason: > > 0xf4198 [0x8]: failed to process type: 68 [Cannot allocate memory] looks good, please post the full patch thanks, jirka > > > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > index b17f1c9bc965..e89716175588 100644 > --- a/tools/perf/util/session.c > +++ b/tools/perf/util/session.c > @@ -1930,10 +1930,10 @@ reader__process_events(struct reader *rd, struct perf_session *session, > > if (size < sizeof(struct perf_event_header) || > (skip = rd->process(session, event, file_pos)) < 0) { > - pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", > + pr_err("%#" PRIx64 " [%#x]: failed to process type: %d [%s]\n", > file_offset + head, event->header.size, > - event->header.type); > - err = -EINVAL; > + event->header.type, strerror(-skip)); > + err = skip; > goto out; > } > > [root@m35lp76 perf]# > -- > Thomas Richter, Dept 3252, IBM s390 Linux Development, Boeblingen, Germany > -- > Vorsitzender des Aufsichtsrats: Matthias Hartmann > Gesch?ftsf?hrung: Dirk Wittkopp > Sitz der Gesellschaft: B?blingen / Registergericht: Amtsgericht Stuttgart, HRB 243294 >