Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3877428pxu; Tue, 20 Oct 2020 02:55:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4Jn3Ino/BXLwm2fgUQrdcir81nV1guoJd4Mbrpn8tGWNtqt8f/pYERme1B8AfQI/goU3K X-Received: by 2002:a17:906:e15:: with SMTP id l21mr2344936eji.509.1603187720723; Tue, 20 Oct 2020 02:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603187720; cv=none; d=google.com; s=arc-20160816; b=hc/2in+guiN/TB9Tp6lt2m2nc6n1M5GAlOq0QkyHy8dVXikoHowxlz108/SdaUYMCZ lszgdfQ0DSLVRd2FAXQroxRANcOoaKKfP2B4tlzvKx7zSBRF4L9N1l7K69/H56Okjfvb S5hRmyFIpZGhJP6lfNG9t81ac4MWaXDiSusnxJnuj20n6xAn+ZMPSZEJO6Ivd2A25dx+ W05BTel6+StE2WV3zJFdSTZRMH/c/+OsWzHRQmuN6SC33rPwSdI3aRpry36JJwUGT17p gOdCZ9DQz3dTT44m04pLsBOCrxPPFa7+AX7XHasDufehDiaS0cUUQqwG9qW77tcYk+Xy ZeKQ== 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=8jk46qzoY+qKztxyvjIvkyp4/43VUHvpWhz0wxtac/k=; b=vkUJhhPG/aPy3Z0Ii2HTOAyv6YQccI+q2UTUsOEh8jVweH8fSr5yiFfFR7eoKxOVCi beEOztDrxYXohlb0eiooxWuJb+jrQiKvU2mFuRv9esTcO+5l45O9BlRL1FdpZ5FbKcHg AijGffT/UthQb7RUVgs3toRljtbt9ogKiQAzslpSP1PeU4b0uTgE7idQhxb8yKAOCNlQ LJYSjpJH1vc2pmx4PDruuN77c+Gdu5tj78gJHuYnypXtKeq947N3q98HEZq7zqJ9IQb7 +Te76Ce5aAAIyWXx9jdYhHRzC+HMVLkeuMU1ACEYM6oeZwbxE+vroz4h9LbBY2EsKzBp Araw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ibH/mp8Y"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si769977edt.536.2020.10.20.02.54.58; Tue, 20 Oct 2020 02:55:20 -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=@redhat.com header.s=mimecast20190719 header.b="ibH/mp8Y"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405089AbgJTH0H (ORCPT + 99 others); Tue, 20 Oct 2020 03:26:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58438 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405066AbgJTH0H (ORCPT ); Tue, 20 Oct 2020 03:26:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603178765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8jk46qzoY+qKztxyvjIvkyp4/43VUHvpWhz0wxtac/k=; b=ibH/mp8YPNfF0Gc1sp2SuvzUANfUPHPWrw71Mc2dFlg18VYjiDiNLr4JywotCZS62exa+l W1w7Wi47de1JmMDLju4nCZZhasQmTo8AnUZZJhsb3NIQSofN0GS6OHcTuCr34Z0wZ5ewz8 wsJbcNHYXFeRHwg+TPaNQuxt22EnsFc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-317-iL_J8JbLOcKUndYdXMVDFA-1; Tue, 20 Oct 2020 03:26:01 -0400 X-MC-Unique: iL_J8JbLOcKUndYdXMVDFA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0654B87505D; Tue, 20 Oct 2020 07:25:59 +0000 (UTC) Received: from krava (unknown [10.40.192.162]) by smtp.corp.redhat.com (Postfix) with SMTP id 6044B55760; Tue, 20 Oct 2020 07:25:54 +0000 (UTC) Date: Tue, 20 Oct 2020 09:25:53 +0200 From: Jiri Olsa To: Leo Yan Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , Kan Liang , Andi Kleen , Ian Rogers , Joe Mario , David Ahern , Don Zickus , Al Grant , James Clark , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 7/8] perf c2c: Add option '-d llc' for sorting with LLC load Message-ID: <20201020072553.GC2084117@krava> References: <20201015145041.10953-1-leo.yan@linaro.org> <20201015145041.10953-8-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201015145041.10953-8-leo.yan@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 15, 2020 at 03:50:40PM +0100, Leo Yan wrote: SNIP > @@ -1533,6 +1539,7 @@ static struct c2c_header percent_hitm_header[] = { > [DISPLAY_LCL] = HEADER_BOTH("Lcl", "Hitm"), > [DISPLAY_RMT] = HEADER_BOTH("Rmt", "Hitm"), > [DISPLAY_TOT] = HEADER_BOTH("Tot", "Hitm"), > + [DISPLAY_LLC] = HEADER_BOTH("LLC", "Hit"), > }; > > static struct c2c_dimension dim_percent_hitm = { > @@ -2002,6 +2009,10 @@ static bool he__display(struct hist_entry *he, struct c2c_stats *stats) > break; > case DISPLAY_TOT: > FILTER_ENTRY(tot_hitm); > + break; > + case DISPLAY_LLC: > + FILTER_ENTRY(tot_llchit); > + break; > default: > break; > } > @@ -2032,6 +2043,9 @@ static inline bool is_valid_hist_entry(struct hist_entry *he) > case DISPLAY_TOT: > has_record = !!c2c_he->stats.tot_hitm; > break; > + case DISPLAY_LLC: > + has_record = !!c2c_he->stats.tot_llchit; > + break; > default: > break; > } there's one more switch with c2c.display in percent_hitm function, where you did not add DISPLAY_LLC case.. I guess it should not ever because we will not use that column in llc display mode, but we should add at least some warning or that SNIP > - "cl_rmt_hitm," > - "cl_lcl_hitm," > - "cl_stores_l1hit," > - "cl_stores_l1miss," > - "dcacheline", > - NULL); > + ret = hpp_list__parse(&hpp_list, cl_output, NULL); > > if (WARN_ONCE(ret, "failed to setup sort entries\n")) > return; > @@ -2357,7 +2384,7 @@ static void print_c2c_info(FILE *out, struct perf_session *session) > fprintf(out, "%-36s: %s\n", first ? " Events" : "", evsel__name(evsel)); > first = false; > } > - fprintf(out, " Cachelines sort on : %s HITMs\n", > + fprintf(out, " Cachelines sort on : %s\n", > display_str[c2c.display]); > fprintf(out, " Cacheline data grouping : %s\n", c2c.cl_sort); > } > @@ -2514,7 +2541,7 @@ static int perf_c2c_browser__title(struct hist_browser *browser, > { > scnprintf(bf, size, > "Shared Data Cache Line Table " > - "(%lu entries, sorted on %s HITMs)", > + "(%lu entries, sorted on %s)", > browser->nr_non_filtered_entries, > display_str[c2c.display]); > return 0; > @@ -2720,6 +2747,8 @@ static int setup_display(const char *str) > c2c.display = DISPLAY_RMT; > else if (!strcmp(display, "lcl")) > c2c.display = DISPLAY_LCL; > + else if (!strcmp(display, "llc")) > + c2c.display = DISPLAY_LLC; please update man page with this > else { > pr_err("failed: unknown display type: %s\n", str); > return -1; > @@ -2766,9 +2795,10 @@ static int build_cl_output(char *cl_sort, bool no_source) > } > > if (asprintf(&c2c.cl_output, > - "%s%s%s%s%s%s%s%s%s%s", > + "%s%s%s%s%s%s%s%s%s%s%s", why is there extra '%s' when we did not add new argument.. ? SNIP > + "ld_fbhit,ld_l1hit,ld_l2hit," > + "ld_lclhit,lcl_hitm," > + "ld_rmthit,rmt_hitm," > + "dram_lcl,dram_rmt"; > + else /* c2c.display == DISPLAY_LLC */ > + output_str = "cl_idx," > + "dcacheline," > + "dcacheline_node," > + "dcacheline_count," > + "percent_llchit," > + "tot_llchit," > + "tot_recs," > + "tot_loads," > + "tot_stores," > + "stores_l1hit,stores_l1miss," > + "ld_fbhit,ld_l1hit,ld_l2hit," > + "ld_lclhit,lcl_hitm," > + "ld_rmthit,rmt_hitm," > + "dram_lcl,dram_rmt"; > + > + if (c2c.display == DISPLAY_TOT) > + sort_str = "tot_hitm"; > + else if (c2c.display == DISPLAY_RMT) > + sort_str = "rmt_hitm"; > + else if (c2c.display == DISPLAY_LCL) > + sort_str = "lcl_hitm"; > + else if (c2c.display == DISPLAY_LLC) > + sort_str = "tot_llchit"; > + could you please split addition of output_str/sort_str into separate patch and then add DISPLAY_LLC support? it'd ease up review perhaps include also print_pareto changes in it thanks, jirka > + c2c_hists__reinit(&c2c.hists, output_str, sort_str); > > ui_progress__init(&prog, c2c.hists.hists.nr_entries, "Sorting..."); > > -- > 2.17.1 >