Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2110948pxb; Mon, 11 Jan 2021 00:45:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2i41DC/K4kEdp3fLshCcLgjEiaRMfsnWEd5CDmiQyEM1JQLPsDnWAIJxqIS+xFH5t+aO7 X-Received: by 2002:a17:906:f8d4:: with SMTP id lh20mr10384001ejb.442.1610354721556; Mon, 11 Jan 2021 00:45:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610354721; cv=none; d=google.com; s=arc-20160816; b=rjOuYmri6lX/AOzG7DeE2oD0LSmaFxoN+k3RYlszrwHxC0l/spqX5JPvYtVWr0+euJ mgAxT+REfbAswdh5L1m6OeG8bekdzXMmJSLwvq3rHCgZJS6M6UiuA0dt6lo+wn/UUv6+ b67zBHfTJDTuVIYMaHjnM3bivXvkPFKWPWfT2dk0Py1pe6tMFgV1qmQfQukSwxV9RG/a JXnuOkX/c0aEQezjrLNVFRcwzockLijbkq/wMGCCh7FmHm65qC6WvVYMULcfRfEFPxH3 7EpReVu8deYZdkXM8Sb4VDMKEspjpAgN5tvr4ecoq6/IhRE9zrCc8si8mBPwkNTYT0Cz kv2A== 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=FFx8wmURstpDQyDwNwIE6Nf4AUHKPJbuOybjktkqX50=; b=TkwyfNRjNHVLPnr39S8CxEfNY2KxZ4C7lFwbYUQo99qdXa/3M/+/qiC99nOXmN3U9j +LYyMvTYXSEmVZ1gzUzZh7Y3PWArq2WQ6vBRLfHWLxN2I+dSvXzCbkb+CvfMv1cpgBhN 0ReIBvI2ACN0WEEo17yAjW9CNcpVB/Lv6f4jGFmIqI9Lb4Kok+ySRNrcXMbFuAGVtFfd HN1oZde4gwC1UpKmv9rNQrUY7Cc5GDrO0wENkNj+z74MWhaG5TPUqHMvHSybZm17qrdp 6QiOEyfA5+gkkwibbNG9UCLN+Yc4XJG5Hm98RzbMLtsytEzvZD39/QgweOTgbZLY868a wBag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JcVZTnsr; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y21si6375779ejp.340.2021.01.11.00.44.58; Mon, 11 Jan 2021 00:45:21 -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=@linaro.org header.s=google header.b=JcVZTnsr; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728102AbhAKImZ (ORCPT + 99 others); Mon, 11 Jan 2021 03:42:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728092AbhAKImY (ORCPT ); Mon, 11 Jan 2021 03:42:24 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C16C061786 for ; Mon, 11 Jan 2021 00:41:44 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id w2so2650483pfc.13 for ; Mon, 11 Jan 2021 00:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FFx8wmURstpDQyDwNwIE6Nf4AUHKPJbuOybjktkqX50=; b=JcVZTnsrnT03qDRonFmbCUgziXt4ZgCY0V3kgcXtdNSwhbcrHVapVFXAsL0p5/w7ZR 0cx/bfAHhKLkV43XjmMq+7Z+4WA8SQtTIMJO21nEVvCn8CnoweKrThxjmiCHj0/LUGJr DHgRjjnXXVlEfGa3b7+zQNBa+mJhRtsUg50jDNhr+ylSqGIMpPP+4y6tAQODfLlq/XHB BfUjVADfCzeor4QzL3v1lvG7YM6b+W/33fzc2kPQyQpMY/NhIXHY1UGfNhpHeZFuIvUz 1zwViIOrChDNa6hznT4MDzhxTz6GKM5y5fgw2ljlOIOQWJnkXjc0f9/MWE/VkGNx97QH hWdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FFx8wmURstpDQyDwNwIE6Nf4AUHKPJbuOybjktkqX50=; b=hr0uZbbpNwAKhkgYmd/hs8rtlRahIKQtIEO7FPk5pOx5Eh4jkGnwNd4qgkJ7zLmaT9 Bkcztf7kfAQYriHO8qCInnHKTjxJ9TwfmFhXBAfkaI5qvl+ZD5kzXCqEPjfJ8yxqs5cm p08vmbg/TcIs0QE0bZulnh6f50bN/2E/gcyaVuwsnDRaq36SGu3OIXkSy8SmPqw1J3Qn NXiK/sseZxwtc3RIuGqFq1WJX+2fugQolX+ML9BWV671kx7F42vDdVev35OXQp2+kALS 3iN/aMjTvbsu5LLz3thDJLleX/rpjUXuZ1nYopJCMGezuVAhn16snZmkMNIwQ0MZ6y3y AJqA== X-Gm-Message-State: AOAM533FMNI6kJnmMKFxW4BT+1iwKcuRWCVMKR6eEdGoshUwgYki/xu0 aS0OIi6IMag6SRMJbv7oUAWfgQ== X-Received: by 2002:a63:5fcf:: with SMTP id t198mr18563898pgb.226.1610354504193; Mon, 11 Jan 2021 00:41:44 -0800 (PST) Received: from leoy-ThinkPad-X240s ([64.120.119.108]) by smtp.gmail.com with ESMTPSA id e10sm19419956pgu.42.2021.01.11.00.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 00:41:43 -0800 (PST) Date: Mon, 11 Jan 2021 16:41:38 +0800 From: Leo Yan To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Andi Kleen , Ian Rogers , Kan Liang , Joe Mario , David Ahern , Don Zickus , Al Grant , James Clark , linux-kernel Subject: Re: [PATCH v2 03/11] perf c2c: Add dimensions for load miss Message-ID: <20210111084138.GE3241@leoy-ThinkPad-X240s> References: <20201213133850.10070-1-leo.yan@linaro.org> <20201213133850.10070-4-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2021 at 04:42:59PM +0900, Namhyung Kim wrote: > On Sun, Dec 13, 2020 at 10:39 PM Leo Yan wrote: > > > > Add dimensions for load miss and its percentage calculation, which is to > > be displayed in the single cache line output. > > > > Signed-off-by: Leo Yan > > --- > > tools/perf/builtin-c2c.c | 107 +++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 107 insertions(+) > > > > diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c > > index 00014e3d81fa..27745340c14a 100644 > > --- a/tools/perf/builtin-c2c.c > > +++ b/tools/perf/builtin-c2c.c > > @@ -624,6 +624,10 @@ tot_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused, > > (stats)->rmt_hitm + \ > > (stats)->rmt_hit) > > > > +#define TOT_LD_MISS(stats) \ > > + ((stats)->lcl_dram + \ > > + (stats)->rmt_dram) > > + > > Is this true always? I'm not sure if there's a case where stores can go to DRAM > directly.. maybe like a kind of uncached accesses. Firstly, from my understanding, the uncached accesses are not accounted in the "load miss" metrics. You could see there have other two metrics "stats->st_uncache" and "stats->ld_uncache" which present the store uncached and load uncached respectively. Furthermore, based on the function total_records(), it uses below formula to account the total load accesses: lclmiss = stats->lcl_dram + stats->rmt_dram + stats->rmt_hitm + stats->rmt_hit; ldcnt = lclmiss + stats->ld_fbhit + stats->ld_l1hit + stats->ld_l2hit + stats->ld_llchit + stats->lcl_hitm; So this patch series classifies these metrics into two numbers: load hit and load miss; load hit is considered as hit at any cache levels (L1, L2, LLC and even remote cache), the load miss is accounted with the rest metrics (lcl_dram + rmt_dram). > Also it can be a static function.. Yeah, will fix. Thanks, Leo