Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2414329pxk; Mon, 14 Sep 2020 12:41:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrnqnANa7vhOlN5iDK1Y3gyAwBRo4vTabjygCchergJfpC3WQpgZw/FY6BvNrfvKDLxvnO X-Received: by 2002:a17:906:4805:: with SMTP id w5mr9198334ejq.313.1600112468501; Mon, 14 Sep 2020 12:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600112468; cv=none; d=google.com; s=arc-20160816; b=dzt7hkcEKo7ZXK6jUFq+RjqTZVB5wwNJ0SHUgbaYbPGH87BhZByK1mhyt54Jwgl537 qacjCKXIWJZXenOUF3f2WshU6bukGqO9OQNu5JMOCU7VS1dKj8CFODIRAZZN2yj1OLcK qgdvJK8SyUWjktrjPt7NGMjm+C9Hcu1++9V0H0EkVkrGn85DiG3Yo2r9KLN9/Ih57pI9 3LpqgO2qPrnCRGCIt8FCRdKjKSDjNyS1fsfwjbjzZzrCe5RO8nKFGFS6KcZmEUsILtYf 7QY7oTUS5wRK69Dzw0mlC9oHGDi7c1L9vH+ep7FiMCgLBd5Y+q0QQ+QtML7JD4FwtMA3 vZKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=2dLrjvn975TYJJujpJZWjLnWZO++WMQG/EDi9UWYfd0=; b=Soo9nmN+xNRjyuTG4/rNOW2fHu2JaZXI9ZvZDtTYQEP5QPVR6IhKwM5SHOcyiaCjFw Q0MGrW4gopZiZHRh3YIIekOKG1ZBFQDkb5yiuJDvRECm6bjiTbA62oco+6zn9Ve6+8AU Jc5liWOOvIq3qcIOJq1bVzLtsu+Pq4y5Uyclo5+HgUV/eyM3lKhq10Je77hENqP3vRUq kCEYy+VitvOefGINylGJnAIUZkHeDrl5uBoqhFKVuwEDNbr25iGBgaD/qMy3Rritp3ue PIrFvR4KhGSnWyX9ce8SxhlX/LO2ENTfdI7K+g98cix6RQFbh8DBpaPlgmu2BMa+W01P dSVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AQOs2nB1; 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 cb8si7522842ejb.725.2020.09.14.12.40.45; Mon, 14 Sep 2020 12:41:08 -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=AQOs2nB1; 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 S1726046AbgINTjV (ORCPT + 99 others); Mon, 14 Sep 2020 15:39:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35707 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbgINTjU (ORCPT ); Mon, 14 Sep 2020 15:39:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600112359; 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=2dLrjvn975TYJJujpJZWjLnWZO++WMQG/EDi9UWYfd0=; b=AQOs2nB13OmWDa0fZV03mfa3NVNa3dqxUHJIEEqKDlK0yqvu04zbuZP7F5yA+eJLH2VfFp Bg+fqVJ7IxqAJ4UttF3Q4aIlS9vwAMJnOD7q3C6M3xqJjj07s8nvKR6Doj/RP/vmQ8C/rc QNg1mRNbmBbHsqe4gnW9zJJ/kFfjdlA= 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-567-xSYJoOhAM9ydkTsKSu3cuw-1; Mon, 14 Sep 2020 15:39:15 -0400 X-MC-Unique: xSYJoOhAM9ydkTsKSu3cuw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A3B2800683; Mon, 14 Sep 2020 19:39:13 +0000 (UTC) Received: from krava (unknown [10.40.192.180]) by smtp.corp.redhat.com (Postfix) with SMTP id 79E0719C78; Mon, 14 Sep 2020 19:39:08 +0000 (UTC) Date: Mon, 14 Sep 2020 21:39:07 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Jiri Olsa , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Song Liu , "Frank Ch. Eigler" , Ian Rogers , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter , Alexei Starovoitov , Daniel Borkmann , Yonghong Song Subject: Re: [PATCH 02/26] perf: Introduce mmap3 version of mmap event Message-ID: <20200914193907.GO1714160@krava> References: <20200913210313.1985612-1-jolsa@kernel.org> <20200913210313.1985612-3-jolsa@kernel.org> <20200914152841.GC160517@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914152841.GC160517@kernel.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 12:28:41PM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 14, 2020 at 02:38:27PM +0900, Namhyung Kim escreveu: > > On Mon, Sep 14, 2020 at 6:03 AM Jiri Olsa wrote: > > > Add new version of mmap event. The MMAP3 record is an > > > augmented version of MMAP2, it adds build id value to > > > identify the exact binary object behind memory map: > > > > struct { > > > struct perf_event_header header; > > > > u32 pid, tid; > > > u64 addr; > > > u64 len; > > > u64 pgoff; > > > u32 maj; > > > u32 min; > > > u64 ino; > > > u64 ino_generation; > > > u32 prot, flags; > > > u32 reserved; > > What for this reserved? its all nicely aligned already, u64 followed by > two u32 (prot, flags). > > > > u8 buildid[20]; > > > Do we need maj, min, ino, ino_generation for mmap3 event? > > I think they are to compare binaries, then we can do it with > > build-id (and I think it'd be better).. > > Humm, I thought MMAP2 would be a superset of MMAP and MMAP3 would be a > superset of MMAP2. > > If we want to ditch useless stuff, then trow away pid, tid too, as we > can select those via sample_type. > > Having said that, at this point I don't even know if adding new > PERF_RECORD_ that are an update for a preexisting one is the right way > to proceed. > > Perhaps we should attach a BPF program to point where a mmap/munmap is > being done (perf_event_mmap()) and allow userspace to ask for whatever > it wants? With a kprobes there right now we can implement this MMAP3 > easily, no? hmm, I'm always woried about solutions based on kprobes, because once the function is moved/removed you're screwed and need to keep up with function name changes and be backward compatible.. jirka