Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2351121rbb; Tue, 27 Feb 2024 21:22:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVNR4yUSn99LGh5rtWEhtSMvm1mg8NB1NKWEbsajHlji9G0aZ5/IMGg9lcoS0r7o9p5Vby5EQisIQ9/W3OKHibgayX5u/+8Pe4q6x7PVg== X-Google-Smtp-Source: AGHT+IERex3Kg4Prmjk+Iy1PJSM0jd5RMGChg+DSLqaSVHXUCX3fFTAOjdbFnYECRokqVf8O6GHH X-Received: by 2002:a05:6870:568a:b0:21e:e606:9217 with SMTP id p10-20020a056870568a00b0021ee6069217mr11905084oao.20.1709097736090; Tue, 27 Feb 2024 21:22:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709097736; cv=pass; d=google.com; s=arc-20160816; b=BQSYje2CyaXmJEwNlNTKLyYQs9Pvn43FlYc1U4TF8deR8unASm3pvDg2Y9IfV0BJoi RRJo8RbdKxZNw5ru5HQq4ZCDEJphlXrt+XOCfs6T8CQbxtKejhnArtTpkQbNWlEK4krm XnlBJzbcNCBOVFQomx5lPvjjryy6hkQWvk9OuCEeXMOmfGtC7s0WTH83t/szejFnhjsY nGHqFh3pBi9H+vmAvzdI4e0G2JB7x2D/bflinbhzDR3YNDmjL5Hp0aIw+9qEWcoWMCt6 20px7cxCLvcSlVSBqhvBkb0V1PFZxMl3oGaS+uHmUij1PY6zE8rW7UJuhvuWbiuWBCpv /Dew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=E1WmJyqMev+WboENbkGUCHApJJaW8nM1fC5ljVtpWBs=; fh=vW8ZAo29r05MshNRqG8qYEcNawQhlUhLvJab34Yb27k=; b=gK/JUKZf/r4XLbO7KckADLCbpeF0+qzuhegXGVMf2PxpOXU0FgJmLTc2DIfwcocTfa NV6hHPnJmz2+0G2bPJHO5cFwAWNParubjf/tGCBolH+F3VfYsKkufioa6UnpsgwqYppS baT+68/Q1fM+xCj6yYssLzidwrdz3SOxy3AgbqiNEc+NcHziXRsQqQuIygi4zgkGEkhS r/aK3S3qYfu32+5sMJFPANta7RpbVqtxxgorzxL111bWlYpHOatKiFGYbde9NfI9JkC5 HL0zKueEsnxdttlToJtlbqvHA+10kGeFp3Fs5d/6sUfv8ggY6ZbZWSOVW6Ayav9PbXM+ JF9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-84532-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a11-20020a63e40b000000b005dccf9c08ebsi6657953pgi.656.2024.02.27.21.22.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 21:22:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84532-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-84532-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DB16E284A09 for ; Wed, 28 Feb 2024 05:21:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5310B210ED; Wed, 28 Feb 2024 05:21:40 +0000 (UTC) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CA55FBED; Wed, 28 Feb 2024 05:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709097699; cv=none; b=sSDfyvWMEAS3b7xfx/8AY1fhSdr0UM9P/PXqQ5KCsaPKZm0fhsLbVUPzSi0hJU4V/Z7Y0xkJfGFHx3GEfwNUfkSLlBDJ8YkVW96GG0EKiCXLE95vapW4sUAUqBBU6ENiNjN8PjxpVeaJ1DDYmR9gGhaqXybeUB08A037L5usIEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709097699; c=relaxed/simple; bh=Ow2R0TlpUmNbnSJf5ij/+iai1DTHDjY6QOPLlXU0zc8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LdkkBBZJgMo/0s+OtTOnOnx5V+WO/IxSmfPkyKKu0Mr6CqK7t83UPCnOqgPbT6q2VXZpIoirQsq+rGm6vmVsrUbRnk1LJCM1VzyGE6kdKgA0LPOE5c8aCDcA/0Uv/HEVhcDRSR5jCw6/+mp8XBodDQ46Os6mlW8P78ScCZSY4Wg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5bdbe2de25fso4241980a12.3; Tue, 27 Feb 2024 21:21:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709097698; x=1709702498; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E1WmJyqMev+WboENbkGUCHApJJaW8nM1fC5ljVtpWBs=; b=I0t15RF5aAbsU0wGqxr+PfjzUuqtXB2HKWqLqIWVYzy4+Vibhwu+oYpCVUNeMV84vS rvULrtiWcJKZs9EfxgNWG8eWjBlb2G4Nm99iNdDDE9vUl5BDZYxk5gQVAewz+Mo81kti FwhIO2TpZEmoo0S318T0l/+ArkA0ortbadYul0kAyYz+rEXvFBwxtMq6sG/K6kkO+EGO eZsXsq8lJmyUeG08HD5KxoqrEahBIEc5WD8XWUieKB5QEuug2mIHpnKjx0SWVaT+rvht ZqJUmpoVMae+MAFZUlWJR2BbwAqm1IWGb5xrgIXxlNw8u53rQM3VHJshThG4ZxkMSrKJ me8w== X-Forwarded-Encrypted: i=1; AJvYcCXVtyRrMYUW4MT0F9fF3cU3kqB5S7ohbpZoJ4l6qL84zCqB/0XPf/WtGcqWm/wPbV/LDwkMsAyoSzhA06bYQZUAHvKJicrQU6UtFUTHJFoxOccdZ/h4LKeqpnyjxd1gMa0lT64aeFDX4QAfkXqFqg== X-Gm-Message-State: AOJu0YwVi7kpredngGFqxeIQ3FAhnZa32DL/oPFeUDhTtGJSa/+76Z8o GJYfk01DbnQQh7eHZKolEucppgsp7cWD5Re74iaeBZoOOGTeWHgo7iVpR3tB/+9TFe3Du+kNn8o Y+ZODmY5b+Ut5jQg4cFOWL7NbXVU= X-Received: by 2002:a17:90a:17ca:b0:29a:6695:7c74 with SMTP id q68-20020a17090a17ca00b0029a66957c74mr9604271pja.45.1709097697922; Tue, 27 Feb 2024 21:21:37 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240228005230.287113-1-namhyung@kernel.org> <20240228005230.287113-2-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 27 Feb 2024 21:21:26 -0800 Message-ID: Subject: Re: [PATCH 1/4] perf annotate: Add a hashmap for symbol histogram To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Andi Kleen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 27, 2024 at 5:20=E2=80=AFPM Ian Rogers wro= te: > > On Tue, Feb 27, 2024 at 4:52=E2=80=AFPM Namhyung Kim wrote: > > > > Now symbol histogram uses an array to save per-offset sample counts. > > But it wastes a lot of memory if the symbol has a few samples only. > > Add a hashmap to save values only for actual samples. > > > > For now, it has duplicate histogram (one in the existing array and > > another in the new hash map). Once it can convert to use the hash > > in all places, we can get rid of the array later. > > > > Signed-off-by: Namhyung Kim > > --- [SNIP] > > diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h > > index 94435607c958..a2b0c8210740 100644 > > --- a/tools/perf/util/annotate.h > > +++ b/tools/perf/util/annotate.h > > @@ -12,6 +12,7 @@ > > #include "symbol_conf.h" > > #include "mutex.h" > > #include "spark.h" > > +#include "hashmap.h" > > nit: This could just be a forward reference to keep the number of > header files down. Sounds good. Will fix in v2. Thanks for your review! Namhyung