Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6038588ioo; Wed, 1 Jun 2022 19:26:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbQK8sNtPQA88EDcj6JcDc44tq5w0jPxbae9NZQPczrMJJVkwNUNmOyCAO5XN8uK0G6kQH X-Received: by 2002:a17:903:2443:b0:162:223c:c0e9 with SMTP id l3-20020a170903244300b00162223cc0e9mr2397126pls.68.1654136795644; Wed, 01 Jun 2022 19:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654136795; cv=none; d=google.com; s=arc-20160816; b=WsehFTXhgFFmYg+kzuYHnPzmda4TcyLtiHstf6TkNQIGtcQCsZ/66GeSIhxbL6rR15 UmYFcrjeQrzzRF1XjY1u1yNET6vWlZk7kzrU2+ZGXMw+0QQLUPqfmarOGddqv/jj7FTV fPZXBdB+mTOQIgMxcY47oryQ6MpiVV2AXdKg/p+ytrptIxgai9M8skyXfyEFKBzeeRpY 5KKKPsMgVypjv8J5219Ucsz2Hm9xfdXpHmsHDj1qEvpki7M5WD94170hNlf6TLjW1yLa lCRNhkZ1yhsX9UWqvt0I3FAxjj+cXiaimgR4tlS0/jF1iZ6IemmndEgQK4mFSL1ZgPPC Lj+g== 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 :message-id:date:subject:cc:to:from; bh=b52PV6mrU9o8+FvC9yaWVqERZDe2RTNVemxHy3gfmCE=; b=jfSEuFz6iCxErT67+gqGJ3aXcQfXELQJhuSNs1Lh6psK1QGkdIDaJVDzv4chao1O59 2oaje/aHeZ+M/qOnHVHxWkv86yGkroSYg0YMFs395iVRPkcH9CKzvo9GvWvNKqrfFD9r JIMsy/q63/5jc16o0iwbgR73NckQxFMbvk2IGwGWRA6c9nO6DF46qmcO2r+uCPRC6Y+g kQoTJHv6KWivVLBvRWIfKgUJ+2R0k2PY7WBkO8A2H9uRXpTokwA3y97wsEnMkxiskRCN itbVnmUzOJ6/K+EqbhhTj+2ZMfy4ItgqR0cWkO+3jZ4n/qUCHD82PL5UYpwpaqmCtS4b nYjg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i11-20020a63130b000000b003fc7efc3f5fsi5178967pgl.194.2022.06.01.19.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 19:26:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA22482177; Wed, 1 Jun 2022 19:24:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233273AbiFBCYR (ORCPT + 99 others); Wed, 1 Jun 2022 22:24:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232838AbiFBCYN (ORCPT ); Wed, 1 Jun 2022 22:24:13 -0400 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA73A70345 for ; Wed, 1 Jun 2022 19:24:12 -0700 (PDT) Received: by mail-pj1-f67.google.com with SMTP id gd1so3683545pjb.2 for ; Wed, 01 Jun 2022 19:24:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b52PV6mrU9o8+FvC9yaWVqERZDe2RTNVemxHy3gfmCE=; b=5MDn1eOEMgwIu6la4sQGzDw3UYJAuL+N0Tz8/a+a7g0ibJGAaSdpViFj0jWn33OmQq lyQf5gxrcczZsXVCrB6nemOmR6Op5+FhCTLSOdf1aPg8IyJlgCoBDp6yUW911PS5V2rU IYgXVa6QoeLMh9SsyNfHL9VlKtmMADb7PK9aKgJMV6AkTdrInq35WOZDR1XKMCU7T5ck lGRCZyVekl8GNBJyivfHEstuG5i8b4RdINQce8VTJmTi1Usmcd3PvvVBK2ZG/De+QTeD PfF3tKSE5Bx31OHrCPhKcl8WDtc8A+dO9vIqAfZceb+MiVfjIoBhVYMnpPrgkUJtJF3C 0Few== X-Gm-Message-State: AOAM532cjhwMayVkXoHuTDmbnOVvnGHwHqaxeVnDKSkoBYgzotNO0f3h pYD/SzGrbEOS2zmDpc85TA== X-Received: by 2002:a17:902:ce87:b0:163:fc5e:398b with SMTP id f7-20020a170902ce8700b00163fc5e398bmr2392123plg.125.1654136652207; Wed, 01 Jun 2022 19:24:12 -0700 (PDT) Received: from localhost.localdomain (ns1003916.ip-51-81-154.us. [51.81.154.37]) by smtp.gmail.com with ESMTPSA id z6-20020a170903018600b001621a66b318sm2303787plg.130.2022.06.01.19.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 19:24:11 -0700 (PDT) From: sunliming To: rostedt@goodmis.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, sunliming@kylinos.cn, kelulanainsley@gmail.com Subject: [PATCH] tracing: Simplify conditional compilation code in tracing_set_tracer() Date: Thu, 2 Jun 2022 10:24:04 +0800 Message-Id: <20220602022404.508144-1-sunliming@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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". 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) -- 2.25.1