Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp862486ybk; Fri, 15 May 2020 16:01:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2rFL57UGKPaqDHputLmCI6KyXCnsj68LtPFVNRG7BtoATRKlNNyY/EoAfsS0N+s4+h/lw X-Received: by 2002:a17:906:9419:: with SMTP id q25mr4844114ejx.111.1589583688918; Fri, 15 May 2020 16:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589583688; cv=none; d=google.com; s=arc-20160816; b=uWak4B/wAVfuIoI9Pq5F8OvFN3rpYuViD/wGND5ym8XGqUVd1wx4qaCXqaEcYavUr0 6jqi+0q+CG4pOTfW/IniSq21zwAe+kAEmMjVQbk+4lYChO7noXDoob6swm6jzbFWP/UA oDbcJnC9h2VW8ouwftMgbftFNg29PThtX+dxtR6MJMOMt7pXdEa81q0Oa5DUG0d8RO34 nzifzETvFcBf39YU0zAUJdOCCqHEp7UefU3dDImI9oZtb1MQcIz0+hhAqGVVAeFONH3l J0PHG4tReggCtkjyYBFDLWwGmFBWuavg36dgGgj/Sluwzv3Hk+MwL8c9SxrniorHvsTb SlKA== 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=dC+XhfbqGlhAhbAgyMdHUqPw5BLvGzk1yB+TQwnz4Es=; b=nMxg2TANZpa2LK4JQUTZ5YSmSHXtSr5h+8aV+4Sev5t9Dw/dKVF/ElkBzsmQtoaYqR AV56FKKlJjqFXs94fI1vimRAT4IpxzOBul3nAV4uZ0AhOSO5E+lRK1czOK4TOMTSi/sj Z/MkCFbFqKQEhDbLyCglP3TtWiGfa7zhQzf4UWA8LemS/R/sFcnLO2lcbajdmLdtFl/z jekbhJZ4qPKe44tnX9Lc5t3EgzBXSpolIud2O5LkYbXM7hKik2KDpwHxUW2RLVuGLINW s2zoagYaIuvDUqNBsmBm9p6UXpW8CFgqdXDVOq5c4HxcW68hVJ4CUJaI1V+N4knK9W9Y 94iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GtgoC7Vf; 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 do17si2707497ejc.93.2020.05.15.16.01.04; Fri, 15 May 2020 16:01:28 -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=GtgoC7Vf; 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 S1726301AbgEOW7m (ORCPT + 99 others); Fri, 15 May 2020 18:59:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbgEOW7m (ORCPT ); Fri, 15 May 2020 18:59:42 -0400 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16653C05BD0A for ; Fri, 15 May 2020 15:59:42 -0700 (PDT) Received: by mail-yb1-xb44.google.com with SMTP id l17so1960325ybk.1 for ; Fri, 15 May 2020 15:59:42 -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=dC+XhfbqGlhAhbAgyMdHUqPw5BLvGzk1yB+TQwnz4Es=; b=GtgoC7VfR7ofh/b0+XXCmCRyrz1ZdRQTxwPKcbSn8AGVsJL1PTuo8ed/VSbRTXOxxh QoQpob+pJw2EjpaAWbOkO1M85kUUJXBTCY5KJetb88ebg9cK3NME+3ys6Gblksg5ssu2 gWEHe2DUfbY7PR6MfhCSCPt17ld2kmfha48RWc9lIaCNYE8BmYOqjCmDtlIbJyNzEnxn QuF5pDFw03jfZdfcoUKpL2Ep9KgVqE8ac34Kqcx8l9GO1n7FrPnPTTObHBdeoOTG39hp 2CGFBZPuCAdG34MKdbxcD4Ouy6PfsgiHx8Adfb84KgVvK/ncefFwcRsGVmHEAZ21AQMb hAIw== 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=dC+XhfbqGlhAhbAgyMdHUqPw5BLvGzk1yB+TQwnz4Es=; b=R2oWLo+wKB4cXS7ZoqVYu2wS/OYKXL6SKbIpWkX1OUJuQZj+0Q/FA+U4kBvFoApCSl KDDwJKzCqxYF/Zp/kvrm2/0QZbGfwBQL01qp5CckGewfpYgJ8D7Xr7dBEsqEKI8uwx49 0gCZ5qGfQWUbxXLsYETAMJmhDB+oKet5DaDBZYHfNzroi9Ei+Ht2Cgz9N4qP2CnMxWcl OgpKf06FMSOCvwm1dlI22A8gsAzkwdkEfSzbKj4jXGM6l7KfyWdD9mn42+/7HAGgo3YF Ezq1M8FAq/19dvN5UbKI0oUrm6r1eQ2efqW009BHuSIOjkStppaAx/xXUmqm9NCWV5Ex DIuQ== X-Gm-Message-State: AOAM532whj017NsPiWkzwQNj8M7sTx6cY1yWz+w8ucF/GICwSjdeM4/J 4CE37IBqkTLCq8GkFlEMib3mf5UndVqkQtNvIYRiFA== X-Received: by 2002:a25:d450:: with SMTP id m77mr9552468ybf.177.1589583580023; Fri, 15 May 2020 15:59:40 -0700 (PDT) MIME-Version: 1.0 References: <20200515165007.217120-1-irogers@google.com> <20200515165007.217120-8-irogers@google.com> <20200515224139.GB3577540@krava> In-Reply-To: <20200515224139.GB3577540@krava> From: Ian Rogers Date: Fri, 15 May 2020 15:59:28 -0700 Message-ID: Subject: Re: [PATCH v2 7/7] perf expr: Migrate expr ids table to a hashmap To: Jiri Olsa Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , 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 , LKML , Networking , bpf , Stephane Eranian 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 3:41 PM Jiri Olsa wrote: > > On Fri, May 15, 2020 at 09:50:07AM -0700, Ian Rogers wrote: > > SNIP > > > diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c > > index 8b4ce704a68d..f64ab91c432b 100644 > > --- a/tools/perf/util/expr.c > > +++ b/tools/perf/util/expr.c > > @@ -4,25 +4,76 @@ > > #include "expr.h" > > #include "expr-bison.h" > > #include "expr-flex.h" > > +#include > > > > #ifdef PARSER_DEBUG > > extern int expr_debug; > > #endif > > > > +static size_t key_hash(const void *key, void *ctx __maybe_unused) > > +{ > > + const char *str = (const char *)key; > > + size_t hash = 0; > > + > > + while (*str != '\0') { > > + hash *= 31; > > + hash += *str; > > + str++; > > + } > > + return hash; > > +} > > + > > +static bool key_equal(const void *key1, const void *key2, > > + void *ctx __maybe_unused) > > +{ > > + return !strcmp((const char *)key1, (const char *)key2); > > should that be strcasecmp ? would it affect the key_hash as well? The original code does make use of strcasecmp in one place, but in the group matching (the main useless use for this code) it doesn't. I don't think it is a regression to keep it as this, and would like a test case for when it does matter. Is that ok? Thanks, Ian > jirka >