Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp750549ybj; Thu, 7 May 2020 06:52:42 -0700 (PDT) X-Google-Smtp-Source: APiQypJxjawYD3IU9FApUAMFb9JS+O0S8/7yk3j0Rk75S8nX79f7Ica47YSp5Y3cyy7XaCO5efAH X-Received: by 2002:a17:906:35d0:: with SMTP id p16mr11862510ejb.77.1588859562373; Thu, 07 May 2020 06:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588859562; cv=none; d=google.com; s=arc-20160816; b=kQtFU/qyZosVoFdXw3enqYVWwkQTt9HUT0nZJJOPDuNH0fbrqFfC4HLybjTkljgcAa aqj0QV6B8fWDV3zlhGYLV76P9l8KUoU8UjrF+jdsZ3cxMWSPtbXTECITLMN6LgLCzKE8 nt1YAT9qud6C4McZyCqnr3IwkbXtyfwvK1GcwUfcsh+ompWSq9+hcHtIh1qVlMJB15MF rGgBuiQ3N470zptaYdRm0wRfqpzpAZVn0qryO9DMSOYSvptmL5t/Tn6tQUi0kvRHLURR exHB6YevrF3xO5zmgqayggbKx9yKbs26oK8z3jQ5v6mGdHyCawmEwISo8zibEmtu1CjN pOPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mtfeKIrFwLIEu5xU9YDtgCdmdoqxZ0ztvTPMoqop3dw=; b=S3sMTMGiywmG7jdEBggSm8Cioj9D3a9FeUwekp9XYYHbDz3EoCbSRre19WtfYOP5NX 0JT9L8v3MXXf5CXEdwZ/u6tKS0HjO7O0hjoJAa8DSqY+M+OBRDVdZc3UVXinNDYHJaiH mY3CLbBxcSFzITI3jIbPMSlYiglKpBExEP+W1BH5TdBDlu7vOwq76hgtjoQqhhZyLrmZ FPPLFTlPHX0Gk33+ikX1/aZ8/U1ixa8B5SUwymPXW8QQELLHKciWYDlkFTEZpuaOj6Id zERAvDdM7Jyeg8vXYgh0GhbOGFqyCaQYG5FoOj1gSDKZzKwCgFnJKuGvGM8rTqy6ZgcY XBJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ebcv03Ka; 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 l27si3016648ejc.524.2020.05.07.06.52.13; Thu, 07 May 2020 06:52:42 -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=Ebcv03Ka; 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 S1726542AbgEGNuA (ORCPT + 99 others); Thu, 7 May 2020 09:50:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56176 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726408AbgEGNt6 (ORCPT ); Thu, 7 May 2020 09:49:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588859397; 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=mtfeKIrFwLIEu5xU9YDtgCdmdoqxZ0ztvTPMoqop3dw=; b=Ebcv03KaZYfCxXGuunaz8svFginMzNYTMD6/CfHxId6UHwSfKqMDTqy2XX2+3CSm5Hs45l 7Gx37Oh2vYRe6fNCx0eom+RzunEGu9l3zTQdEmFz/qXLTerOu5aeWwii9nuGDjUeLV6Q8R fOj8A35LbuH2aF7jGgVzdtNkvbRbGvA= 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-428-pIKrsyx3PpWPxylVzzPlvg-1; Thu, 07 May 2020 09:49:52 -0400 X-MC-Unique: pIKrsyx3PpWPxylVzzPlvg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0D3E1895A29; Thu, 7 May 2020 13:49:48 +0000 (UTC) Received: from krava (unknown [10.40.194.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E28AD10016E8; Thu, 7 May 2020 13:49:41 +0000 (UTC) Date: Thu, 7 May 2020 15:49:39 +0200 From: Jiri Olsa To: Ian Rogers 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 , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian Subject: Re: [RFC PATCH 0/7] Share events between metrics Message-ID: <20200507134939.GA2804092@krava> References: <20200507081436.49071-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200507081436.49071-1-irogers@google.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2020 at 01:14:29AM -0700, Ian Rogers wrote: > Metric groups contain metrics. Metrics create groups of events to > ideally be scheduled together. Often metrics refer to the same events, > for example, a cache hit and cache miss rate. Using separate event > groups means these metrics are multiplexed at different times and the > counts don't sum to 100%. More multiplexing also decreases the > accuracy of the measurement. > > This change orders metrics from groups or the command line, so that > the ones with the most events are set up first. Later metrics see if > groups already provide their events, and reuse them if > possible. Unnecessary events and groups are eliminated. > > RFC because: > - without this change events within a metric may get scheduled > together, after they may appear as part of a larger group and be > multiplexed at different times, lowering accuracy - however, less > multiplexing may compensate for this. > - libbpf's hashmap is used, however, libbpf is an optional > requirement for building perf. > - other things I'm not thinking of. hi, I can't apply this, what branch/commit is this based on? Applying: perf expr: migrate expr ids table to libbpf's hashmap error: patch failed: tools/perf/tests/pmu-events.c:428 error: tools/perf/tests/pmu-events.c: patch does not apply error: patch failed: tools/perf/util/expr.h:2 error: tools/perf/util/expr.h: patch does not apply error: patch failed: tools/perf/util/expr.y:73 error: tools/perf/util/expr.y: patch does not apply Patch failed at 0001 perf expr: migrate expr ids table to libbpf's hashmap thanks, jirka > > Thanks! > > Ian Rogers (7): > perf expr: migrate expr ids table to libbpf's hashmap > perf metricgroup: change evlist_used to a bitmap > perf metricgroup: free metric_events on error > perf metricgroup: always place duration_time last > perf metricgroup: delay events string creation > perf metricgroup: order event groups by size > perf metricgroup: remove duped metric group events > > tools/perf/tests/expr.c | 32 ++--- > tools/perf/tests/pmu-events.c | 22 ++-- > tools/perf/util/expr.c | 125 ++++++++++-------- > tools/perf/util/expr.h | 22 ++-- > tools/perf/util/expr.y | 22 +--- > tools/perf/util/metricgroup.c | 242 +++++++++++++++++++++------------- > tools/perf/util/stat-shadow.c | 46 ++++--- > 7 files changed, 280 insertions(+), 231 deletions(-) > > -- > 2.26.2.526.g744177e7f7-goog >