Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3436302yba; Tue, 23 Apr 2019 03:55:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdTGUWWLe6pdf3wOKZ+CR90argKdjJamcf2e9EwdhSLxOkRMRyn+VZsLujhou6uMqLpVOU X-Received: by 2002:a17:902:6b8b:: with SMTP id p11mr25102630plk.225.1556016933381; Tue, 23 Apr 2019 03:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556016933; cv=none; d=google.com; s=arc-20160816; b=V5bj/v8pGVTzFxQpgHLR+IF7kVLFxWzdUVM8bvwijFUX7ghjfoD6hgrzCKI0LAhtOU q8OgyjZ0uWPl3KnAFrZRuksbW7DEs9i0ZtzuhChUG1w89KN/15yGRTfzuavvjRUZtOc/ RHDXyNdXAVjOk0c07CanSqaj27ZgNSMLQ0coNMn6+e8J01f+BLS9fhLXM0nvMuft6VjT HrVHojoHCCi1aOTX86+4cUh8VOfC9JWqvNAeY2RJ5nBC8SwS2asaEbmYi/1KRZdicLf6 C6hA9FYoio0b4WR/ydkDf7d2eoSTwd76TvMNFwMCIo+r3YQlkmB589b8elWxTI/LxdTS w+tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=j1eYD9w3Mai4Q0TEn11+nzz8fC7rx6aFToBqnT3jbII=; b=ERmWHC72VBb4lYzwPp4y/ZztTuuMwFc3sL5jLVdCeQbpv0lZOPaChDcbFKcnpfRqOO 0x7COcGck5gSfYzgRu606koxPqbiO1rEF/skKCECg5vi2qdE7XN7AHB3mvoItDtuhfQd GqjrXoFGpCx+SyVr8eJIpkSuk+Upw0ph4anPoti5tBC99C78vP2ULYYsfkxqQ0XKfapN mXos9wvOA3w7iKlkqukwb7niNm+Kw3Ul0Za5dITvbft+Xb7lb8Z4J7eN2qgow+atEZ3Y 9pN1+NJ2MUKhm1XGbQP2+XiIcbHE/9p75m9VfAAWQwcnqML9dwP5HQxemzXxVuCf1uGk M6ww== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si5244403pgf.272.2019.04.23.03.55.18; Tue, 23 Apr 2019 03:55:33 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727365AbfDWKxb (ORCPT + 99 others); Tue, 23 Apr 2019 06:53:31 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43956 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbfDWKxa (ORCPT ); Tue, 23 Apr 2019 06:53:30 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3NAiQIm089847 for ; Tue, 23 Apr 2019 06:53:30 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s204m39h2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 23 Apr 2019 06:53:29 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Apr 2019 11:53:27 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 23 Apr 2019 11:53:24 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3NArNaY58654952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Apr 2019 10:53:23 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C16ED42049; Tue, 23 Apr 2019 10:53:23 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6AE6542045; Tue, 23 Apr 2019 10:53:23 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 23 Apr 2019 10:53:23 +0000 (GMT) From: Thomas Richter To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org Cc: brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, jolsa@redhat.com, Thomas Richter Subject: [PATCH] perf/report: Report OOM in perf report status line Date: Tue, 23 Apr 2019 12:53:03 +0200 X-Mailer: git-send-email 2.16.4 X-TM-AS-GCONF: 00 x-cbid: 19042310-0020-0000-0000-000003329ECA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042310-0021-0000-0000-00002184FEDE Message-Id: <20190423105303.61683-1-tmricht@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-23_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904230076 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org An -ENOMEM error is not reported in the GTK GUI. Instead this error message pops up on the screen: [root@m35lp76 perf]# ./perf report -i perf.data.error68-1 Processing events... [974K/3M] Error:failed to process sample 0xf4198 [0x8]: failed to process type: 68 However when I use the same perf.data file with --stdio it works: [root@m35lp76 perf]# ./perf report -i perf.data.error68-1 --stdio \ | head -12 # Total Lost Samples: 0 # # Samples: 76K of event 'cycles' # Event count (approx.): 99056160000 # # Overhead Command Shared Object Symbol # ........ ............... ................. ......... # 8.81% find [kernel.kallsyms] [k] ftrace_likely_update 8.74% swapper [kernel.kallsyms] [k] ftrace_likely_update 8.34% sshd [kernel.kallsyms] [k] ftrace_likely_update 2.19% kworker/u512:1- [kernel.kallsyms] [k] ftrace_likely_update The sample precentage is a bit low..... The GUI always fails in the FINISHED_ROUND event (68) and does not indicate the reason why. When happened is the following. Perf report calls a lot of functions and down deep when a FINISHED_ROUND event is processed, these functions are called: perf_session__process_event() + perf_session__process_user_event() + process_finished_round() + ordered_events__flush() + __ordered_events__flush() + do_flush() + ordered_events__deliver_event() + perf_session__deliver_event() + machine__deliver_event() + perf_evlist__deliver_event() + process_sample_event() + hist_entry_iter_add() --> only called in GUI case!!! + hist_iter__report__callback() + symbol__inc_addr_sample() Now this functions runs out of memory and returns -ENOMEM. This is reported all the way up until function perf_session__process_event() returns to its caller, where -ENOMEM is changed to -EINVAL and processing stops: if ((skip = perf_session__process_event(session, event, head)) < 0) { pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", head, event->header.size, event->header.type); err = -EINVAL; goto out_err; } This occurred in the FINISHED_ROUND event when it has to process some 10000 entries and ran out of memory. This patch indicates the root cause and displays it in the status line of ther perf report GUI. Output before (on GUI status line): 0xf4198 [0x8]: failed to process type: 68 Output after: 0xf4198 [0x8]: failed to process type: 68 [not enough memory] Signed-off-by: Thomas Richter Reviewed-by: Jiri Olsa Reviewed-by: Hendrik Brueckner --- tools/perf/util/session.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.16.4