Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp137300pxv; Thu, 24 Jun 2021 04:46:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfvPzlkhPWYQPB1XUklU+fl9j6DGROC25PXwMudd0OoxyAPeXBV23o2x1qxALTbbjV6/2v X-Received: by 2002:a05:6e02:ef0:: with SMTP id j16mr3460014ilk.144.1624535174933; Thu, 24 Jun 2021 04:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624535174; cv=none; d=google.com; s=arc-20160816; b=qatHlV3GGb1wypWOhaiaM8P/AyeUUz888dreZg72SXaPbLgfVLBv6O72ANIEbM9BA2 H0+5RZhFXM69doF1Oqz81XpMXi0+VHmOktAVu9c5zIPaRlj9Ge0nGaHcx0wAUAC000wR hTOGhxSBv+qB8lj39Y+ETTZp6eISTPbNp37HiYexqy8Cv+jiSAlTXx87d6kNXeIITbzp L15J4Sci/FwfHDioz5far+qXqzS6ymvnnBEAk3HF68jN5FWHDQxYqa5lzzwXdhzXB4OH TtVVsEpcDAp7APMvVTOeOF4KwyL+PYhPXqpH3vebhQX9E7F1UW6uxU3z+zh/KCNjwCko nn4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=oYouGLiTt3rwLbDeYQDI9r+Q+6zYi6iD1xb2Cn1pvdA=; b=USxg3U0ncwj5rqKNUMvHY9FvS/BpEZOEQRB1K5qO05TjYgwW6WzJBIumsqiK23CpRS tXV4mPXT4iiuiDjh+z87XhekAvR5RIb7SmINvCKyK7OfPk9quSKUe8QF2TdfWYo3IqF9 V/bRwghNSMHsk7wj62DkTv4dXkD/BRuoJIR9QcN1aOIj//iH70UDjKSC0dXCD7BZdWAC ySKrzWdgseUhv03V93Ntd2JtK7617al2o2JZM05VVEH8TT4Yt+18wFB6gW3js8hXf84b xs3/ao68ALxPNGzscgPV8hdYe8pRR34oAHyx5BdSYuL/BJNgP1oHCldX0V42E4teon+e CdOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N9wwO8Ez; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si3365840jak.97.2021.06.24.04.46.03; Thu, 24 Jun 2021 04:46:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N9wwO8Ez; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbhFXLrQ (ORCPT + 99 others); Thu, 24 Jun 2021 07:47:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49441 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhFXLrP (ORCPT ); Thu, 24 Jun 2021 07:47:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624535095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oYouGLiTt3rwLbDeYQDI9r+Q+6zYi6iD1xb2Cn1pvdA=; b=N9wwO8Ez+E5Tgk5M3BgYPFrcoN0+kopxspRvIrEA3djxD9HGzkXW/CBLH8/HYNuGovZdfn xoC9wR0De0r14Y1Xz3dTvVFwhlaAd6+QcYiOR/KIousUOegKwyqJto8XXWNIzgDgncoPsi kkOJtxe6ugaPpfhk/nLVb/vfeMBjKFM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-bIxyDc2uPny7-kG0n1y_kw-1; Thu, 24 Jun 2021 07:44:52 -0400 X-MC-Unique: bIxyDc2uPny7-kG0n1y_kw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DB8B802920; Thu, 24 Jun 2021 11:44:50 +0000 (UTC) Received: from Diego (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E92636090F; Thu, 24 Jun 2021 11:44:46 +0000 (UTC) Date: Thu, 24 Jun 2021 13:44:43 +0200 (CEST) From: Michael Petlan X-X-Sender: Michael@Diego To: Namhyung Kim cc: Jiri Olsa , Arnaldo Carvalho de Melo , Ian Rogers , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Riccardo Mancini Subject: Re: [RFC 00/10] perf: Add build id parsing fault detection/fix In-Reply-To: Message-ID: References: <20210622153918.688500-1-jolsa@kernel.org> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Jun 2021, Namhyung Kim wrote: > Hi Jiri, > > Thanks for your work! > > On Tue, Jun 22, 2021 at 2:19 PM Jiri Olsa wrote: > > > > On Tue, Jun 22, 2021 at 03:14:04PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Tue, Jun 22, 2021 at 10:47:54AM -0700, Ian Rogers escreveu: > > > > On Tue, Jun 22, 2021 at 10:39 AM Arnaldo Carvalho de Melo > > > > wrote: > > > > > > > > > > Em Tue, Jun 22, 2021 at 05:39:08PM +0200, Jiri Olsa escreveu: > > > > > > hi, > > > > > > this *RFC* patchset adds support to detect faults during > > > > > > mmap2's build id parsing and a way to fix such maps in > > > > > > generated perf.data. > > > > > > > > > > > > It adds support to record build id faults count for session > > > > > > and store it in perf.data and perf inject support to find > > > > > > these maps and reads build ids for them in user space. > > > > > > > > > > > It's probably best explained by the workflow: > > > > > > > > > > > > Record data with --buildid-mmap option: > > > > > > > > > > > > # perf record --buildid-mmap ... > > > > > > ... > > > > > > [ perf record: Woken up 1 times to write data ] > > > > > > [ perf record: Failed to parse 4 build ids] > > > > > > [ perf record: Captured and wrote 0.008 MB perf.data ] > > > > > > > > > > > > Check if there's any build id fault reported: > > > > > > > > > > > > # perf report --header-only > > > > > > ... > > > > > > # build id mmap stats: FAULTS 4, LOST 0, NOT FIXED > > > > > > > > > > > > There is, check the stats: > > > > > > > > > > > > # perf report --stat > > > > > > > > > > > > Aggregated stats: > > > > > > TOTAL events: 104 > > > > > > .... > > > > > > BUILD_ID fails: 4 (14.3%) > > > > > > > > > > > > Yep, let's fix it: > > > > > > > > > > > > # perf inject --buildid-mmap2 -i perf.data -o perf-fixed.data > > > > > > > > > > Can we make it possible to automate this with --fixup-buildids or a > > > > > perfconfig 'record' knob? > > > > > > > > > > This would entail requesting that build-ids that _fail_ be sent to the > > > > > side-band thread we have in 'perf record', this way we wouldn't have to > > > > > traverse the whole perf.data file, be it with 'perf-record' at the end > > > > > of a session with faulty build ids, or in a similar fashion using 'perf > > > > > inject' as you suggest. > > > > > > > > > > I even think that we can have all these modes and let the user to decide > > > > > how important is this for them and how convenient they want the whole > > > > > process to be. > > > > right, that might be good to decide first.. because as I said, > > I never hit faulted build id, so it probably needs the special > > setup you guys are using.. could you try on your setup and check > > how many faulted build ids you see? > > Did you check data mmaps? It might be easy to get faults > from data files and we don't know if it's an ELF or not > before reading the ELF header in the first page. Hi. Long ago, I have noticed samples pointing to purely data files, such as if the program execution was sampled just in the middle of them. However, these files couldn't certainly contain any executable code... It was quite hard to reproduce this. Maybe what Namhyung says might have been a culprit for it? Just an idea... Michael > > I'm not sure if we can limit it to exec mappings, there might > be data-only DSOs and we may want to symbolize them too. > > Thanks, > Namhyung > >