Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp826019ybk; Fri, 15 May 2020 14:52:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpHFi/YQvnzUQrxi+1feaVXB2OHb43T7wwktPfmRHkFckWR9ZN+fp+ALXSdJm7oe8dvLu+ X-Received: by 2002:a17:906:1d4c:: with SMTP id o12mr4910928ejh.357.1589579537612; Fri, 15 May 2020 14:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589579537; cv=none; d=google.com; s=arc-20160816; b=aRD9Hj4dw32JyubOsnE5HCqfn8GSp5Qa1mLMWUXajOdF+iER4mvKZrSlaPJoPui3GD /rdYJqa402qWhd91mUvW08uQ/ISC80t99TYmZOusVYwnGAVxiTZb6615P7GXcMgJeuWb A8tz0/mbTJV+d+sQkNX1nbcXWTweMgnIDlR5SypRscye9KobLXnMmfnSRuEBKINe5UR8 mnYYF01JvCcykVzPgbOyUogBOYubvuJucYFn4Cg3m2C3ShMeRlojcox7U1D3rCQdGY0B OS3PyymqpEbRji4OgmkL22kTUsUmhW7Vch2snufvc7a6UdEFJ0EpqgFaitsNUUavvIkU 6DlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tS+3CNMGEUW08GWKVNnTCx8encgyi37BKeJukWELzNc=; b=ro1NpBDy+fjYXLShY+pg+NXoWvBtP51I3M0kXz7QAvfJwGpd5pCSunPXW4qn82iTR8 txpUbLag3FVNEH/mEQcjqJBW4mxdkz34RxmEZOCYwIRhYA5HNNNsHpsiEby1bzGHdIKE hMXbXW+KtnQyDZuZbhbki6tgwrf6C72werlA1wNjVpX5XmRL2Kviz8PuJIWZmt6czxXm Val/1kjSM+ShRgN8BC8EhG1+Sz4LkDMkArLP22w94Jb98AXqbTZzrmt0OE/++WMYyM67 4aLs0I1ickTgU3oTqD8WaUyZtVqXDHwr+lOjpqtL43R/uFPZcCB3xGC8TbISy3R+jCKJ PV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="et/afkD6"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce18si2230555edb.26.2020.05.15.14.51.54; Fri, 15 May 2020 14:52:17 -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=@google.com header.s=20161025 header.b="et/afkD6"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727904AbgEOVro (ORCPT + 99 others); Fri, 15 May 2020 17:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727867AbgEOVrn (ORCPT ); Fri, 15 May 2020 17:47:43 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2E0CC061A0C for ; Fri, 15 May 2020 14:47:41 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id m10so1870312ybf.5 for ; Fri, 15 May 2020 14:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tS+3CNMGEUW08GWKVNnTCx8encgyi37BKeJukWELzNc=; b=et/afkD6oOQ8yPirs/ovFayPyCKLRWPBJUWQfo6mBaGP/VgeItYGcmmiMuFdkQ6diZ lp2UAYZh47m0f2FWyEAfMlk4lqL+Wr0b0qd5sPjrOwqaSqmM0AbXME4ySzcO9tEgap7Y xiRN17Nh1zlxP4xm6W9+lMzqt5ruP2vFDCIT8O1B969Sf+eEAjWKn+0e8BMhjNvVimnP 61i1EQ4/Wp6WC4QfNVm8DxLjYZghfSRzNiY4gQtihWRYH10r0WFXg69IQPatUG9UKUaR cagIPuLbrusA2+bourPD0q/2aJK8T8FtidKLadBqUvR6y/kPO08+8NvBAN+sPJnI7KRi 3fDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tS+3CNMGEUW08GWKVNnTCx8encgyi37BKeJukWELzNc=; b=elIbNVR64JLsGIamSE/PQ3IQJmf1IcULlbtiJdiJ1Q1RXmK6dZhetXI28fJCmOlCwI J7ysMxMhl8fMA5/QY5ImV1P9qPwRxki8H8J4KCeWFVRFdPq2AVASoKzb3oSd5Hgmpp4X oI+CXA0tW/2gbNdYFM2PYOI6JRppu4P4x7B5sFxhY0nzd077L10qIi0CynNTtMpK0+c1 3R9bLOrvzQTm0sYmrt67Q0osPSCd6cG8fB3b0J3I2KVGbymw0ldBudk6BcV+DHjg8vWY bWECh5Uq74Dm7IpgSBfLyCzbtQ9WLWRToH2pCHMvMTpAxyvJzn840jNvOEANojunW8TZ NNiA== X-Gm-Message-State: AOAM531HuTlTlgUHSqrZneBiduLMQvN8i62oTLHgfheErtl1YPM2ySxj rhqlGOviPrEoE1LoxmY6hNcs1br/PJD2Y/+38bN9bw== X-Received: by 2002:a25:c08b:: with SMTP id c133mr8940904ybf.286.1589579260905; Fri, 15 May 2020 14:47:40 -0700 (PDT) MIME-Version: 1.0 References: <20200515165007.217120-1-irogers@google.com> <20200515170036.GA10230@kernel.org> <5ebf0748.1c69fb81.f8310.eef3@mx.google.com> In-Reply-To: <5ebf0748.1c69fb81.f8310.eef3@mx.google.com> From: Ian Rogers Date: Fri, 15 May 2020 14:47:29 -0700 Message-ID: Subject: Re: [PATCH v2 0/7] Copy hashmap to tools/perf/util, use in perf expr To: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Kajol Jain , Andi Kleen , John Garry , Jin Yao , Kan Liang , Cong Wang , Kim Phillips , Adrian Hunter , Leo Yan , open list , Networking Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 2:19 PM wrote: > > ,Stephane Eranian > From: Arnaldo Carvalho de Melo > Message-ID: <79BCBAF7-BF5F-4556-A923-56E9D82FB570@gmail.com> > > > > On May 15, 2020 4:42:46 PM GMT-03:00, Andrii Nakryiko wrote: > >On Fri, May 15, 2020 at 10:01 AM Arnaldo Carvalho de Melo > > wrote: > >> > >> Em Fri, May 15, 2020 at 09:50:00AM -0700, Ian Rogers escreveu: > >> > Perf's expr code currently builds an array of strings then removes > >> > duplicates. The array is larger than necessary and has recently > >been > >> > increased in size. When this was done it was commented that a > >hashmap > >> > would be preferable. > >> > > >> > libbpf has a hashmap but libbpf isn't currently required to build > >> > perf. To satisfy various concerns this change copies libbpf's > >hashmap > >> > into tools/perf/util, it then adds a check in perf that the two are > >in > >> > sync. > >> > > >> > Andrii's patch to hashmap from bpf-next is brought into this set to > >> > fix issues with hashmap__clear. > >> > > >> > Two minor changes to libbpf's hashmap are made that remove an > >unused > >> > dependency and fix a compiler warning. > >> > >> Andrii/Alexei/Daniel, what do you think about me merging these fixes > >in my > >> perf-tools-next branch? > > > >I'm ok with the idea, but it's up to maintainers to coordinate this :) > > Good to know, do I'll take all patches except the ones touching libppf, will just make sure the copy is done with the patches applied. > > At some point they'll land in libbpf and the warning from check_headers.sh will be resolved. So tools/perf/util's hashmap will be ahead of libbpf's, as without the fixes the perf build is broken by Werror. This will cause check_headers to warn in perf builds, which would usually mean our header was older than the source one, but in this case it means the opposite, we're waiting for the libbpf patches to merge. Aside from some interim warnings everything will resolve itself and Arnaldo avoids landing patches in libbpf that can interfere with bpf-next. It takes some getting your head around but sounds good to me :-) I think the only workable alternatives would be to explore having a single version of the code in some kind of shared libhashmap or to implement another hashmap in libapi. I'd like to get the rest of this work unblocked and so it'd be nice to land this and we can always refactor later - I like Arnaldo's plan. Can a bpf maintainer make sure the hashmap changes get pulled into bpf-next? Thanks! Ian > Thanks, > > - Arnaldo > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity.