Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6727645ioo; Thu, 2 Jun 2022 12:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzosl0H6UcglQaF9LOEf2Oaafrq16IIq750op3dfZMAVGJdBvCN89wTtsxshMSJL4ikvzmr X-Received: by 2002:a17:907:16a1:b0:6fe:ffd9:b14f with SMTP id hc33-20020a17090716a100b006feffd9b14fmr5478846ejc.573.1654197719146; Thu, 02 Jun 2022 12:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654197719; cv=none; d=google.com; s=arc-20160816; b=exHjgNnw0XGXLGoVwxGAx4o56wbqlL1kSBtL9vjaaSsY0lRXE0k+roRWuL4V/RHPzJ BH54U/FWSNhGBaWvyxscaw5uAXMCyFzutIV24yOYm3E6xWcAT3IodH0cr15uor52h72F ko/utguMZ9/E1bi3AnX0OKat7FG3RCu9Ddt4DCipyyRtO8aRgIMeuUaUUnTZ1I1WFOqs V7AwqF3E7owq2io7df3u79rC+rp2W7VpTO8HZmzqcbrbT9wQV0MJmARHFvEfiTOsb+XQ 2R7gHIfMr8K4UcnAwZZZB4rDQwWgw8qLdp5omZHdpvv39xIQlASaS40H0AjMNoEFHVhZ SzsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=3EQWRapb86jrmBhhoFarjUCiUBwfFwmpW+YgowzDE50=; b=nYMgkJO9xUVjkRgzUS3+LN6UWFQepG4v87ectlD79zpQ+I0Onq5Za5B7tschXPG93X LuEnCMp57U89KMvF6kSk9Wx1dUcHIcup4kTvybv4OsjCnTU0HMFafN576zohBScVJcjO SU2zM7IVYrHet65beQ9IM8ZNhHpQTAVkwo/xDZDiHV+S9WzmpALPLkJdVdIS7iqrMxAe VRuNapjuAEqjdo4hvWiU2aqeP/ITc0dyoBG8MZ5bte04cKmiR3w3RaZ/gSkNNcWUU+ks rQ3J2pkR2ADPNgQ96oETJdC5FLbvprYV4PL75RowP3AuB1FWCR8v8gcgGeeJGxkSqPhV +0BQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a1709066bc200b006ff0fb360ffsi5038903ejs.10.2022.06.02.12.21.33; Thu, 02 Jun 2022 12:21:58 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234975AbiFBM0V (ORCPT + 99 others); Thu, 2 Jun 2022 08:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235017AbiFBM0Q (ORCPT ); Thu, 2 Jun 2022 08:26:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F72F298585 for ; Thu, 2 Jun 2022 05:26:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1ED4561751 for ; Thu, 2 Jun 2022 12:26:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E44DC34119; Thu, 2 Jun 2022 12:26:03 +0000 (UTC) Date: Thu, 2 Jun 2022 08:25:59 -0400 From: Steven Rostedt To: sunliming Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, kelulanainsley@gmail.com Subject: Re: [PATCH] tracing: Simplify conditional compilation code in tracing_set_tracer() Message-ID: <20220602082559.795189e1@rorschach.local.home> In-Reply-To: <20220602022404.508144-1-sunliming@kylinos.cn> References: <20220602022404.508144-1-sunliming@kylinos.cn> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 On Thu, 2 Jun 2022 10:24:04 +0800 sunliming wrote: > Two conditional compilation directives "#ifdef CONFIG_TRACER_SNAPSHOT" > are used consecutively, and no other code in between. Simplify conditional > the compilation code and only use one "#ifdef CONFIG_TRACER_SNAPSHOT". I think you mean CONFIG_TRACER_MAX_TRACE here. -- Steve > > Signed-off-by: sunliming > --- > kernel/trace/trace.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index f400800bc910..dc959e339512 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -6430,9 +6430,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf) > synchronize_rcu(); > free_snapshot(tr); > } > -#endif > > -#ifdef CONFIG_TRACER_MAX_TRACE > if (t->use_max_tr && !had_max_tr) { > ret = tracing_alloc_snapshot_instance(tr); > if (ret < 0)