Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1154480pxu; Fri, 27 Nov 2020 00:38:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBxwb9WuPwHA/GgG1HZWYjMrCpREgpLTc4hqU//4p+1ezCf8/6CwBJW5rjmxhCHU0x4uZV X-Received: by 2002:a17:906:fcc2:: with SMTP id qx2mr6471406ejb.549.1606466322073; Fri, 27 Nov 2020 00:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606466322; cv=none; d=google.com; s=arc-20160816; b=svVJADlqQuEd2pfreOnkW9jG4bLijMwpZ+rQEJ/oM8/J7cj+uhQW/hpkaRdglmIq+0 DyCL525iyx+bAdIwPFAf2m80/zjQNXdNpxKX6z5iChMaHfZmLJSt5H9LtSkskdXETLAw Uw3lFpm7D55OkZ4c0CTYHova9ESPMc3F5/eancsVhDY4fuDa2gL7RoJvyNZHkEIavEiE ZforXArskXF3XLa/ndXXthZsvqg2tKfpo4pfUodwtoKeYaFLbk2X5h7irF9/2z9ORhde E7KQFTwYnEucPQa77//X017sG2sUWAG8OZZ+KJsFIeLoFHSw4juGhITri+t3T9jwuzD3 fakw== 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=Uga2hvKGgDJFv528J2aQOWMm5l3g0H0QuKbgxbM37Jk=; b=IPvk67uS6gzxiiGLDziMvk9KJRGtjPVjaDbl6XXIc8/J5wRLa++82aE8InV/f/663m SYCW+fhuuvEkvgd33E3LV0LZ4sFLt2BnskmafrPbhOe97jlXo7JPNOGBNlQy2RROy3Ry 4nYV+e+OoIsBYw7mStdMuUeloOBs6e4LUxnkSereOC0SHy2shMzWEC+ENVBwyQw0N0+g J0IlRggWL4d30hjGDEmKDBwcyjgxsFmOciokezmXxp1Nwm75iu0eYVf95XsuSKGpteRw roh9TJQmzYyyxV4Qp0u37Az0Suab2R91VI5D1KfwWcYwTTTxQc2io3LHTdEaVV4uaX6u lVHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QK/lMVqi"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si5325826ejf.221.2020.11.27.00.38.19; Fri, 27 Nov 2020 00:38:42 -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=@kernel.org header.s=default header.b="QK/lMVqi"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404424AbgKZRaq (ORCPT + 99 others); Thu, 26 Nov 2020 12:30:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:58586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404325AbgKZRap (ORCPT ); Thu, 26 Nov 2020 12:30:45 -0500 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 05BD421D7E; Thu, 26 Nov 2020 17:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606411845; bh=eGgDmj+9VdpVGdJDh6xNed07pQF31b07D87E8UC5bs0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QK/lMVqivbWHGwEFO6gzc6IIQvT+p8puagQ9fr7t9GJHwXGQOF1XLiCQU+lOy5cwY 1PSNxSvVwktn4m2gzTzPqPbphXW120TXugU+d4754nm3KTHeMb5lPCkrPNQ23Ph8mq VvvjiiYpcX0aZ7mBktCPSGonT+xuPZGM9i0fcpvA= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E9E3240E29; Thu, 26 Nov 2020 14:30:42 -0300 (-03) Date: Thu, 26 Nov 2020 14:30:42 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Song Liu , Ian Rogers , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter Subject: Re: [PATCH 06/25] perf tools: Do not swap mmap2 fields in case it contains build id Message-ID: <20201126173042.GF53384@kernel.org> References: <20201126170026.2619053-1-jolsa@kernel.org> <20201126170026.2619053-7-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126170026.2619053-7-jolsa@kernel.org> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Nov 26, 2020 at 06:00:07PM +0100, Jiri Olsa escreveu: > If PERF_RECORD_MISC_MMAP_BUILD_ID misc bit is set, > mmap2 event carries build id, placed in following union: > > union { > struct { > u32 maj; > u32 min; > u64 ino; > u64 ino_generation; > }; > struct { > u8 build_id[20]; > u8 build_id_size; > u8 __reserved_1; > u16 __reserved_2; > }; > }; Did you forgot to update just this cset comment? - Arnaldo > In this case we can't swap above fields. > > Signed-off-by: Jiri Olsa > --- > tools/perf/util/session.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > index 5cc722b6fe7c..cc1c11ca94fd 100644 > --- a/tools/perf/util/session.c > +++ b/tools/perf/util/session.c > @@ -592,10 +592,13 @@ static void perf_event__mmap2_swap(union perf_event *event, > event->mmap2.start = bswap_64(event->mmap2.start); > event->mmap2.len = bswap_64(event->mmap2.len); > event->mmap2.pgoff = bswap_64(event->mmap2.pgoff); > - event->mmap2.maj = bswap_32(event->mmap2.maj); > - event->mmap2.min = bswap_32(event->mmap2.min); > - event->mmap2.ino = bswap_64(event->mmap2.ino); > - event->mmap2.ino_generation = bswap_64(event->mmap2.ino_generation); > + > + if (!(event->header.misc & PERF_RECORD_MISC_MMAP_BUILD_ID)) { > + event->mmap2.maj = bswap_32(event->mmap2.maj); > + event->mmap2.min = bswap_32(event->mmap2.min); > + event->mmap2.ino = bswap_64(event->mmap2.ino); > + event->mmap2.ino_generation = bswap_64(event->mmap2.ino_generation); > + } > > if (sample_id_all) { > void *data = &event->mmap2.filename; > -- > 2.26.2 > -- - Arnaldo