Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1702957pxb; Fri, 10 Sep 2021 11:42:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6sm72sTxi8zkKvXZHEzx0U5gjE6H+J4o7gCYkJ7Cwo0D8/7WKDxyyQsjhpbURRRZ8Qu6v X-Received: by 2002:aa7:c857:: with SMTP id g23mr10550760edt.219.1631299349832; Fri, 10 Sep 2021 11:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631299349; cv=none; d=google.com; s=arc-20160816; b=EfP0nwNjdic1C42XRKG9WciyDiaml7af55cIZ0MHOk3kn1ts8XEBFwh6yii6hY+iQK otce/vpEYSE7xKJutH32ySFpk2oQom46opgseZiPOtPTMRwc6dTOleRmi5yEkXQ+/xz4 iJ7VaG6jqcSVBE4dNaMfFrRAKl92DFtN5vqW5OY3/KHLQDMF07GBnwkz34Wsj8cs0ZNT e9d+gGNAqGwsCYpnJA7JFmL/58K92zypRPnXqTWnJrVydjxNbIbQMa4hT0YYb9KnR7hc yeQftqDlzddb0a082oSZiJ+sxedPE6Lle+8kCcfMCEQbl14KvyA15FNkz/AZ/B5Rldmd mqJA== 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=h4jPQ7Zdr5Ida+XAg8yR3XSpVV86/qySljCfBrpPhJQ=; b=jKIaTxlzTMcIADgsyhNa9CxAT2eN0NejRm0E93tLnTVb7jyeI6pp7SmrcfttOG1Mwe Ux/5TOpmLKRS2ndakykNTg0xPnphhAR2QErcoc6a9GZIeJjFD2dHs7R703kVFJ2XCt6g U/y9FXcb+WSFxLCt5XKT8ahLUqnAXziRob4tInlyDcgkzx73ghlYFZRJcDlEWeWkqr2j C/Qwd3FYq6zsskttCUghz/sVNGmeHAKWCDJvLDsudAV/gyhuT9wAN2esb1Yo/+rY1amx MBdicuRa18L/vRy4dmNgeUptuiAel5nVdI45gnPp/oFqC74X1dp3yyGrO1wBA+TQY4Om iCCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=i3xiCww+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy1si6007666ejc.140.2021.09.10.11.42.04; Fri, 10 Sep 2021 11:42:29 -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=@infradead.org header.s=desiato.20200630 header.b=i3xiCww+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231932AbhIJSlt (ORCPT + 99 others); Fri, 10 Sep 2021 14:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbhIJSlt (ORCPT ); Fri, 10 Sep 2021 14:41:49 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0B4C061574; Fri, 10 Sep 2021 11:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=h4jPQ7Zdr5Ida+XAg8yR3XSpVV86/qySljCfBrpPhJQ=; b=i3xiCww++hTiz5JqZRPOVQX7Gi C6sQr8nV7lGvueiQy8NPgpQmXWZgFO5db9flVZvPYgtYrFXt3g54fBQ7s90XeOwKj6saipHh0Cy3A aZbMkCl0m/RjThlWDMCEz0SnFQSiZVHf4M1ypAQy3zwMDoACDlciEJxcv89b+RHwhSCo/l4p9WiRr 5s7tl/PbMXr2cz3VHJJSqQWBJU2o/YsvDHuk2oaCo8bXJKSJeaXLZe6lP781wRNKKTB4WRYHp551s xCUSDR+4FRNC9zpsRyxSpCgW/nW2J1959tYQkSJ5ypDlLig5S5D1h6WhXNE4h8fNapoSG3g1WmFct XkILBtJg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOlRs-002BtX-EB; Fri, 10 Sep 2021 18:40:28 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 4ED5B98627A; Fri, 10 Sep 2021 20:40:27 +0200 (CEST) Date: Fri, 10 Sep 2021 20:40:27 +0200 From: Peter Zijlstra To: Song Liu Cc: "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "mingo@redhat.com" , "kjain@linux.ibm.com" , Kernel Team , John Fastabend , Andrii Nakryiko Subject: Re: [PATCH v6 bpf-next 1/3] perf: enable branch record for software events Message-ID: <20210910184027.GQ4323@worktop.programming.kicks-ass.net> References: <20210907202802.3675104-1-songliubraving@fb.com> <20210907202802.3675104-2-songliubraving@fb.com> <96445733-055E-41E3-986B-5E1DC04ADEFA@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96445733-055E-41E3-986B-5E1DC04ADEFA@fb.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 06:27:36PM +0000, Song Liu wrote: > This works great and saves 3 entries! We have the following now: Yay! > ID: 0 from bpf_get_branch_snapshot+18 to intel_pmu_snapshot_branch_stack+0 is unavoidable, we need to end up in intel_pmu_snapshot_branch_stack() eventually. > ID: 1 from __brk_limit+477143934 to bpf_get_branch_snapshot+0 could be elided by having the JIT emit the call to intel_pmu_snapshot_branch_stack directly, instead of laundering it through that helper I suppose. > ID: 2 from __brk_limit+477192263 to __brk_limit+477143880 # trampoline > ID: 3 from __bpf_prog_enter+34 to __brk_limit+477192251 -ENOCLUE > ID: 4 from migrate_disable+60 to __bpf_prog_enter+9 > ID: 5 from __bpf_prog_enter+4 to migrate_disable+0 I suppose we can reduce that to a single branch if we inline migrate_disable() here, that thing unfortunately needs one branch itself. > ID: 6 from bpf_testmod_loop_test+20 to __bpf_prog_enter+0 And this is the first branch out of the test program, giving 7 entries now, of which we can remove at least 2 more with a bit of elbow greace, right? > ID: 7 from bpf_testmod_loop_test+20 to bpf_testmod_loop_test+13 > ID: 8 from bpf_testmod_loop_test+20 to bpf_testmod_loop_test+13 > > I will fold this in and send v7. Excellent.