From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B796C433B4 for ; Fri, 14 May 2021 09:04:13 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADA7961352 for ; Fri, 14 May 2021 09:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADA7961352 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TUiPq2bnQFShkUHRbdaTZlCz5IbUKvsl6h7kY0GhgiA=; b=ljX++Tw1TL02U6Qd/qOf3fZS5 gNHoa0w5GNu5A4WkPMR2Y92ZEZ1MXl1IultTXl0vnVDZOfPfuojx3gMm7J2zTE0JE5ZLSWgaistmM rmu7hnbIOqeVG9FIsq1RejFXfkhYyx6EWqkqBeq888S7EH6ZFfVNN2qxlvkovKKP3gb7yO4KMI6Ux L2+k7rMR4jT6Bdfkh6cEibiIjEHzJPX4pVYaqAJ5rTQS09xuI1BDIP6sGI5CizIaFnYdhQuvcoWwH EnMdS64auncc7Bc4nTDH5XIze8Ng9PyeSd+LMcaQ4aCku3PrUDjo2NVs8stVe86G9HWIrOn64jXq2 h99g4jjUg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhTiX-007ZwW-RI; Fri, 14 May 2021 09:02:45 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhTiU-007ZwH-4k for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 09:02:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bmy2Uqsw2QuKuHm1ybPQZQWyi8EUmOUGKG4Y6vTEjqU=; b=KpxDYqEn7+oC6H2nhIdVubkYsN gn/a1o1wbQ082hQpSG2GgLnAVYr9dvJGsoijOnPk4Gj8Mxn3hGww73DcH2vN0c/W+qtG4tqsKjZKF cHzIAUfHbdJVEuGXtY0iM1iBlUjcCzqhFLnGTMku4JsOSIHXP6cC/C85wl9K+yDgjwQRmcjdjnzhV YGE+q7m5OK6AYVPtGX/BlzC47RbUX/IenTWvqioZtwzC4Q6wEJk9GI/Yop8ypzF0krcWy2+IS52al mkHsDZyR2+4/tjNgdGeSfxQXQPLaiXaY7Q1LQenZmbRwbPy1J1VVod/hEsSy1SZRohIaSihzBfcZE 1V4cWUYQ==; Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhTiR-00BqER-1b for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 09:02:40 +0000 Received: by mail-pj1-x102a.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so1317199pjv.1 for ; Fri, 14 May 2021 02:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bmy2Uqsw2QuKuHm1ybPQZQWyi8EUmOUGKG4Y6vTEjqU=; b=Cp00vzL4kXyNotOnjr+/W81i9dt6xyElB+hUtFGh/h++AXPJlcuwEQIZZxZK/7e2kT ZBUh0PecJoJ5bzcJSTO+OcZ6FSvAJAMPMq9HsPQ7XhT9vlKzGpKrh41qMDM6p8zOCv0X rmysTsFT0hy74CYWNvIx81sgxCoTmiNLxeKlrTvC2zWoj8Nzvu8WtxxC5JyxGvxk3gL2 gmcbI2un/b7tyrpunIT5o0hYAvdjfFRsozg3lijEOzV4UeyDnZFnSQky9KISaIj3CFcY Cf8bhwF9Moin79pBT+SYFM2WZuUBrEDLl6cnB2D5tGa0u807Ab2PflSg772sqRYKCzWZ dRxQ== 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; bh=bmy2Uqsw2QuKuHm1ybPQZQWyi8EUmOUGKG4Y6vTEjqU=; b=bzWt6GSWBZc2Kn9FfLsWLzbGNZ5AVBOA7rskG8zxIZ43n3bnH3OLeHqu1IcSochpWa Y49MnoQPmRHFSq8oZcSLiQMqpQXGVtVdSN6FtZTK0c/41po7Vs/eyXHwdWQsslUBxii3 LptM4mkFoZzxbKuM19qz9rLqi/WRdKh3pHySAZoLFzAMCXrtCqcSgQPKk2dPSK9ns5Cg 6QsB7TsYwYS4s8YuwHj5+vsvm99ZA9hGqD/OZ+13h8wan5D6myfPZ/gr/Wb1xNEOhIIh ckzazpQH+dioE7WC5QxBcZw9LM44eGInE9pKjk6dgZM8sfNUl18uLfUjkAS4QonJAUnd JRTw== X-Gm-Message-State: AOAM530oRNevqRCVSTlUOYC1YGgxJcLCRakZNhuJLAmFknqA+WOpp9oz gmeo3NyUAk1+c4NVD0mftPr7D0FjrEOg+3tViuNUPw== X-Google-Smtp-Source: ABdhPJzEn1cJ/Ltk5VjOsHGJ9I6TQezb2UQMwCjXbz7UUX8biSciqaZ9RR+4l7DWfvvRfgZqLnHr+68YzmYvWIVbYI0= X-Received: by 2002:a17:903:4106:b029:e9:244f:9aca with SMTP id r6-20020a1709034106b02900e9244f9acamr45378184pld.58.1620982956733; Fri, 14 May 2021 02:02:36 -0700 (PDT) MIME-Version: 1.0 References: <20210421120413.3110775-1-daniel.kiss@arm.com> <20210426175425.GA1391779@xps15> <20210427154746.GA1422814@xps15> <20210427160443.GA208852@leoy-ThinkPad-X240s> <20210505152919.GA1766375@xps15> In-Reply-To: <20210505152919.GA1766375@xps15> From: Denis Nikitin Date: Fri, 14 May 2021 02:02:25 -0700 Message-ID: Subject: Re: [PATCH 0/4] coresight: Add ETR-PERF polling. To: Mathieu Poirier Cc: Leo Yan , Mike Leach , "coresight@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , Daniel Kiss X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_020239_130904_9057AA9D X-CRM114-Status: GOOD ( 38.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 5, 2021 at 8:29 AM Mathieu Poirier wrote: > > On Tue, May 04, 2021 at 11:46:20PM -0700, Denis Nikitin wrote: > > On Tue, Apr 27, 2021 at 9:04 AM Leo Yan wrote: > > > > > > On Tue, Apr 27, 2021 at 09:47:46AM -0600, Mathieu Poirier wrote: > > > > > > [...] > > > > > > > > 2) ETR polling ensures that more trace is collected across the entire > > > > > trace session - seeking to reduce inconsistent capture volumes. > > > > > > > > I am not convinced disabling a sink to collect traces while an > > > > event is active is the right way to go. To me it will add (more) complexity to > > > > the coresight subsystem for very little gains, if any. > > > > > > > > If I remember correctly Leo brought forward the exact same idea about a year ago > > > > and after discussion, we all agreed the benefit would not be important enough to > > > > offset the drawbacks. > > > > > > > > As usual I am open to discussion and my opinion is not set in stone. But as I > > > > mentioned I worry the feature will increase complexity in the driver and > > > > produce dubious results. And we also have to factor in usability which, as > > > > Al pointed, out will be a problem. > > > > > > Just want to remind one thing for ETR polling. From one perspective, > > > the ETR polling mode is actually very similar with perf's snapshot > > > mode. E.g. we can use specific interval to send USR2 singal to perf > > > tool to captcure CoreSight trace data, thus it also can record the > > > trace data continuously. > > > > > > I can see a benefit from ETR polling mode is it might introduce less > > > overhead than perf snapshot mode. The kernel's mechanism (workqueue > > > or kernel thread) will be much efficiency than perf's signal handling > > > + SMP call with IPIs. > > > > > > So it's good to firstly understand if perf snapshot mode can meet the > > > requirement or not. > > > > We evaluated the patch on Chrome OS and I can confirm that the quality > > of AutoFDO profiles greatly improved with the ETR polling. > > Tested with per-thread and system-wide mode. > > > > Without ETR polling the size of the collected ETM data was very > > inconsistent on the same workload and could vary by a factor of two. > > This, in turn, affects the quality of the AutoFDO profiles generated from ETM. > > With ETR polling the data size became pretty stable. > > Performance evaluation shows a similar consistency in performance gain > > of AutoFDO optimization. > > This, I think, supports the idea that data collection right now is sensitive > > to the process scheduling and can be improved with ETR polling. > > > > For the system-wide mode particularly we didn't see any other alternatives > > to collect data periodically on a long-running workload. > > We haven't tested snapshot mode though. The idea sounds interesting. > > But small runtime overhead is crucial for the sampling profiler in the field > > and if there is a noticeable difference we would incline towards the > > ETR polling. > > Please see if Leo's approach[1], or any kind of extension to the current > snapshot feature, would be a viable solution. Reusing or extending code that is > already there is always a better option. > > Thanks, > Mathieu > > [1]. https://lists.linaro.org/pipermail/coresight/2021-April/006254.html > Hi Mattieu and Leo, I did some evaluation of the snapshot mode. Performance overhead is indeed higher than with ETR polling patch. Here are some numbers for comparison (measured on browser Speedometer2 benchmark): Runtime overhead of ETM tracing with ETR poll period 100ms is less than 0.5%. Snapshot mode gives 2.1%. With 10ms period I see 4.6% with ETR polling and 22% in snapshot mode. We could probably utilize the ETM strobing feature and reduce frequency of data collection but I see a problem when I'm using both. Within a minute of profiling the ETM generates a reasonable profile size (with strobing autofdo,preset=9 with period 0x1000 it is up to 20MB). But then the size grows unproportionally. With a 4 minute run I got a 6.3GB profile. I don't see such a problem with the ETR polling patch. Leo, could you please take a look at this problem? Thanks, Denis _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel