Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp328199pxv; Thu, 8 Jul 2021 22:34:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT036KFvtJy2uQvv71zgtSRzEt+Lc8yLddqOzlNrB2eJBBexBifx7DZ7yNbBVPlW+Jxa22 X-Received: by 2002:a05:6638:2245:: with SMTP id m5mr14841847jas.137.1625808884728; Thu, 08 Jul 2021 22:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625808884; cv=none; d=google.com; s=arc-20160816; b=bilSsRE5gvN6eQRikCIWOyL/PsdxV9McFiPkeB0rZ9Xscs50HmuC8zi0TiVVj6smDO AirL1OiVjnb/P95OM6LiZme1L/ktm3h1s8vqCS0fIYywNUB5u+ht4Tk7NBjVdSlv74fA XbMhvglROAZ9H9Dxq07mul4cXiA9ighM6MBQiG9l3A2z8u+acuZfYoZcVPwiFhhLxBah oS5v9/W7pOdtO7gNLf+A1kHokKntBou1Dkcn1nh6JFb4n82o4C797X6XFLNhT42dU1u0 wJ3mSr2kvRwOGGJ/dXk+hf0QDFVpP5Z464VvLh48Gsg/R6ROjghPzpa5fV+VK9ULI4Pi mXjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=mq1AQEht3QmZvXsOR6N+7rxeYkgS2bV0Ic8FTuxiRbY=; b=E9ubyTxtWN4gZAjyvyCNcH6jk1jBRq507ZnByfgcsfTRBEWcFWzlbxnGw8clZNAVC+ bdYna6Zc+wSelEnlymuc6IBhIduONjXoN2ocZs1muLTkWo8JQqza2kpJvYIbko/Wg+po ROk+MP51jedDkis7cqZYNQStVKBjWPYkOIrRv+aO9WNnBnypj8KKqwVnYZ9Gnlm9WW4U bEFhui4J+iSsTTYnwTRxyrc6i1Ke+kQ1QWAQACn5fHfLlyI3taXubvM2kubOTwpD+72y r/9WxjVlv87cdggBmVMMyIIaUcOYK8ClSRTfMbwB0SlEZk10GjLsykRiayc+DtDakAhC lWkQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si2469619ilc.155.2021.07.08.22.34.29; Thu, 08 Jul 2021 22:34:44 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbhGIFfJ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 9 Jul 2021 01:35:09 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:34483 "EHLO mail-lf1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhGIFfI (ORCPT ); Fri, 9 Jul 2021 01:35:08 -0400 Received: by mail-lf1-f49.google.com with SMTP id f30so20934361lfj.1 for ; Thu, 08 Jul 2021 22:32:25 -0700 (PDT) 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:content-transfer-encoding; bh=of4Uv1oDCY66895me70gs3mz9ALtLfQtgbhRU7pneuU=; b=A5RscwD2jgf9D+Bho6Z7oIUBfO0JDnJV3ooGOSBicVFQFiwdhdK0fA4niRgi+QqNII v2bs//VzNQWixaGbJo3eq6Yn3V2y1n3qBOk6/IBUN51VlAKix85+jcwCwuzJvyhPtdzP VBOiYq/ZuOvBWDwPaa3dK2iPM2x8kvMu63e4WWJOtcMoDjHB/Rg1FqlEL+HdDcoVsjem g+H/QKvq8LIB7FJuwT1u48Sm+5pULc7Iy4t3eGtqwW+arh91aeXE3cyT3Or8UYs2pKrr QTq4G+BnMYeYwplPPPkPkWfucKbll1QhbwELhJmBA4VGXo0l9heTZlPPE6CdE2UNBOpB 26yw== X-Gm-Message-State: AOAM530S8raU92RPBLjdZggvjXz/WwFejx/zkyv2IvMCylvjqkaoe/hD HqmdPPfd4chYWalenhN8wQv0ms8FFEwGH/e+T/o= X-Received: by 2002:a05:6512:3125:: with SMTP id p5mr7054396lfd.635.1625808744642; Thu, 08 Jul 2021 22:32:24 -0700 (PDT) MIME-Version: 1.0 References: <1625760212-18441-1-git-send-email-kan.liang@intel.com> In-Reply-To: <1625760212-18441-1-git-send-email-kan.liang@intel.com> From: Namhyung Kim Date: Thu, 8 Jul 2021 22:32:13 -0700 Message-ID: Subject: Re: [PATCH] perf record: Add a dummy event for a hybrid system To: "Liang, Kan" Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Jiri Olsa , linux-kernel , Yao Jin , Kan Liang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 8, 2021 at 9:05 AM wrote: > > From: Kan Liang > > Some symbols may not be resolved if a user only monitor one type of PMU. > > $ sudo perf record -e cpu_atom/branch-instructions/ ./big_small_workload > $ sudo perf report –stdio > # Overhead Command Shared Object Symbol > # ........ ......... ................. > # ...................................... > # > 28.02% perf-exec [unknown] [.] 0x0000000000401cf6 > 11.32% perf-exec [unknown] [.] 0x0000000000401d04 > 10.90% perf-exec [unknown] [.] 0x0000000000401d11 > 10.61% perf-exec [unknown] [.] 0x0000000000401cfc > > To parse symbols, the side-band events, e.g., COMM, which are generated > by the kernel are required. To decide whether to generate the side-band > event, the kernel relies on the event_filter_match() to filter the > unrelated events. On a hybrid system, the event_filter_match() further > checks the CPU mask of the current enabled PMU. If an event is collected > on the CPU which doesn't have an enabled PMU, it's treated as an > unrelated event. > > The "big_small_workload" is created in a big core, but runs on a small > core. The side-band events are filtered, because the user only monitors > the PMU of the small core. The big core PMU is not enabled. > > For a hybrid system, a dummy event is required to generate the complete > side-band events. > > Signed-off-by: Kan Liang Acked-by: Namhyung Kim Thanks, Namhyung > --- > tools/perf/builtin-record.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index 3337b5f..99607b9 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -891,11 +891,12 @@ static int record__open(struct record *rec) > int rc = 0; > > /* > - * For initial_delay or system wide, we need to add a dummy event so > - * that we can track PERF_RECORD_MMAP to cover the delay of waiting or > - * event synthesis. > + * For initial_delay or system wide or a hybrid system, we need to > + * add a dummy event so that we can track PERF_RECORD_MMAP to cover > + * the delay of waiting or event synthesis. > */ > - if (opts->initial_delay || target__has_cpu(&opts->target)) { > + if (opts->initial_delay || target__has_cpu(&opts->target) || > + perf_pmu__has_hybrid()) { > pos = evlist__get_tracking_event(evlist); > if (!evsel__is_dummy_event(pos)) { > /* Set up dummy event. */ > -- > 2.7.4 >