Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1056544pxb; Fri, 13 Nov 2020 03:06:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJtqYOVSbMjLaW0U9HZODwP4/qC+s0uTMwQ4mTtc7ntXDPYedEN5mHM22J7T53DATyCrB6 X-Received: by 2002:a50:e443:: with SMTP id e3mr1979961edm.160.1605265580977; Fri, 13 Nov 2020 03:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605265580; cv=none; d=google.com; s=arc-20160816; b=gzxHs/7CJbgG6Z/HfV0nttknjFto3NXhQUg+mCyGR+c2VcU9fJeZTKiP10/Zrj5FHS phl0pd2iKsj0sEZ5vuuqoFLvej7iLecfePvfHXMQue8L4Ocb2QGgieADHplTrzooxcxI kVsmaMhVHBIUFXtzQ54VUtYUx3DTMJooefcdMx95EzT5bFnObFxPlRhKDMWQz7twPMNn Zz+osluoOGvPLTuEvMdurXBNy7VXE5lA2jCaXAxL66qDYid0TX6GKBl/UopCAla0zLXx mdfh0//H+k584HdloiC04Mb3Lyi5zVwVhZk0Sjnt2YtPl+tDqJNIkQJsPeRpu/nJX74l xZRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UVE4VAhfFASKDQr/1v00W+jjf/yyMEehnVZpEYjNa+8=; b=riRDYAfwtEJ8BqPRInmnzi1ikEckg27eGCIAVh1utxjpdifIOenGdhuST/a9HXQqrz 319YZM2GxEhkM2gVvaUJmOkbu/o6Mb6lH0Dx4KaPhfCUrXNgyPJQJ8N58KPKjF4PVmSw QHaVu7PE0kFZuzEwC20TtQ21gKoDTD59hrLSr3JCaAICaFL2Uagd0dMMH66MrJj8AecG y2hDonNjR+PPSEYKkAXN0fDMumoUTsFvf+nc4/m/A2RWQmMzf0GlsvXZmyFPgL664TNE tNuzlm5ClskkrGte+CngYcr1VrkcM/uccTxcBtebdAMpM5D8fgK9T38tN6aAmgqZIaqn mK4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PH3LGmGs; 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 b15si5621120eja.538.2020.11.13.03.05.52; Fri, 13 Nov 2020 03:06:20 -0800 (PST) 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=PH3LGmGs; 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 S1726481AbgKMLC4 (ORCPT + 99 others); Fri, 13 Nov 2020 06:02:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23180 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbgKMLCC (ORCPT ); Fri, 13 Nov 2020 06:02:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605265294; 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=UVE4VAhfFASKDQr/1v00W+jjf/yyMEehnVZpEYjNa+8=; b=PH3LGmGs41gXNdDGUZphIfogLSkEp4KNeAHuo7qVz/xNdKua7OY1xO+16bM5/lxhvWEfwt 1I6R1OdoNlfc66ZciE3g2+UM6S6Sui7XEZOl9B9c8P5oQlHUlKuRfiT2ZHcisbNl1EcyXF iT5Qv69MRIBn9r3TMhLNVhagtFyY2zE= 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-499-6yUCoA48NmOa_rKiChn_-Q-1; Fri, 13 Nov 2020 06:01:32 -0500 X-MC-Unique: 6yUCoA48NmOa_rKiChn_-Q-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 9571D1084D6C; Fri, 13 Nov 2020 11:01:29 +0000 (UTC) Received: from krava (unknown [10.40.195.79]) by smtp.corp.redhat.com (Postfix) with SMTP id 638E473660; Fri, 13 Nov 2020 11:01:26 +0000 (UTC) Date: Fri, 13 Nov 2020 12:01:25 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Song Liu , Ian Rogers , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter Subject: Re: [PATCH 03/24] perf: Add build id data in mmap2 event Message-ID: <20201113110125.GD753418@krava> References: <20201109215415.400153-1-jolsa@kernel.org> <20201109215415.400153-4-jolsa@kernel.org> <20201113042935.GA167797@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201113042935.GA167797@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 13, 2020 at 01:29:35PM +0900, Namhyung Kim wrote: SNIP > > > > struct { > > struct perf_event_header header; > > @@ -7997,13 +8003,23 @@ static void perf_event_mmap_output(struct perf_event *event, > > mmap_event->event_id.pid = perf_event_pid(event, current); > > mmap_event->event_id.tid = perf_event_tid(event, current); > > > > + if (event->attr.mmap2 && event->attr.build_id) > > + mmap_event->event_id.header.misc |= PERF_RECORD_MISC_BUILD_ID; > > + > > perf_output_put(&handle, mmap_event->event_id); > > > > if (event->attr.mmap2) { > > - perf_output_put(&handle, mmap_event->maj); > > - perf_output_put(&handle, mmap_event->min); > > - perf_output_put(&handle, mmap_event->ino); > > - perf_output_put(&handle, mmap_event->ino_generation); > > + if (event->attr.build_id) { > > + u8 size[4] = { (u8) mmap_event->build_id_size, 0, 0, 0 }; > > + > > + __output_copy(&handle, mmap_event->build_id, BUILD_ID_SIZE); > > + __output_copy(&handle, size, 4); > > + } else { > > + perf_output_put(&handle, mmap_event->maj); > > + perf_output_put(&handle, mmap_event->min); > > + perf_output_put(&handle, mmap_event->ino); > > + perf_output_put(&handle, mmap_event->ino_generation); > > + } > > perf_output_put(&handle, mmap_event->prot); > > perf_output_put(&handle, mmap_event->flags); > > } > > @@ -8132,6 +8148,11 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event) > > > > mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size; > > > > + if (atomic_read(&nr_build_id_events)) { > > + build_id_parse_size(vma, mmap_event->build_id, > > + &mmap_event->build_id_size); > > This can fail, right? Then we need to fallback to use dev/ino.. right, I did not implemented fallback in here, but I think you are right.. we should try to do the best in fail, I'll add it thanks, jirka