Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1649058ybt; Sat, 11 Jul 2020 18:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHu1KuFzYjCiPjkw1igqPhwIYLBUWdJbpigs1sBN5ICGXwKzTAlud7vxyTRfgWIrUZvRIu X-Received: by 2002:aa7:c606:: with SMTP id h6mr83399815edq.363.1594516349393; Sat, 11 Jul 2020 18:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594516349; cv=none; d=google.com; s=arc-20160816; b=wDp+K+2/FDsZ25r6ysLB8pAZ56cwP6n7kR5BdfSoC9Vg8BI4V+X4A24vzxc0W5vJ9j sCZWZkuovSjCPDkkObmny9yEpsPpo0QERxi6gSWfpJAmGKd1qm77kQZLWgRea3sCXvGh YG9qMgfK7AlFb3XmYcGu1H3XAjNkVK3FaQrKjcStls930NmkS5FcEuDC0pCXpAd9ovEH xLnK2sLaL58BrKG4aHHl5+HVzgidjXupfwM9y/r0wAUb2O1QebLZbyW1vU6n/w8wl+Ri 7yDCzqW+01lzj4XOvzIRUiCp2oz4ehIW3+SM6D2aXYVL80xCTFwPycxiF52jLfRLcZaB Spew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sxvvgCDQ2V/S8P9zQ5PdJEuwhf37alWqNxcZBhUJ8ME=; b=kI6QuqhLBYv1VQgMEztXbvhFGbhHUmFefrdJVrS8rdaBnF7j9JvUK03yLzERHy4iIu rku5bQwLXYl8Pg07naVtPNcRZkFxY1KzlsVm7nuvLWARZ0s2IjgCg+59Ikdhtkk4ASJu 6uMvoqbj+nQiPO3sKOiWrk69vRGF6G9hw6Y2WmVal7vh83CrmnICylxzuq8q/c7FDTTC 6QuvsjEnhF4PENUzfoCFbyDF0j2ZoJTUfaX+7X3xMoETfv09VxJtwlLoKA1KuXG8cbq1 u09t83O8V6iswt3Y1LaaH4rf3lU6aIvtO588jbn8lh0Lu/hp4hMKtAJvw6dCqgZigugX ZCXQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si6256694ejd.639.2020.07.11.18.11.49; Sat, 11 Jul 2020 18:12: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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728149AbgGLBLi (ORCPT + 99 others); Sat, 11 Jul 2020 21:11:38 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:51002 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbgGLBLi (ORCPT ); Sat, 11 Jul 2020 21:11:38 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R551e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07488;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0U2P6M2A_1594516295; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U2P6M2A_1594516295) by smtp.aliyun-inc.com(127.0.0.1); Sun, 12 Jul 2020 09:11:35 +0800 From: Wei Yang To: rostedt@goodmis.org, mingo@redhat.com Cc: linux-kernel@vger.kernel.org, Wei Yang Subject: [Patch v2 3/4] tracing: toplevel d_entry already initialized Date: Sun, 12 Jul 2020 09:10:35 +0800 Message-Id: <20200712011036.70948-4-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200712011036.70948-1-richard.weiyang@linux.alibaba.com> References: <20200712011036.70948-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we have following call flow: tracer_init_tracefs() tracing_init_dentry() event_trace_init() tracing_init_dentry() This shows tracing_init_dentry() is called twice in this flow and this is not necessary. Let's remove the second one when it is for sure be properly initialized. Signed-off-by: Wei Yang --- v2: * merged 4 & 5 --- kernel/trace/trace_events.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f6f55682d3e2..76879b29cf33 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -3434,7 +3434,6 @@ early_initcall(event_trace_enable_again); __init int event_trace_init(void) { struct trace_array *tr; - struct dentry *d_tracer; struct dentry *entry; int ret; @@ -3442,11 +3441,7 @@ __init int event_trace_init(void) if (!tr) return -ENODEV; - d_tracer = tracing_init_dentry(); - if (IS_ERR(d_tracer)) - return 0; - - entry = tracefs_create_file("available_events", 0444, d_tracer, + entry = tracefs_create_file("available_events", 0444, NULL, tr, &ftrace_avail_fops); if (!entry) pr_warn("Could not create tracefs 'available_events' entry\n"); @@ -3457,7 +3452,7 @@ __init int event_trace_init(void) if (trace_define_common_fields()) pr_warn("tracing: Failed to allocate common fields"); - ret = early_event_add_tracer(d_tracer, tr); + ret = early_event_add_tracer(NULL, tr); if (ret) return ret; -- 2.20.1 (Apple Git-117)