Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp1213168qtg; Thu, 30 Mar 2023 10:01:29 -0700 (PDT) X-Google-Smtp-Source: AKy350Yyc2S2z1/ZAQZ4sux+2127pgYZt3Hia3/urgRKLuGcTcYfLss5/n9EseurA0yXJFbCW3HQ X-Received: by 2002:a05:6402:268e:b0:502:1f7b:f0a6 with SMTP id w14-20020a056402268e00b005021f7bf0a6mr25280598edd.0.1680195689546; Thu, 30 Mar 2023 10:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680195689; cv=none; d=google.com; s=arc-20160816; b=YpV5cRrHEDfWpQr6UCpupXU57+N7c5TFEJXmUvYjt5UlUvKYgE+Zw7gdp6F/KT/TwT pp+W/rKguGmUdge+WEJ448vFfBygnUMM5a9f84mR3ecHqmvA46fhaszPk3fNRY3ymdE/ MiumgvM2BWX9gfekn7b4sOFOi7bhmWowTWccV0VUBCe1sNF6fe67ZqMUpBLn/CfK3v3G czg+oErpQLiNpveHpRvCFJCwbYWOUModKOsaUntZcqkL7nQ8yYne13VDePZzAlTMhL9o Ty/0lAjsRPMt97lgKP+LfTxR7iPr5qFafWmQ4AC6XukZGGWqoby59taDDdcQ72WNSvgD nqQg== 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 :dkim-signature; bh=K7akp0Ej3ybKTtSvJmlVCO91f+z9Y4B731b6732Wg8Y=; b=ORlBGmBnQqW7GIEwHTi7Z9hRYCqGcosBmJOscuifmalMmlBSG7XMnjVlxEJZly/DXO ti97MzHLB9vfH+Yw1pIr5Q4w1ucm+F6a3t3oTsUrRghQvWjJw4R0HxsqimPXm1DnHtcL 4fjC5QF97PuZDt1id8YaUH4FDFxjk+FepiZ/HlkRlmTkSXzcMe+H3esPa7RsH8lBBXlz lG6Sud0hNVSRbr20TdPXTyd08o0JK4hjw8inXWa8FcovuHSX9SNSP8IKEE30QymPkMb1 YZbshlw6JBd3rLZg0ndXw52OwxcWuc/Oxtlv7dW3yYU2QO0x5Ic1vCVX69wjbC/QoXP4 rWsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kj8zI+oc; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a50eb07000000b004ab250bcee5si174588edp.647.2023.03.30.10.00.33; Thu, 30 Mar 2023 10:01:29 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=kj8zI+oc; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231970AbjC3Q75 (ORCPT + 99 others); Thu, 30 Mar 2023 12:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232027AbjC3Q7r (ORCPT ); Thu, 30 Mar 2023 12:59:47 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B7D72A2 for ; Thu, 30 Mar 2023 09:59:24 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-3e0965f70ecso532181cf.0 for ; Thu, 30 Mar 2023 09:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680195562; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=K7akp0Ej3ybKTtSvJmlVCO91f+z9Y4B731b6732Wg8Y=; b=kj8zI+ocoSj82Je2zA1JoXvjC2y0OvYJkSAoLrdeg8HrwyJ6I5YZVj/yjENQUYAtHQ ehTSTFDKnH2VBA5wUGZTxh9uOgN03WLqbWJTaKq+oq/rXgj+xw2JLn41QSDiCZmPsxgo +Qau9sjscmvkVy3C8hlQJlourjG728IMl2I5QBdEKLMWg6MPxywQ4cRTAEbLGJOAuVNm P42bRwImN32orsZKDwrqwGG4o2xLyfdFhf7N2j75D4f8Kzv9IAV34c7UYgBmBxKHRmfQ ICt3CY0I3p6LnJwWIR26tybK90sQnMcXEmZz2p/Y7nmfMk0X+dtDmoqq12WtJ8E65GzG hyKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680195562; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K7akp0Ej3ybKTtSvJmlVCO91f+z9Y4B731b6732Wg8Y=; b=c2wr1uiRdnuMPqiiMttqJcyj3kUFY5lMgFtUaHndcxa4GDDEgpWhl0JmNcMWiltQxn cuxaUCtRYTTKmAn4XFfOdCDKD3nfjSLuJAdy3ODyKj5ieerCk0BafNonSpAfqYCZmnaV efgk+M2GvR+lDPGy/zB7bVjwxc8sXfyjm+/o+l/bOEpTO0MSX9ElU6PGquK8D9I3+i2C jFdDq/69TR1ta7n8BirtobDst4MWKmta5EaRRzcbcjk29XmtteBshFcs4ect39jq/Rv2 Nf2Wei5jndrDTkOBFgz23QWBLY9+cx8bFAqKWiHUxSnvcF3su0puQsXhA5deEgxVY2EG adpg== X-Gm-Message-State: AAQBX9e3BPOjFPMGLDIiHUEzYR1E6lPXyAaCuW/agHg1AcJNrbzoRQb1 zJ2bMOSkxZEzU8ao6w7JneMUAsrU0onInIh9r6NfoA== X-Received: by 2002:a05:622a:1309:b0:3b9:f660:be05 with SMTP id v9-20020a05622a130900b003b9f660be05mr327826qtk.18.1680195562424; Thu, 30 Mar 2023 09:59:22 -0700 (PDT) MIME-Version: 1.0 References: <20230328235543.1082207-1-irogers@google.com> <20230328235543.1082207-2-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Thu, 30 Mar 2023 09:59:08 -0700 Message-ID: Subject: Re: [PATCH v1 1/6] perf annotate: Delete session for debug builds To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , James Clark , Andi Kleen , Kan Liang , German Gomez , Sandipan Das , Andres Freund , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Thu, Mar 30, 2023 at 4:24=E2=80=AFAM Arnaldo Carvalho de Melo wrote: > > Em Wed, Mar 29, 2023 at 05:13:17PM -0700, Namhyung Kim escreveu: > > On Wed, Mar 29, 2023 at 6:18=E2=80=AFAM Arnaldo Carvalho de Melo > > wrote: > > > > > > Em Wed, Mar 29, 2023 at 10:09:48AM -0300, Arnaldo Carvalho de Melo es= creveu: > > > > Em Tue, Mar 28, 2023 at 04:55:38PM -0700, Ian Rogers escreveu: > > > > > Use the debug build indicator as the guide to free the session. T= his > > > > > implements a behavior described in a comment, which is consequent= ially > > > > > removed. > > > > > > > > > > Signed-off-by: Ian Rogers > > > > > --- > > > > > tools/perf/builtin-annotate.c | 16 ++++++---------- > > > > > 1 file changed, 6 insertions(+), 10 deletions(-) > > > > > > > > > > diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-a= nnotate.c > > > > > index 4750fac7bf93..98d1b6379230 100644 > > > > > --- a/tools/perf/builtin-annotate.c > > > > > +++ b/tools/perf/builtin-annotate.c > > > > > @@ -692,16 +692,12 @@ int cmd_annotate(int argc, const char **arg= v) > > > > > > > > > > out_delete: > > > > > /* > > > > > - * Speed up the exit process, for large files this can > > > > > - * take quite a while. > > > > > - * > > > > > - * XXX Enable this when using valgrind or if we ever > > > > > - * librarize this command. > > > > > - * > > > > > - * Also experiment with obstacks to see how much speed > > > > > - * up we'll get here. > > > > > - * > > > > > - * perf_session__delete(session); > > > > > + * Speed up the exit process by only deleting for debug build= s. For > > > > > + * large files this can save time. > > > > > */ > > > > > +#ifndef NDEBUG > > > > > + perf_session__delete(annotate.session); > > > > > +#endif > > > > > > > > So now, but default, we will call this, as we don't have this defin= ed > > > > only if DEBUG=3D1 is set, right? > > > > > > > > =E2=AC=A2[acme@toolbox perf-tools-next]$ find tools/perf/ -type f |= xargs grep NDEBUG > > > > tools/perf/util/mutex.c:#ifndef NDEBUG > > > > =E2=AC=A2[acme@toolbox perf-tools-next]$ > > > > > > We can discuss this later, applied the series with just that zfree() > > > change to annotation_options__exit(). > > > > I don't think it's just an issue in the perf annotate. Maybe we can > > do the same for perf report and so on. > > Yes, I thought at some point of setting some flag, perf_exiting, and > then we would stop releasing memory, zfree comes to mind, but then we > would still be traversing data structures, taking locks, etc. > > And we can't just exit() as we may need to flush caches, etc. > > IIRC this specific case appeared in profiles, so was commented out. > > > Anyway we could define NDEBUG=3D1 for release builds from now on. > > Yes, we should do it. I'll send out a patch. Just a heads up that this will also disable asserts for non-debug builds. Thanks, Ian > - Arnaldo