Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1984299rwb; Fri, 28 Jul 2023 19:57:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0pumlIknMCIfWnrGrLG77uC4uyDMawlLgv3ZwvOQvVPhcW7SrtLG3HtLR2R9JDkwRbhd3 X-Received: by 2002:a17:90a:b015:b0:268:1489:959e with SMTP id x21-20020a17090ab01500b002681489959emr2820498pjq.33.1690599476974; Fri, 28 Jul 2023 19:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690599476; cv=none; d=google.com; s=arc-20160816; b=zB0OUWQP8bBljD8kLnAPyUf8MRn0JRAIrEYO99mdUIoS2y8dvvam/W1hY8LCj2gjLg WW5VIUhxApnrhDm/jEPu/AN3CRuygszr0gCKGrKlt3kZogT9zD1WKBJaSwRLx+AdI6tn BR9wS36AsXNGp4n/xOOrO07ZT/CzNTbUvaxvo8oyAhzuWMpEhLCxEmpUn9YyId8ACx85 nzTdbYsIm7nyC+OwLDR/lpTV9oh6kZkPIxMFZL2Ovrl8QWdstxzWlydbl+Nr2NECQ1lq Cr4+nLMelcOKY5o7ixNyrqArsW8jcnBwifQvQZSdMr5BQOaLTeUSNI4NKl0oHKItq31b hUjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Lqpgl/kTgITrX/o3BYeOTwWhm85GKoPqRrxyNtu/9ek=; fh=lTSmx0+Bfqh+WoPnVIbzftPt92NpNBuAD05Hn3LxsqM=; b=MX7CV5dxnTa041s7fFTFMIVtnKjDpFLtjD1hU41AyKA9Lmu4Ru84DzuYX5l+MJg4TE E92cLCKzVbNTx5xiF/1jOP7BIkWOYv5/613FGxlS9ncV6ksLK1SGGSsQ0k5C/obXfut9 sd3ra2MWPlBpSjUFN4eAd95XgHLYlDhv10I5c3WvCcEeW8wBxgj5ufkVhzI3Fh+z+h/x MQvRRmLWsUqCH6PJgm8Oa5q/XeohCi9ahxlgYrTMH+u5wKQmlRFSwUL9rplzAgcUnSkX hwW3xZEFLf8tXbD9jyNcoA1A7ir7G7R1+WCvu+mhmg0Ki8j4+lgIXNsY7F5hSlKdt39b rQRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fv4-20020a17090b0e8400b0026577f28dbcsi3432870pjb.45.2023.07.28.19.57.45; Fri, 28 Jul 2023 19:57:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbjG2CLG (ORCPT + 99 others); Fri, 28 Jul 2023 22:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjG2CLF (ORCPT ); Fri, 28 Jul 2023 22:11:05 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45B284498; Fri, 28 Jul 2023 19:11:03 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RCScL4QvvzVjr7; Sat, 29 Jul 2023 10:09:22 +0800 (CST) Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 29 Jul 2023 10:11:00 +0800 Subject: Re: [PATCH v2 2/7] perf evlist: Add evlist__findnew_tracking_event() helper To: Ian Rogers , Adrian Hunter CC: , , , , , , , , , , , , , References: <20230715032915.97146-1-yangjihong1@huawei.com> <20230715032915.97146-3-yangjihong1@huawei.com> <993bd68c-c0ec-4960-d3b0-bd2dbda82402@huawei.com> From: Yang Jihong Message-ID: Date: Sat, 29 Jul 2023 10:10:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 2023/7/29 0:40, Ian Rogers wrote: > On Thu, Jul 20, 2023 at 12:24 AM Yang Jihong wrote: >> >> Hello, >> >> On 2023/7/20 0:44, Ian Rogers wrote: >>> On Fri, Jul 14, 2023 at 8:31 PM Yang Jihong wrote: >>>> >>>> Currently, intel-bts, intel-pt, and arm-spe may add a dummy event for >>>> tracking to the evlist. We may need to search for the dummy event for >>>> some settings. Therefore, add evlist__findnew_tracking_event() helper. >>>> >>>> evlist__findnew_tracking_event() also deal with system_wide maps if >>>> system_wide is true. >>> >>> I'm wondering if we can simplify the naming in the API, we have "dummy >>> event" which makes sense as we literally call the event "dummy", >>> "sideband" which refers to the kind of samples/events the dummy event >>> will record but "tracking" I think tends to get used as a verb rather >>> than a noun. So I think evlist__findnew_tracking_event should be >>> evlist__findnew_dummy_event. >>> >> Uh, from the discussion that followed, it seems that there is no >> consensus yet... >> If there is a clear consensus on whether to use "dummy event" or >> "tracking event", I will change the name of the API. >> >> I think sideband event is equivalent to tracking event (refer >> evsel__config(), tracking events include task, mmap, mmap2, and comm >> sideband events, which are all sideband). >> >> tracking event are instances of dummy event. For example, we create >> another dummy event to record the text poke event of ksymbol (refer perf >> record --kcore). >> >> An evlist contains only one tracking event, but can contain multiple >> dummy events. > > Thanks for the feedback. So the tracking event is by definition the > first dummy event in the evlist? What is the purpose of the other Uh... It may not be the first dummy event, but evsel->track must be true. Only one evsel in an evlist meets this condition. > dummy events in this case? Perhaps we can get to an intention > revealing implementation something like: > > /** The "tracking event" gathering sideband data is the first dummy > event in the list. */ > struct evsel *evlist__findnew_tracking_event(struct evlist *evlist) > { > struct evsel *dummy = evlist__find_first_dummy_event(evlist); > > if (!dummy) { > dummy = evlist__add_dummy(evlist); > } > return dummy; > } > > But I think the key thing for me is I'm still not sure what is going > on when there are multiple dummy events for you, what are the other > dummy events for other than tracking sideband data? > For other dummy events, perf record will open a dummy event to track ksymbol text_poke when "--kcore" option is used. I thinks tracking ksymbol text_poke separately it needs to be processed independently, go system_wide and enable immediately. All of the above is my understanding, may need Adrian to confirm whether it is accurate. Thanks, Yang